Reference
Function
- class pycalibration.function.Function[source]
Bases:
Extract
Base class to define function in module
Based on Extract, it supoprt all the extract method. It is necessary to set the files or directory to process before calling the process method.
Evaluate method should be overwritten for data evaluation related to the function beeing developed.
- add_channel(channel, rename='', inter=False)
Set a channel to be retrieved from the MDF. If a rename name is supplied, the channels will be reneamed. If more than one channel as the same rename name, all channels will be checked until one available is found. Interpolation should not be used on digitial signal. The interpolation is linear and should be used on non digitial signals to improve accuracy lf signal in measurement with multiple time raster.
- Parameters
channel – channel name
rename – name to be renamed to
inter – Set to True to interpolate missing values, default False.
- Returns
None
- add_directory(pathname)
Add a directory recursively to the files to be processed. Files recognize are mdf and mf4 exensions
- Parameters
path – path to be added
- Returns
none
- add_file(filename)
Add single file to the list of files to be processed
- Parameters
file – file name path to the file
- Returns
none
- evaluate(data)[source]
Using the data retrieved from the measurement file, generate calibration This method should be over writen by the derivative class and returns what ever the evaluation is producing.
- Returns
should return the evaluation data
- get()
Read the MDF files and retrieved the requested data.
- Returns
list of pandas dataframe contaiing the datas.
- get_channel(channel)
Get the data designated by the channel name
- Parameters
channel – channel name
- Returns
pandas dataframe containing the data
- get_data()
Read the MDF file and retrieved the requested data
- Parameters
filename – filename ( with full path ) of the MDF file to open
- Returns
pandas dataframe containing the datas. The time offset for the channels is set to the column offset. The dataframe indes is based on the file timestamp with the measurement time offset. This allows datetime operation on the dataframe.
- process()[source]
Retrieve the necessary information from the measurment files.
- Returns
list containing files processed results
- set_file(filename)
Extract
- class pycalibration.extract.Extract[source]
Bases:
MDF
Extract class extract channels from single or multiple files
- add_channel(channel, rename='', inter=False)
Set a channel to be retrieved from the MDF. If a rename name is supplied, the channels will be reneamed. If more than one channel as the same rename name, all channels will be checked until one available is found. Interpolation should not be used on digitial signal. The interpolation is linear and should be used on non digitial signals to improve accuracy lf signal in measurement with multiple time raster.
- Parameters
channel – channel name
rename – name to be renamed to
inter – Set to True to interpolate missing values, default False.
- Returns
None
- add_directory(pathname)[source]
Add a directory recursively to the files to be processed. Files recognize are mdf and mf4 exensions
- Parameters
path – path to be added
- Returns
none
- add_file(filename)[source]
Add single file to the list of files to be processed
- Parameters
file – file name path to the file
- Returns
none
- get()[source]
Read the MDF files and retrieved the requested data.
- Returns
list of pandas dataframe contaiing the datas.
- get_channel(channel)
Get the data designated by the channel name
- Parameters
channel – channel name
- Returns
pandas dataframe containing the data
- get_data()
Read the MDF file and retrieved the requested data
- Parameters
filename – filename ( with full path ) of the MDF file to open
- Returns
pandas dataframe containing the datas. The time offset for the channels is set to the column offset. The dataframe indes is based on the file timestamp with the measurement time offset. This allows datetime operation on the dataframe.
- set_file(filename)
MDF
- class pycalibration.mdf.MDF(filename=None)[source]
Bases:
object
MDF class to handle MDF read operation
- add_channel(channel, rename='', inter=False)[source]
Set a channel to be retrieved from the MDF. If a rename name is supplied, the channels will be reneamed. If more than one channel as the same rename name, all channels will be checked until one available is found. Interpolation should not be used on digitial signal. The interpolation is linear and should be used on non digitial signals to improve accuracy lf signal in measurement with multiple time raster.
- Parameters
channel – channel name
rename – name to be renamed to
inter – Set to True to interpolate missing values, default False.
- Returns
None
- get_channel(channel)[source]
Get the data designated by the channel name
- Parameters
channel – channel name
- Returns
pandas dataframe containing the data
- get_data()[source]
Read the MDF file and retrieved the requested data
- Parameters
filename – filename ( with full path ) of the MDF file to open
- Returns
pandas dataframe containing the datas. The time offset for the channels is set to the column offset. The dataframe indes is based on the file timestamp with the measurement time offset. This allows datetime operation on the dataframe.
Trigger
- class pycalibration.trigger.Trigger[source]
Bases:
object
Generate Table at the time of the event. The event shall be generated from a digital signal
Shift
- class pycalibration.shift.Shift[source]
Bases:
object
Generate Table bevore and after shifting All the columns supplied in the data for process will be used. At the beginning of the shift, the columns will be added ‘_pre’, at the end of the shift ‘_post’.
- process(data)[source]
Process the data and return the table containing the shifts.
- Parameters
data – pandas Dataframe containing the data, inclusive the channel to be used to detect the shift
- Returns
Pandas dataframe containing the pre and post shifts data.