Configuration¶
How to change the defaults¶
All user-tunable parameters are centralised in a single file:
src/config.py
Open it with any text editor and modify the values directly:
nano src/config.py # or: vim, code, gedit, …
Because RRINGG is installed in editable mode (pip install -e .),
the change takes effect immediately on the next run — no reinstall required.
See Installation method — editable clone (required) for an explanation of what editable mode means.
Note
Many parameters are also overridable per run via CLI flags without
touching config.py:
# Change plate and fitting method for this run only
rringg -po correction -vr ... --plate EURA --fitting ransac
CLI flags take priority over the defaults in config.py.
See Running RRINGG for the full list of CLI arguments.
Design rationale¶
src/config.py uses Python frozen dataclasses — once created at
startup, the CFG singleton cannot be mutated by any module at runtime.
This prevents accidental parameter overwrites in a multi-step pipeline where
many modules share the same configuration object.
The single entry point for the rest of the codebase is:
from config import CFG # read the defaults
print(CFG.fitting.weight_function) # "huber"
print(CFG.gnss.source) # "NGL"
To override defaults programmatically (e.g. in a script or notebook):
from config import ProcessingConfig, FittingConfig
cfg = ProcessingConfig(
fitting=FittingConfig(max_iter=30),
)
The plane-fitting method (IRLS vs RANSAC) is controlled exclusively by the
--fitting / -fi CLI flag at run time. It is not stored in
FittingConfig.
Note
The former flat-variable tools/parameters.py module has been removed.
Any code that previously imported from it should import from config
instead.
Physical Constants¶
These are defined at module level in config.py and are not part of any
dataclass (they are sensor-specific constants, not tunable parameters).
Constant |
Value |
Description |
|---|---|---|
|
55.466 |
Sentinel-1 C-band carrier wavelength [mm]. |
|
λ / 4π |
Converts interferometric phase [rad] → LOS displacement [mm]. |
|
4π / λ |
Inverse of |
IOConfig — I/O directories¶
Attribute access: CFG.io.<name>
Attribute |
Default |
Description |
|---|---|---|
|
repository root |
Working directory for temporary intermediate files. |
|
|
Destination for corrected products, figures, and |
|
|
On-disk cache for downloaded GNSS data. |
|
500 000 000 |
Maximum cache size in bytes (500 MB). LRU eviction is applied when this limit would be exceeded. |
All four can be overridden from the command line with
--work_directory, --output_directory, and --cache_directory.
FittingConfig — plane-fitting parameters¶
Attribute access: CFG.fitting.<name>
Attribute |
Default |
Description |
|---|---|---|
|
|
Robust weight function used in the IRLS iterations.
|
|
1.345 |
Huber threshold in units of normalised residuals. The value 1.345 gives 95 % asymptotic efficiency relative to OLS under normality. |
|
4.685 |
Tukey bisquare constant. Residuals beyond this value receive weight 0. |
|
50 |
Maximum number of IRLS reweighting iterations. |
|
1 × 10⁻⁵ |
Convergence threshold on ‖Δβ‖ (Euclidean norm of parameter change). |
|
|
Whether to apply a priori observation weights derived from GNSS precision and temporal coverage. Weights follow the Fisher-information formulation \(w_i \propto N_i / \sigma_i^2\), where \(N_i\) is the number of GNSS observation days and \(\sigma_i\) is the projected LOS velocity uncertainty. Normalised to unit mean. |
|
5 |
Number of folds for the cross-validation performed once on the converged model (not inside the iteration loop). |
|
|
Minimum samples per RANSAC iteration. |
|
|
Inlier residual threshold [mm/yr]. |
|
0.30 |
If the detected outlier fraction exceeds this value, the fit is
flagged as unreliable ( |
|
0.01 |
Minimum robust weight (relative to the a priori weight) for an
observation to be classified as an inlier after IRLS convergence.
Observations whose final \(w_\text{robust} / w_\text{prior}\)
falls below this threshold are flagged as outliers in
|
Note
The plane-fitting algorithm (IRLS or RANSAC) is not stored in
FittingConfig. It is controlled exclusively by the --fitting /
-fi CLI flag (default least_squares).
GNSSConfig — data source and station selection¶
Attribute access: CFG.gnss.<name>
General¶
Attribute |
Default |
Description |
|---|---|---|
|
|
Default online GNSS provider: |
|
|
Geodetic reference frame for velocity products.
Supported: |
|
|
ITRF tectonic plate code for plate-motion correction.
Common values: |
|
|
Preferred GNSS analysis centre (EPOS source only). |
|
365 |
Stations with fewer than this many days in their time series are discarded. |
|
5 |
Half-width of the pixel window used when sampling the InSAR raster
at a GNSS station location. The returned value is the mean over a
(2 × |
|
55.466 |
SAR carrier wavelength [mm]. Used to convert raster units (radians) to LOS displacement [mm/yr]. Default is Sentinel-1; change this for other sensors. |
Time-series format (EPOS)¶
Attribute |
Default |
Description |
|---|---|---|
|
|
Coordinate system for GNSS time series: |
|
|
Time-series download format: |
|
|
Temporal sampling: |
|
|
Velocity product format: |
Seismicity (offset detection)¶
Attribute |
Default |
Description |
|---|---|---|
|
5.5 |
Minimum earthquake magnitude searched in the seismicity catalogue when detecting offsets in GNSS time series. |
|
|
Catalogue source: |
Network endpoints¶
These URLs point to the online APIs used to retrieve GNSS metadata, time series, and velocity products. They should only need changing if a provider migrates their service.
Attribute |
Default value |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SpatialConfig — bounding box and distribution analysis¶
Attribute access: CFG.spatial.<name>
Attribute |
Default |
Description |
|---|---|---|
|
1.2 |
Multiplicative scale factor applied to the InSAR bounding box before
querying GNSS stations. 1.0 = no expansion. The CLI flag is |
|
|
Bounding box convention: |
|
120 000 |
Grid spacing [m] used by the Ordinary Kriging fallback when the station spatial distribution is too poor for direct interpolation. |
|
0.0 |
Eastward offset [m] applied to the Kriging grid origin. |
|
0.0 |
Northward offset [m] applied to the Kriging grid origin. |
|
0.6 |
Voronoi-area coefficient of variation above which the station distribution is flagged as inhomogeneous. |
|
30.0 |
Maximum percentage of stations allowed to dominate the coverage
(used with |
|
4.0 |
Maximum ratio of Voronoi area to station-percentage share. |
|
|
Path to the water-bodies shapefile used to exclude sea areas from the InSAR footprint polygon. |
ProcessingConfig — top-level container¶
ProcessingConfig aggregates the four sub-configs above. It is the single
object passed through the pipeline so that every module can access its
parameters without relying on hidden globals.
@dataclass(frozen=True)
class ProcessingConfig:
io: IOConfig
fitting: FittingConfig
gnss: GNSSConfig
spatial: SpatialConfig
doi: str # DOI of the software release (used in .meta files)
The default singleton is:
CFG = ProcessingConfig()
and is importable from anywhere in the codebase:
from config import CFG