Gts.l1trendi

class pyacs.gts.Gts.Gts(code=None, lat=None, lon=None, h=None, X0=None, Y0=None, Z0=None, t0=None, data=None, data_xyz=None, data_corr_neu=None, data_corr_xyz=None, offsets_dates=[], offsets_values=None, outliers=[], annual=None, semi_annual=None, velocity=None, ifile=None, log=None, metadata=None)[source]
l1trendi(alpha='auto', ndays_mf=1, criterion='BIC', lcomponent='ENU', algo='golden', pre_process=4500, bounds=[-2, 1], tol=0.01, refine=True, min_samples_per_segment=5, threshold_bias_res_detect=5, threshold_vel=3, min_sample_segment_refinement=1, norm='L2', verbose=False, log_dir=None, component=None)

Performs l1 trend filter on GPS time series. For each component, optimal filter parameter is searched using specified criterion. Uses https://pypi.org/project/trendfilter/

Parameters:
  • alpha (float or str) – Either hyperparameter as float or ‘auto’ to find optimal filtering using criterion

  • ndays_mf (int) – Parameter for a median filter to be applied prior to l1-trend filtering

  • criterion (str) – Criterion to select automatic optimal l1-trend filtering. Options: ‘BIC’ (default), ‘AICc’, ‘Cp’

  • lcomponent (str) – List of components to be filtered. Other components will remain unchanged

  • algo (str) – Algorithm to find optimal alpha. Options: ‘golden’ (default) or ‘custom’

  • pre_process (float) – Pre-process time series to avoid convergence problems in l1trend. It corrects for unrealistically large velocity using the threshold provided (mm/yr). Correction is then added again after l1_trend. Default is 3600 (3.6 m/yr)

  • bounds (list) – Bounds for golden section search algorithm. Default is [-2, 1]

  • tol (float) – Tolerance for golden section search algorithm. Default is 0.01

  • refine (bool) – If True, will run refinement after l1 trend filtering

  • min_samples_per_segment (int) – Minimum number of samples per segment for refinement

  • threshold_bias_res_detect (float) – Threshold for bias detection in refinement

  • threshold_vel (float) – Threshold for velocity detection in refinement

  • min_sample_segment_refinement (int) – Minimum number of samples per segment in refinement

  • norm (str) – Norm to use for refinement. Options: ‘L2’ (default)

  • verbose (bool) – Enable verbose output for debugging

  • log_dir (str or None) – If provided, directory where the log file will be created. The log file will be named ‘SITE_l1trendi.log’ where SITE is the site code. If None, no file logging is performed.

  • component (str or None) – Components to process (‘N’, ‘E’, ‘U’, ‘NE’, ‘EN’, ‘NU’, ‘UN’, ‘EU’, ‘UE’, ‘NEU’, etc.). If None, uses lcomponent parameter. Used for component-specific statistics calculation.

Returns:

l1-trend filtered time series as new Gts instance

Return type:

Gts

Raises:
  • ValueError – If invalid parameters are provided

  • RuntimeError – If processing fails