resistics.project.preprocess module

resistics.project.preprocess.applyCalibrationOptions(options: Dict, cal: resistics.calibrate.calibrator.Calibrator, timeData: resistics.time.data.TimeData, reader: resistics.time.reader.TimeReader) → resistics.time.data.TimeData[source]

Calibrate time data with user options

To calibrate, specify options[“calibrate”] = True

Parameters
optionsDict

User specified options for calibrating

calCalibrator

A calibrator instance

timeDataTimeData

Time data to filter

reader: DataReader

A data reader object for the data

Returns
TimeData

Calibrated time data

resistics.project.preprocess.applyFilterOptions(options: Dict, timeData: resistics.time.data.TimeData) → resistics.time.data.TimeData[source]

Filter time data

To low pass filter, specify options[“filter”][“lpfilt”] = high cutoff frequency To high pass filter, specify options[“filter”][“hpfilt”] = low cutoff frequency To bandass filter, specify options[“filter”][“bpfilt”] = [low cutoff frequency, high cutoff frequency]

Parameters
optionsDict

User specified options for filtering

timeDataTimeData

Time data to filter

Returns
TimeData

Filtered time data

resistics.project.preprocess.applyInterpolationOptions(options: Dict, timeData: resistics.time.data.TimeData) → resistics.time.data.TimeData[source]

Interpolate time data

Interpolate time data to make sure all the data starts on a full second. This is best to do before resampling.

To interpolate, options[“interp”] needs to be set to True

Parameters
optionsDict

Interpolation options in a dictionary

timeDataTimeData

Time data object

Returns
TimeData

Interpolated time data

Notes

This will fail with longer sample periods (i.e. greater than a second)

resistics.project.preprocess.applyNormaliseOptions(options: Dict, timeData: resistics.time.data.TimeData) → resistics.time.data.TimeData[source]

Normalise time data

To normalise, options[“normalise”] needs to be set to True

Parameters
optionsDict

User specified options for normalising

timeDataTimeData

Time data to filter

Returns
TimeData

Normalised time data

resistics.project.preprocess.applyNotchOptions(options: Dict, timeData: resistics.time.data.TimeData) → resistics.time.data.TimeData[source]

Notch filter time data

To notch filter, options[“notch”] needs to be a list of frequencies to filter out. For example, to notch filter at 16.6Hz, this would be: options[“notch”] = [16.6] For two frequencies, for example 16.6Hz and 50Hz, then: options[“notch”] = [16.6, 50]

Parameters
optionsDict

User specified options for notching

timeDataTimeData

Time data to filter

Returns
TimeData

Notch filtered time data

resistics.project.preprocess.applyPolarisationReversalOptions(options: Dict, timeData: resistics.time.data.TimeData) → resistics.time.data.TimeData[source]

Polarity reverse time data

Parameters
optionsDict[str, bool]

User specified options for polarity reversal

timeDataTimeData

Time data to polarity reverse

Returns
TimeData

Polarity reversed time data

resistics.project.preprocess.applyResampleOptions(options: Dict, timeData: resistics.time.data.TimeData) → resistics.time.data.TimeData[source]

Resample time data

The resampling options in the options dictionary should be specified as: options[“resample”][frequency to resample from] = frequency to resample to

Parameters
optionsDict

Interpolation options in a dictionary

timeDataTimeData

Time data object

Returns
TimeData

Resampled time data

resistics.project.preprocess.applyScaleOptions(options: Dict, timeData: resistics.time.data.TimeData) → resistics.time.data.TimeData[source]

Scale the time data

Parameters
optionsDict

User specified options for scaling

timeDataTimeData

Time data to polarity reverse

Returns
TimeData

Polarity reversed time data