DiFfRG.file_io#
Classes#
Functions#
|
Creates a directory if it does not exist. |
|
|
|
Utility function to extract nodes and data from a (loaded) vtk file. |
|
Reads a csv file and returns a pandas dataframe. |
|
Reads a csv file which contains data for different values of k and returns the data split into separate csvs for each value of k. |
|
Reads a csv file which contains data for different values of k and returns the data split into separate csvs for each value of k. |
Module Contents#
- class DiFfRG.file_io.FEMData(filename: str)#
- filename#
- slice_cache#
- dir#
- timesteps = []#
- files = []#
- get_full_data()#
- class DiFfRG.file_io.SimulationData1D(name)#
Bases:
FEMData1D- pvd_file#
- params#
- csv_files#
- csv_data#
- get_csv(name)#
- DiFfRG.file_io.mkdir(path: str)#
Creates a directory if it does not exist.
- Parameters:
path (str) – The path to the directory to be created.
- DiFfRG.file_io.get_vtk_data(vtkdata)#
Utility function to extract nodes and data from a (loaded) vtk file.
- Parameters:
vtkdata – The loaded vtk data.
- Returns:
A tuple containing a numpy array of nodes and a dict with the arrays in the vtkdata.
- Return type:
- DiFfRG.file_io.read_csv(csv, delim=',', header='infer')#
Reads a csv file and returns a pandas dataframe.
- DiFfRG.file_io.read_k_csv(filename, delim=',', kName='kGeV')#
Reads a csv file which contains data for different values of k and returns the data split into separate csvs for each value of k.
- Parameters:
- Returns:
A tuple containing a list with the unique values of k and a list of pandas dataframes for each value of k.
- Return type:
- DiFfRG.file_io.split_csv(csv, name='kGeV')#
Reads a csv file which contains data for different values of k and returns the data split into separate csvs for each value of k.
- Parameters:
- Returns:
A tuple containing a list with the unique values of k and a list of pandas dataframes for each value of k.
- Return type: