preprocess (pyleoclim.utils.tsutils.preprocess)

pyleoclim.utils.tsutils.preprocess(ys, ts, detrend=False, sg_kwargs=None, gaussianize=False, standardize=True)[source]

Return the processed time series using detrend and standardization.

Parameters
  • ys (array) – a time series

  • ts (array) – The time axis for the timeseries. Necessary for use with the Savitzky-Golay filters method since the series should be evenly spaced.

  • detrend (string) – ‘none’/False/None - no detrending will be applied; ‘linear’ - a linear least-squares fit to ys is subtracted; ‘constant’ - the mean of ys is subtracted ‘savitzy-golay’ - ys is filtered using the Savitzky-Golay filters and the resulting filtered series is subtracted from y.

  • sg_kwargs (dict) – The parameters for the Savitzky-Golay filters. see pyleoclim.utils.filter.savitzy_golay for details.

  • gaussianize (bool) – If True, gaussianizes the timeseries

  • standardize (bool) – If True, standardizes the timeseries

Returns

res – the processed time series

Return type

array

See also

pyleoclim.utils.filter.savitzy_golay

Filtering using Savitzy-Golay