resistics.time.clean module¶
-
resistics.time.clean.
groupConsecutive
(vals: numpy.ndarray, stepsize: int = 1)[source]¶ Takes an array of values and splits it into consecutive sections of stepsize
In general, the stepsize is 1.
- Parameters
- valsnp.ndarray
A set of values to split into consecutive sections
- stepsizeint
The stepsize between values that means they are consecutive
Examples
An array of [1,2,3,5,6,7,10,12,13] would be split into consecutive sections [1,2,3], [5,6,7], [10], [12,13]
-
resistics.time.clean.
removeNans
(data: Dict)[source]¶ Remove NaNs in the data
This function finds NaNs in the data and tries to fill them in with better data i.e. interpolated data or some such.
- Parameters
- dataDict
Dictionary of data with channel as key and a np.ndarray as value
- Returns
- Dict
Dictionary of data with channel as key and a np.ndarray as value (with zero stretches removed)
-
resistics.time.clean.
removeNansSingle
(data)[source]¶ Remove NaNs in a data array
This function finds NaNs in the np.ndarray and tries to fill them in with better data i.e. interpolated data or some such.
- Parameters
- datanp.ndarray
Array of data
- Returns
- np.ndarray
Array of data with zeros removed
-
resistics.time.clean.
removeZeros
(data: Dict)[source]¶ Remove a stretch of zeros in the data
This function finds a stretch of zeros and tries to fill them in with better data i.e. interpolated data or some such.
- Parameters
- dataDict
Dictionary of data with channel as key and a np.ndarray as value
- Returns
- Dict
Dictionary of data with channel as key and a np.ndarray as value (with zero stretches removed)
-
resistics.time.clean.
removeZerosSingle
(data: numpy.ndarray) → numpy.ndarray[source]¶ Remove a stretch of zeros in a data array
This function finds a stretch of zeros and tries to fill them in with better data i.e. interpolated data or some such.
- Parameters
- datanp.ndarray
Array of data
- Returns
- np.ndarray
Array of data with zeros removed