Preprocessing#
Text
- MAPIT.core.Preprocessing.SimErrors(rawData, ErrorMatrix, iterations, GUIObject=None, doTQDM=True, batchSize=10, dopar=False, bar=None)#
Function to add simulated measurement error. Supports variable sample rates. Assumes the traditional multiplicative measurement error model:
\(M_{i,j} = T(1+R_{i,j}+S_j)\)
Random errors: \(R_{i,j} \sim \mathcal{N}(0,{\delta_R}_j^2)\)
Systematic errors: \(S_{j} \sim \mathcal{N}(0,{\delta_S}_j^2)\)
where \(i\) is the measurement time and \(j\) is the location
- Parameters:
rawData (list) – Raw data to apply errors to, list of 2D ndarrays. Each entry in the list should correspond to a different location and the shape of ndarray in the list should be [MxN] where M is the sample dimension (number of samples) and N is the elemental dimension, if applicable. If only considering one element, each ndarray in the rawData list should be [Mx1].
ErrorMatrix (ndarray) – 2D ndarray of shape [Mx2] describing the relative standard deviation to apply to
rawData
. M sample dimension in each input array and should be identical to M described inrawData
. The second dimension (e.g., 2) refers to the random and systematic error respectively such thatErrorMatrix[0,0]
refers to the random relative standard deviation of the first location andErrorMatrix[0,1]
refers to the systematic relative standard deviation.iterations (int) – Number of iterations to calculate
GUIObject (obj, default=None) – GUI object for internal MAPIT use
doTQDM (bool, default=True) – Controls the use of TQDM progress bar for command line or notebook operation.
- Returns:
List of arrays identical in shape to
rawData
. A list is returned so that each location can have a different sample rate.- Return type:
list