pyacs.gts.lib.outliers_old module

pyacs.gts.lib.outliers_old.find_outlier_around_date(self, date, conf_level=95, n=3, lcomponent='NE', verbose=True)[source]

Find an outlier around a given date (F-ratio test).

Returns the index of the outlier, or [] if none found.

Parameters:
  • date (float) – Date in decimal year.

  • conf_level (float, optional) – Confidence level for F-ratio test (default 95).

  • n (int, optional) – Number of dates on each side (default 3).

  • lcomponent (str, optional) – Components ‘N’, ‘E’, ‘U’, ‘NE’, ‘NEU’ (default ‘NE’).

  • verbose (bool, optional) – Verbose mode.

Returns:

self with outlier flagged, or [] if no significant outlier.

Return type:

Gts or list

pyacs.gts.lib.outliers_old.find_outliers_and_offsets_through_differentiation(self, th=100)[source]

find outliers and offsets using differenciation

pyacs.gts.lib.outliers_old.find_outliers_by_RMS_ts(self, ndays=7, th_detection=5, th_rejection=2)[source]
Find index of outliers in a time series, populate self.outliers.
  • rms time series are first calculated over ndays

  • time windows are kept for further inspection if rms(t) > th_detection * median(rms(ts))

  • for each anomalous time windows, differentiate positions, find the max

  • test whether it is a true outlier (differentiated(t) > th_rejection * median(differentiated))

output:

None

pyacs.gts.lib.outliers_old.find_outliers_by_residuals(self, threshold=5, model='detrend_seasonal', component='NE', in_place=False)[source]

Find index of outliers by trendline/trendline_annual/trendline_seasonal (the complete model) Then the outliers are detected if their residuals are greater than th_rejection*standard_deviation

output:

Add the list of outlier index into self.outliers

pyacs.gts.lib.outliers_old.find_outliers_percentage(self, percentage=0.03, in_place=False, verbose=False, component='NEU', periods=None, excluded_periods=None)[source]

detrend a time series and ranks the residuals by increasing absolute value populate the outliers with the x % largest ones on each component

pyacs.gts.lib.outliers_old.find_outliers_simple(self, threshold=100, window_length=10, in_place=False, verbose=False, component='NEU', periods=None, excluded_periods=None)[source]
pyacs.gts.lib.outliers_old.find_outliers_sliding_window(self, threshold=3, in_place=False, verbose=True, periods=[[]], excluded_periods=[[]], component='NE', window_len=15, automatic=True)[source]

Find outliers using sliding windows

pyacs.gts.lib.outliers_old.find_outliers_vondrak(self, threshold=10, fc=2.0, in_place=False, verbose=True, periods=[[]], excluded_periods=[[]], component='NE')[source]

Find outliers using a Vondrak filter

pyacs.gts.lib.outliers_old.remove_outliers(self, periods=None, in_place=False)[source]

Remove outliers listed in self.outliers from the time series.

Parameters:
  • periods (list, optional) – If given, only remove outliers within these periods.

  • in_place (bool, optional) – If True, modify self; otherwise return a new Gts.

Returns:

Time series without outliers (new or self if in_place).

Return type:

Gts