Data reader functions
Module responsible for data reading in DMT.
The functions here read from many different formats into a DMT-DataFrame. As reading and writing is always very close, recommended and often used save functions for DataFrames are also given.
Functions
- read_data(filename)
Reads a given file into the internal DMT dataframe, the file’s extension determines the exact method which is then called for reading.
- read_hdf(filename, key, convert_cmplx)
Reads in a .hdf file into the internal DMT format.
- read_elpa(filename)
Reads in a .elpa file into the internal DMT format.
- read_mdm(filename)
Reads in a .mdm file into the internal DMT format.
- read_csv(filename)
Read .csv file and generate a DMT dataframe from it.
- read_feather(filename)
Read .feather file and generate a DMT dataframe from it.
- read_DEVICE_bin(filename)
Reads DEVICE binaries. Here the internal spacial data is saved. Returns a Dataframe.
- read_ADS_bin(filename)
Reads a ADS raw data file into a DMT dataframe.
- read_tikz_file(filename, col_x=None, col_y=None)
Reads a tikz plot file into a DMT dataframe.
- save_hdf(df, save_dir, filename)
Save the dataframe df into save_dir as filename.h5 .
- save_elpa(fname, ELPA, cols, firstline)
Save data as a elpa file.
- DMT.core.data_reader.read_ADS_bin(filename)[source]
Reads a ADS raw data file into a DMT dataframe.
- Parameters:
- filename
str
Path to the file to read
- filename
- Returns:
- df
DMT.core.Dataframe
DMT dataframe representing the data.
- df
- DMT.core.data_reader.read_DEVICE_bin(filename)[source]
Reads DEVICE binaries. Here the internal spacial data is saved. Returns a Dataframe.
- Parameters:
- filename
str
Path to the file to read
- filename
- Returns:
- df
DMT.core.Dataframe
DMT dataframe representing the data.
- df
- DMT.core.data_reader.read_csv(filename, **kwargs)[source]
Read .csv file and generate a DMT dataframe from it.
- Parameters:
- filename
str
oros.Pathlike
filename of .csv file including path.
- **kwargs
kwargs are passed to pandas.read_csv
- filename
- Returns:
- df
DMT.core.Dataframe
DMT dataframe representing the csv data.
- df
- DMT.core.data_reader.read_data(filename, key=None, **kwargs)[source]
General data reading routine.
Used to read in data of an arbitrary file format. Correct reading routine is selected based on file extension.
- Parameters:
- filename
str
Name of the file to be read including path
- filename
- Returns:
- df
DMT.Dataframe
() Dataframe that contains the cleaned up data contained in file filename
- df
- DMT.core.data_reader.read_elpa(filename, header=2)[source]
Read .elpa file and generate a DMT dataframe from it.
- Parameters:
- filename
str
filename of .elpa file including path.
- header
integer
Row number where actual data starts. Default=2 as is common for CEDIC in-house tools.
- filename
- Returns:
- df
DMT.core.Dataframe
DMT dataframe representing the elpa data.
- df
- DMT.core.data_reader.read_feather(filename, **kwargs)[source]
Read .feather file and generate a DMT dataframe from it.
- Parameters:
- filename
str
oros.Pathlike
filename of .csv file including path.
- **kwargs
kwargs are passed to pandas.read_csv
- filename
- Returns:
- df
DMT.core.Dataframe
DMT dataframe representing the csv data.
- df
- DMT.core.data_reader.read_hdf(filename, key)[source]
Read .h5 file and return the stored pandas dataframe from it.
- Parameters:
- filename
str
oros.Pathlike
filename of .mdm file including path
- filename
- Returns:
- dataframe
DMT.core.Dataframe
DMT DataFrame that stores the mdm data.
- dataframe
- DMT.core.data_reader.read_mdm(filename)[source]
Read .mdm file and generate a DMT dataframe from it.
- Parameters:
- filename
str
oros.Pathlike
filename of .mdm file including path.
- filename
- Returns:
DMT.core.Dataframe
DMT dataframe representing the mdm data.
- DMT.core.data_reader.read_tikz_file(filename, col_x=None, col_y=None)[source]
Reads a tikz plot file into a DMT dataframe.
- Parameters:
- Returns:
DMT.core.Dataframe
DMT dataframe representing the data.