pycalibration package
Submodules
pycalibration.curve module
- class pycalibration.curve.Curve(x, y)[source]
Bases:
object
Curve allow the defintion and extroplation of data of a curve
This class is usually returned by the DCM class after importing a file.
pycalibration.engine module
- class pycalibration.engine.Engine(n=[600, 1000, 2000, 4000, 6000], t=[100, 500, 1000, 800, 100])[source]
Bases:
object
Class engine offers support for engine calculation and estimation.
pycalibration.extract module
- class pycalibration.extract.Extract[source]
Bases:
MDF
Extract class extract channels from single or multiple files
- 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
pycalibration.function module
- 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.
pycalibration.gearbox module
pycalibration.map module
pycalibration.mdf module
- 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.
pycalibration.resistance module
- class pycalibration.resistance.Resistance(cx=0, fr=0, ro=0)[source]
Bases:
object
This class calculates the vehicle driving resistance
- fair(v)[source]
Return the air resisting force :param v: vehicle speed in m/s :return: air resisting force in N
- fpitch(m, grade)[source]
Return the pitch resisting force at a specified pitch :param m: total vehicle mass in kg :param pitch: slope in percentage :return: pitch resisting force in N
pycalibration.shift module
- 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.
pycalibration.trigger module
- class pycalibration.trigger.Trigger[source]
Bases:
object
Generate Table at the time of the event. The event shall be generated from a digital signal
pycalibration.value module
- class pycalibration.value.Value(x, y=None, z=None)[source]
Bases:
object
Value class represent the informations stored in a parameter. Each value can be a single value, a curve or a map. All points are interpolated
- x(pos)[source]
Return the X value at a position ( interpolated from the array) :param pos: position in the array :return: X value
pycalibration.vbo module
pycalibration.vehicle module
- class pycalibration.vehicle.Vehicle[source]
Bases:
object
class to represent a vehicle and basic calulation for the vehicle configuration
- engine_to_speed(engine, gear)[source]
Returns the vehicle speed from the engine speed and the common powertrain ratio :param engine: engine speed in 1/min :param gear: gear number :return: vehicle speed in m/s
- force_to_torque(f, gear)[source]
Returns the engine torque from the traction force and the common powertrain ratio :param f: traction force in N :param ratio: common powertrain ratio :return: engine torque in Nm
- fresist(speed, mass, grade=0)[source]
Returns the resistance force by entering the vehicle speed and the ratio (default ratio = 1) :param speed: vehicle speed in m/s :param mass: total vehicle mass in kg :param grade: road grade :return: resistance force in N
- ratio(gear)[source]
return the gear ration from the given gear
- Parameters
gear – gear number
- Returns
trans ratio (gear and rear axle ratio)
- speed_to_engine(speed, gear)[source]
Returns the engine speed from the vehicle speed and the common powertrain ratio :param speed: vehicle speed in m/s :param gear: gear number :return: engine speed in 1/min
pycalibration.watchdog module
- class pycalibration.watchdog.Watchdog(queue, path='.')[source]
Bases:
FileSystemEventHandler
- on_created(event)[source]
Called when a file or directory is created.
- Parameters
event (
DirCreatedEvent
orFileCreatedEvent
) – Event representing file/directory creation.