pyms.Noise

Noise processing functions.

pyms.Noise.Analysis

Noise analysis functions.

Functions:

window_analyzer(ic[, window, n_windows, ...])

A simple estimator of the signal noise based on randomly placed windows and median absolute deviation.

window_analyzer(ic, window=256, n_windows=1024, rand_seed=None)[source]

A simple estimator of the signal noise based on randomly placed windows and median absolute deviation.

The noise value is estimated by repeatedly and picking random windows (of a specified width) and calculating median absolute deviation (MAD). The noise estimate is given by the minimum MAD.

Parameters:
Return type:

float

Returns:

The noise estimate.

Author:

Vladimir Likic

pyms.Noise.SavitzkyGolay

Savitzky-Golay noise filter.

Functions:

savitzky_golay(ic[, window, degree])

Applies Savitzky-Golay filter on an ion chromatogram.

savitzky_golay_im(im[, window, degree])

Applies Savitzky-Golay filter on Intensity Matrix.

savitzky_golay(ic, window=7, degree=2)[source]

Applies Savitzky-Golay filter on an ion chromatogram.

Parameters:
  • ic (IonChromatogram) – The input ion chromatogram.

  • window (Union[int, str]) – The window selection parameter. This can be an integer or time string. If an integer, taken as the number of points. If a string, must be the form '<NUMBER>s' or '<NUMBER>m', specifying a time in seconds or minutes, respectively. Default 7.

  • degree (int) – degree of the fitting polynomial for the Savitzky-Golay filter. Default 2.

Return type:

IonChromatogram

Returns:

Smoothed ion chromatogram.

Authors:

Uwe Schmitt, Vladimir Likic, Dominic Davis-Foster

savitzky_golay_im(im, window=7, degree=2)[source]

Applies Savitzky-Golay filter on Intensity Matrix.

Simply wraps around the Savitzky Golay function above.

Parameters:
  • im (BaseIntensityMatrix)

  • window (Union[int, str]) – The window selection parameter. Default 7.

  • degree (int) – degree of the fitting polynomial for the Savitzky-Golay filter. Default 2.

Returns:

Smoothed IntensityMatrix.

Return type:

BaseIntensityMatrix

Authors:

Sean O’Callaghan, Vladimir Likic, Dominic Davis-Foster

pyms.Noise.Window

Moving window noise filter.

Functions:

window_smooth(ic[, window, use_median])

Applies window smoothing on ion chromatogram.

window_smooth_im(im[, window, use_median])

Applies window smoothing on Intensity Matrix.

window_smooth(ic, window=3, use_median=False)[source]

Applies window smoothing on ion chromatogram.

Parameters:
  • ic (IonChromatogram)

  • window (Union[int, str]) – The window selection parameter. This can be an integer or time string. If an integer, taken as the number of points. If a string, must be in the form '<NUMBER>s' or '<NUMBER>m', specifying a time in seconds or minutes, respectively Default 3.

  • use_median (bool) – Whether to use the the mean or median window smoothing. Default False.

Return type:

IonChromatogram

Returns:

Smoothed ion chromatogram

Authors:

Vladimir Likic, Dominic Davis-Foster (type assertions)

window_smooth_im(im, window=3, use_median=False)[source]

Applies window smoothing on Intensity Matrix.

Simply wraps around the window smooth function above.

Parameters:
Returns:

Smoothed Intensity Matrix

Return type:

BaseIntensityMatrix

Authors:

Sean O’Callaghan, Vladimir Likic