pyacs.gts.lib.l1trend.check_trend module

Functions for checking and analyzing L1-trend model quality.

pyacs.gts.lib.l1trend.check_trend.check_l1_trend(ts, l1ts, component='ENU', min_samples_per_segment=4, threshold_bias_res_detect=40, threshold_vel=8, plot=False)[source]

Inspect the result from l1trend model of a time series. Returns a list periods ([sdate,edate]) where bad modelling is suspected.

Parameters:
  • ts (pyacs.gts.Gts.Gts) – Raw time series

  • l1ts (pyacs.gts.Gts.Gts) – L1-trend time series

  • component (str) – Components to be analyzed. Default: ‘EN’

  • min_samples_per_segment (int) – Minimum number of samples for a segment to be inspected (default: 6)

  • threshold_bias_res_detect (float) – Threshold to detect bias residuals (default: 40)

  • threshold_vel (float) – Instantaneous velocity threshold for a segment to be considered in detection (default: 8 mm/yr)

  • plot (bool) – Plot the results (default: False)

Returns:

(H_period, H_cp, H_cp_pb) - H_period: Dictionary of suspicious periods for each component - H_cp: Dictionary of breakpoint indices for each component - H_cp_pb: Dictionary of problematic breakpoint indices for each component

Return type:

tuple

pyacs.gts.lib.l1trend.check_trend.compute_measure_bias(t, l1y, y, cp, min_samples_per_segment=6, threshold_bias_res_detect=40, threshold_vel=8, verbose=True)[source]

Compute fit indicators from residual (obs minus piecewise linear).

Parameters:
  • t (ndarray) – Time array.

  • l1y (ndarray) – L1-trend values.

  • y (ndarray) – Residual (obs - piecewise_linear).

  • cp (ndarray) – Breakpoint indices.

  • min_samples_per_segment (int, optional) – Minimum samples per segment (default 6).

  • threshold_bias_res_detect (float, optional) – Threshold for bias detection (default 40).

  • threshold_vel (float, optional) – Velocity threshold in mm/yr (default 8).

  • verbose (bool, optional) – Verbose mode.

Returns:

(list of suspicious periods [sdate, edate], list of problematic breakpoint indices).

Return type:

tuple

pyacs.gts.lib.l1trend.check_trend.make_node_ts(x, y, threshold=0.5)[source]

Find breakpoints assuming y is piecewise linear.

Parameters:
  • x (ndarray) – Time/abscissa.

  • y (ndarray) – Values (piecewise linear).

  • threshold (float, optional) – Threshold on change in slope to declare breakpoint.

Returns:

Indices of breakpoints in the time series.

Return type:

ndarray

pyacs.gts.lib.l1trend.check_trend.measure_bias(t, y)[source]

Provide a measure of potential bias in a residual time series (0-100).

Parameters:
  • t (ndarray) – Time array.

  • y (ndarray) – Residual values.

Returns:

(res, resv): bias score and median absolute residual.

Return type:

tuple