vlaplex/scripts_python/readF.py
JGonzalez 052a4dc05e Corrections to tag v2.5
Small set of corrections to the tag v2.5.

Includes changes to python scripts to plot data.

Includes new 'fast' setup conditions that allow to output cases in an
hour or so with still a good CFL condition and grid resolution.
2025-04-08 16:32:59 +02:00

21 lines
547 B
Python

import pandas
def read(filename):
# Get time
df = pandas.read_csv(filename,skiprows=0,nrows=1)
time = df['t (s)'].to_numpy()[0]
df = pandas.read_csv(filename,skiprows=2,nrows=1)
Z = df['Z'].to_numpy()[0]
df = pandas.read_csv(filename,skiprows=2,nrows=1,header=None)
x = df.to_numpy()[0][1:]
df = pandas.read_csv(filename,skiprows=5,header=None)
f = []
for col in df:
if col == 0:
v = df[col].to_numpy()
else:
f.append(df[col].to_numpy())
return time, x, v, f