resistics.decimate.decimator module¶
-
class
resistics.decimate.decimator.
Decimator
(timeData: resistics.time.data.TimeData, decParams: resistics.decimate.parameters.DecimationParameters)[source]¶ Bases:
resistics.common.base.ResisticsBase
Decimate time data
Decimates time data by factors until the minimum number of required samples is reached. When a downsample factor is too large, downsampling is performed in multiple steps to maintain accuracy of result.
- Attributes
- timeDataTimeData
timeData object to decimate
- sampleFreqfloat
Sampling frequency of time data in Hz
- chansList[str]
Channels in time data
- numSamplesint
Number of samples in timeData
- decParamsDecimationParams
A DecimationParams object holding decimation information
- minSamplesint
Minimum required samples to decimate
- levelint
Current decimation level
- maxDownSampleFactorint
Max allowable downsampling in one go. Downsampling becomes less accurate at large downsample factors
Methods
__init__(timeData, decParams)
Initialise Decimator with a TimeData object and DecimationParams object
incrementLevel()
Downsample the timeData to the next decimation level
downsample(downsampleFactor)
Do the downsampling
printList()
Class status returned as list of strings
-
downsample
(self, downsampleFactor: int) → bool[source]¶ Downsample time data
- Parameters
- downsampleFactorint
Downsampling factor
- Returns
- outbool
True if downsampling completed successfully. False otherwise
Notes
When the downsampling causes number of simples to fall below minSamples, downsampling is not performed. The function returns False in this situation
-
incrementLevel
(self) → bool[source]¶ Downsample to the next decimation level
- Returns
- outbool
True if downsampling completed successfully. False otherwise
Notes
When the downsampling factor is too large, downsampling is performed in multiple steps. Downsampling will become increasingly inaccurate using the scipy routine when factor is too large