pride-ppp API

PRIDE-PPPAR integration — RINEX input, kinematic positions output.

Specifications

PRIDE PPP-AR configuration file models.

Read/write the config_file format consumed by the pdp3 binary.

class pride_ppp.specifications.config.AmbiguityFixingOptions(*, ambiguity_co_var='Default', ambiguity_duration=600, cutoff_elevation=15, pco_on_wide_lane='YES', widelane_decision=<factory>, narrowlane_decision=<factory>, critical_search=<factory>, truncate_at_midnight='Default', verbose_output='NO')[source]

Bases: BaseModel

Ambiguity resolution parameters for the pdp3 config file.

Attributes

ambiguity_co_varstr

"YES" to use LAMBDA method for ambiguity fixing.

ambiguity_durationint

Minimum time duration in seconds for a resolvable ambiguity.

cutoff_elevationint

Cutoff mean elevation angle (degrees) for eligible ambiguities.

pco_on_wide_lanestr

"YES"/"NO" — apply PCO corrections on Melbourne-Wübbena.

widelane_decisionList[float]

[deviation, sigma, threshold] in cycles for wide-lane ambiguities.

narrowlane_decisionList[float]

[deviation, sigma, threshold] in cycles for narrow-lane ambiguities.

critical_searchList[float]

[max_exclude, min_reserve, fixed_float, ratio_threshold].

truncate_at_midnightstr

"YES" to truncate ambiguities at midnight (avoids day-boundary discontinuities).

verbose_outputstr

"YES"/"NO" — output detailed ambiguity resolution info.

ambiguity_co_var: str
ambiguity_duration: int
cutoff_elevation: int
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

narrowlane_decision: list[float]
pco_on_wide_lane: str
truncate_at_midnight: str
verbose_output: str
widelane_decision: list[float]
Parameters:
  • ambiguity_co_var (str)

  • ambiguity_duration (int)

  • cutoff_elevation (int)

  • pco_on_wide_lane (str)

  • widelane_decision (list[float])

  • narrowlane_decision (list[float])

  • critical_search (list[float])

  • truncate_at_midnight (str)

  • verbose_output (str)

class pride_ppp.specifications.config.DataProcessingStrategies(*, strict_editing='Default', rck_model='Default', ztd_model='Default', htg_model='Default', iono_2nd='Default', tides='SOLID/OCEAN/POLE', multipath='Default')[source]

Bases: BaseModel

Data processing strategy defaults for the pdp3 config file.

Attributes

strict_editingstr

"YES"/"NO"/"Default". Set to "NO" for high-dynamic data with poor quality.

rck_modelstr

Receiver clock model: "WNO" (white noise) or "STO" (random walk).

ztd_modelstr

Zenith troposphere delay model: "PWC:60" (piece-wise constant, 60 min) or "STO" (random walk).

htg_modelstr

Horizontal troposphere gradient model: "PWC"/"STO"/"NON".

iono_2ndstr

"YES" to correct 2nd-order ionospheric delays.

tidesstr

Tidal corrections to apply (e.g. "SOLID/OCEAN/POLE").

multipathstr

"YES"/"NO" — enable multipath correction model.

htg_model: str
iono_2nd: str
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

multipath: str
rck_model: str
strict_editing: str
tides: str
ztd_model: str
Parameters:
  • strict_editing (str)

  • rck_model (str)

  • ztd_model (str)

  • htg_model (str)

  • iono_2nd (str)

  • tides (str)

  • multipath (str)

class pride_ppp.specifications.config.ObservationConfig(*, table_directory, frequency_combination='Default', interval='Default', time_window=0.01, session_time='-YYYY- -MM- -DD- -HH- -MI- -SS- -SE-')[source]

Bases: BaseModel

Observation section of the pdp3 config file.

Attributes

table_directorystr

Path to the directory containing ANTEX, leap-second, and satellite metadata tables required by pdp3.

frequency_combinationstr

Frequency combination string (e.g. "Default").

intervalstr

Processing interval in seconds, or "Default" for auto.

time_windowfloat

Observation time window tolerance in seconds.

session_timedatetime | str

Session time template. When a string, pdp3 substitutes date/time placeholders at runtime.

frequency_combination: str
interval: str
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

session_time: datetime | str
table_directory: str
time_window: float
Parameters:
class pride_ppp.specifications.config.PRIDEPPPFileConfig(*, observation, satellite_products, processing=<factory>, ambiguity=<factory>, satellites=<factory>, station_used=<factory>)[source]

Bases: BaseModel

Top-level pdp3 config_file model with read/write support.

Mirrors every section of the PRIDE-PPPAR 3 config template. Instances can be serialised to disk via write_config_file and deserialised with read_config_file or load_default.

Attributes

observationObservationConfig

Observation-related settings (table dir, interval, time window).

satellite_productsSatelliteProducts

Paths to resolved GNSS product files (SP3, CLK, ERP, …).

processingDataProcessingStrategies

Processing strategy flags (clock model, tides, troposphere).

ambiguityAmbiguityFixingOptions

Ambiguity resolution thresholds and decision criteria.

satellitesSatelliteList

Active satellite PRNs and their variance weights.

station_usedList[StationUsed]

Per-station processing parameters.

Example

>>> cfg = PRIDEPPPFileConfig.load_default()
>>> cfg.write_config_file("/tmp/config_file")
ambiguity: AmbiguityFixingOptions
classmethod load_default()[source]

Load the default config_template shipped with PRIDE-PPPAR.

Searches ~/.PRIDE_PPPAR_BIN/config_template first, then falls back to /opt/PRIDE-PPPAR/.PRIDE_PPPAR_BIN/config_template.

Returns

PRIDEPPPFileConfig

Config populated from the template.

Raises

FileNotFoundError

If neither installation path exists.

Return type:

PRIDEPPPFileConfig

model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

observation: ObservationConfig
processing: DataProcessingStrategies
classmethod read_config_file(file_path)[source]

Parse a PRIDE PPP config_file from disk.

Note: the station_used section is not fully parsed; a single default StationUsed instance is always returned regardless of the file contents.

Parameters

file_pathstr

Path to an existing PRIDE-PPPAR config file.

Returns

PRIDEPPPFileConfig

Populated config model.

Parameters:

file_path (str)

Return type:

PRIDEPPPFileConfig

satellite_products: SatelliteProducts
satellites: SatelliteList
station_used: list[StationUsed]
write_config_file(filepath)[source]

Write the PRIDE PPP configuration to a file.

Parent directories are created automatically. Note: modifies self.ambiguity.critical_search in-place, converting the first two elements to integers before serialising.

Parameters

filepathstr | Path

Destination path. Parent directories are created if needed.

Parameters:

filepath (str | Path)

Parameters:
class pride_ppp.specifications.config.SatelliteList(*, satellites=<factory>)[source]

Bases: BaseModel

List of active GNSS satellites and their PRN variances.

Parameters:

satellites (dict[str, int])

model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

satellites: dict[str, int]
class pride_ppp.specifications.config.SatelliteProducts(*, product_directory='Default', satellite_orbit='Default', satellite_clock='Default', erp='Default', quaternions='Default', code_phase_bias='Default', leo_quaternions='Default')[source]

Bases: BaseModel

Satellite product file paths for the pdp3 config file.

Each field holds the filename (not full path) of a specific GNSS product. product_directory is the common parent directory. When set to "Default", pdp3 resolves the file automatically.

Attributes

product_directorystr, optional

Directory containing all satellite product files.

satellite_orbitstr, optional

SP3 precise orbit filename (must end in .SP3).

satellite_clockstr, optional

CLK precise clock filename (must end in .CLK).

erpstr, optional

Earth rotation parameters filename (must end in .ERP).

quaternionsstr, optional

Satellite attitude quaternions filename (must end in .OBX).

code_phase_biasstr, optional

Observable-specific signal bias filename (must end in .BIA).

leo_quaternionsstr, optional

LEO satellite quaternions filename.

code_phase_bias: str | None
erp: str | None
leo_quaternions: str | None
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

classmethod override_patternmatch(value, field)[source]

Set default file extension when value is 'Default'.

Parameters:

value (str)

Return type:

str

product_directory: str | None
quaternions: str | None
satellite_clock: str | None
satellite_orbit: str | None
Parameters:
  • product_directory (str | None)

  • satellite_orbit (Annotated[str | None, _PydanticGeneralMetadata(pattern='.*\\.SP3')])

  • satellite_clock (Annotated[str | None, _PydanticGeneralMetadata(pattern='.*\\.CLK')])

  • erp (Annotated[str | None, _PydanticGeneralMetadata(pattern='.*\\.ERP')])

  • quaternions (Annotated[str | None, _PydanticGeneralMetadata(pattern='.*\\.OBX')])

  • code_phase_bias (Annotated[str | None, _PydanticGeneralMetadata(pattern='.*\\.BIA')])

  • leo_quaternions (str | None)

class pride_ppp.specifications.config.StationUsed(*, name='xxxx', tp='X', map='XXX', clkm=9000, podm='xxxxx', ev='xx', ztdm=0.2, htgm=0.005, ragm=0.3, phsc=0.01, polns='xxxxx', poxem=10.0, poynm=10.0, pozhm=10.0)[source]

Bases: BaseModel

Station configuration entry in the pdp3 config file.

Each field corresponds to a column in the +Station used block of the PRIDE-PPPAR config_file. Default values are placeholder tokens that pdp3 replaces at runtime.

Attributes

namestr

4-character station identifier.

tpstr

Positioning mode (S static, P piece-wise, K kinematic, F fixed).

mapstr

Mapping function code (NIE, GMF, VM1, VM3).

clkmint

Receiver clock model noise in mm.

podmstr

Position/orbit determination mode.

evstr

Elevation-dependent weighting strategy.

ztdmfloat

Zenith troposphere delay model noise in m.

htgmfloat

Horizontal troposphere gradient model noise in m.

ragmfloat

Receiver antenna geocenter model noise in m.

phscfloat

Phase screen model noise in cycles.

polnsstr

Pole / nutation series identifier.

poxemfloat

A priori coordinate sigma in X/East direction (m).

poynmfloat

A priori coordinate sigma in Y/North direction (m).

pozhmfloat

A priori coordinate sigma in Z/Height direction (m).

clkm: int
ev: str
htgm: float
map: str
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str
phsc: float
podm: str
polns: str
poxem: float
poynm: float
pozhm: float
ragm: float
tp: str
ztdm: float
Parameters:

PRIDE PPP-AR CLI configuration.

Builds the pdp3 command line from processing parameters.

class pride_ppp.specifications.cli.Constellations(*values)[source]

Bases: str, Enum

GNSS constellation identifiers for pdp3 --system flag.

BDS = 'C'
BDS_THREE = '3'
BDS_TWO = '2'
GALILEO = 'E'
GLONASS = 'R'
GPS = 'G'
QZSS = 'J'
classmethod print_options()[source]

Print available constellation codes to stdout.

class pride_ppp.specifications.cli.PrideCLIConfig(*, sample_frequency=1, system='GREC23J', frequency=['G12', 'R12', 'E15', 'C26', 'J12'], loose_edit=True, cutoff_elevation=7, interval=None, high_ion=None, tides='SOP', pride_configfile_path=None)[source]

Bases: BaseModel

Configuration for generating pdp3 CLI commands.

Attributes

sample_frequencyfloat

Processing sample rate passed to pdp3 via the -i flag, in samples per second (Hz). A value of 1 means 1 Hz (one epoch per second). Default: 1.

systemstr

Constellation string, e.g. "GREC23J".

frequencylist

Frequency combination per constellation.

loose_editbool

Enable loose editing (recommended for high-dynamic data).

cutoff_elevationint

Elevation cutoff angle in degrees (0-60).

intervalfloat, optional

Processing interval in seconds (0.02-30).

high_ionbool, optional

Correct 2nd-order ionospheric delay.

tidesstr

Tide corrections (any combination of S, O, P).

local_pdp3_pathstr, optional

Explicit path to the pdp3 binary.

overridebool

Re-process even if outputs already exist.

override_products_downloadbool

Re-download products even if already present.

pride_configfile_pathPath, optional

Path to a PRIDE config file to pass via --config.

cutoff_elevation: int
frequency: list
generate_pdp_command(site, local_file_path)[source]

Generate the pdp3 command-line argument list.

Builds the full argument vector by comparing each config field against its default value and only emitting flags that differ.

Parameters

sitestr

4-character station identifier (e.g. "NCC1").

local_file_pathstr

Path to the RINEX observation file.

Returns

List[str]

Argument list suitable for subprocess.run().

Example

>>> cfg = PrideCLIConfig(cutoff_elevation=10)
>>> cmd = cfg.generate_pdp_command("NCC1", "/data/NCC12540.25o")
>>> cmd[:5]
['pdp3', '-m', 'K', '-i', '1']
Parameters:
  • site (str)

  • local_file_path (str)

Return type:

list[str]

high_ion: bool | None
interval: float | None
loose_edit: bool
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

pride_configfile_path: Path | None
sample_frequency: float
system: str
tides: str
Parameters:
  • sample_frequency (float)

  • system (str)

  • frequency (list)

  • loose_edit (bool)

  • cutoff_elevation (int)

  • interval (float | None)

  • high_ion (bool | None)

  • tides (str)

  • pride_configfile_path (Path | None)

class pride_ppp.specifications.cli.Tides(*values)[source]

Bases: str, Enum

Tidal correction identifiers for pdp3 --tides flag.

OCEAN = 'O'
POLAR = 'P'
SOLID = 'S'
classmethod print_options()[source]

Print available tide correction codes to stdout.

PRIDE-PPP kinematic position model.

Provides the PridePPP Pydantic model for individual kinematic records parsed from pdp3 .kin output files.

pride_ppp.specifications.output.PRIDE_PPP_LOG_INDEX = {0: 'modified_julian_date', 1: 'second_of_day', 2: 'east', 3: 'north', 4: 'up', 5: 'latitude', 6: 'longitude', 7: 'height', 8: 'number_of_satellites', 9: 'pdop'}

Column-index → field-name mapping for PRIDE-PPPAR .kin output lines. The pdp3 binary writes fixed-width records; this dict maps positional token indices (after whitespace-split) to the corresponding field names used by PridePPP.

class pride_ppp.specifications.output.PridePPP(*, modified_julian_date, second_of_day, east, north, up, latitude, longitude, height, number_of_satellites=1, pdop=0, time=None)[source]

Bases: BaseModel

Single-epoch kinematic position record from a pdp3 .kin file.

Each instance represents one line of output. The east, north, and up fields store ECEF X/Y/Z coordinates in metres (despite the field names, which mirror the column order in the pdp3 output file). Geodetic lat/lon/height are also provided.

Attributes

modified_julian_datefloat

Modified Julian Date of the epoch (≥ 0).

second_of_dayfloat

Seconds elapsed since midnight UTC (0–86 400).

eastfloat

ECEF X-coordinate in metres (field name mirrors pdp3 column order).

northfloat

ECEF Y-coordinate in metres (field name mirrors pdp3 column order).

upfloat

ECEF Z-coordinate in metres (field name mirrors pdp3 column order).

latitudefloat

Geodetic latitude in decimal degrees (−90–90).

longitudefloat

Geodetic longitude in decimal degrees (0–360, east-positive).

heightfloat

WGS-84 ellipsoidal height in metres.

number_of_satellitesint

Number of satellites used in the solution.

pdopfloat

Position Dilution of Precision.

timedatetime, optional

UTC timestamp derived from modified_julian_date and second_of_day (populated automatically by a validator).

Docs: https://github.com/PrideLab/PRIDE-PPPAR

class Config[source]

Bases: object

coerce = True
east: float
classmethod from_kin_file(data)[source]

Parse a single line (as split tokens) from a .kin file.

Parameters

dataList[str]

A list of strings representing a line from the kin file.

Returns

Union[“PridePPP”, ValidationError]

A PridePPP object or a validation error.

Parameters:

data (list[str])

Return type:

PridePPP | ValidationError

height: float
latitude: float
longitude: float
model_config = {'coerce': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

modified_julian_date: float
north: float
number_of_satellites: int
pdop: float
classmethod populate_time(values)[source]

Derive UTC time from MJD and second-of-day.

Converts modified_julian_date + second_of_day to a full Julian Date, then to a Python datetime via the julian library.

second_of_day: float
time: datetime | None
up: float
classmethod validate_time(values)[source]

Coerce pdop to float before field-level validation.

Some .kin files encode PDOP as an integer string rather than a float literal. This pre-validator normalises the value so the ge/le constraints on the pdop field always pass.

Parameters:

Factories

RINEX utility functions.

Extract timestamps and time ranges from RINEX observation files, and merge RINEX 2 broadcast ephemerides into RINEX 3 BRDM format.

pride_ppp.factories.rinex.epoch_get_time(line)[source]

Extract the epoch timestamp from a RINEX 2 observation record.

Assumes a 2-digit year (added to 2000). The line is whitespace-split and the first six tokens are interpreted as YY MM DD HH MI SS.sss.

Parameters:

line (str) – A single RINEX observation epoch line.

Returns:

Parsed UTC datetime.

Return type:

datetime

pride_ppp.factories.rinex.merge_broadcast_files(brdn, brdg, output_folder)[source]

Merge GPS and GLONASS RINEX 2 broadcast files into a RINEX 3 BRDM file.

Both input files must have matching day-of-year (characters 4–6) and year (characters 9–10) in their filenames — e.g. brdn0200.25n and brdg0200.25g. A mismatch causes the function to return None with an error log.

Inspired by PrideLab/PRIDE-PPPAR/scripts/merge2brdm.py.

Parameters:
  • brdn (Path) – Path to the GPS broadcast ephemeris (.n) file.

  • brdg (Path) – Path to the GLONASS broadcast ephemeris (.g) file.

  • output_folder (Path) – Directory where the merged BRDM file will be written.

Returns:

Path to the merged BRDM file, or None on failure.

Return type:

Path | None

pride_ppp.factories.rinex.rinex_get_time_range(source)[source]

Extract the time range from a RINEX observation file.

Parameters

sourcestr | Path

Path to the RINEX observation file.

Returns

Tuple[datetime, datetime]

Start and end timestamps.

Raises

ValueError

If the time range cannot be extracted.

Parameters:

source (str | Path)

Return type:

tuple[datetime, datetime]

PrideProcessor — concurrent-safe RINEX → kinematic position pipeline.

Owns all internal state (ProductEnvironment, WorkSpace, DependencySpec). Each process() call runs pdp3 in a date-partitioned working directory (pride_dir/{year}/{doy}/) so concurrent calls never collide.

class pride_ppp.factories.processor.PrideProcessor(pride_dir, output_dir, *, pride_install_dir=None, cli_config=PrideCLIConfig(sample_frequency=1, system='GREC23J', frequency=['G12', 'R12', 'E15', 'C26', 'J12'], loose_edit=True, cutoff_elevation=7, interval=None, high_ion=None, tides='SOP', pride_configfile_path=None), mode=ProcessingMode.DEFAULT)[source]

Bases: object

RINEX observation file in → kinematic PPP-AR positions out.

Owns its own ProductRegistry, WorkSpace, and GNSSClient. No global state; a single instance is safe to reuse across many process() / process_batch() calls.

The full pipeline per RINEX file:

  1. Infer site ID and observation date from the RINEX filename/header.

  2. Resolve IGS products (orbit, clock, bias, ERP, ATX) for that date via GNSSClient.resolve_dependencies(). Skips resolution if a valid DependencyLockFile already exists.

  3. Return a cached ProcessingResult if a valid .kin output already exists in output_dir (unless override is True).

  4. Write a pdp3 config_file to pride_dir/{year}/{doy}/.

  5. Execute pdp3 and move .kin / .res outputs to output_dir.

For a full station-year, use process_batch(): it resolves products once per unique date, writes configs for all dates, skips cached results, then dispatches pdp3 subprocesses in parallel.

Example:

processor = PrideProcessor(
    pride_dir=Path("/data/pride"),
    output_dir=Path("/data/output"),
    mode=ProcessingMode.FINAL,
)
for result in processor.process_batch(rinex_files, max_workers=4):
    if result.success:
        print(result.date, len(result.positions()), "epochs")
Parameters:
  • pride_dir (Path)

  • output_dir (Path)

  • pride_install_dir (Path | None)

  • cli_config (PrideCLIConfig | None)

  • mode (ProcessingMode | Literal['FINAL', 'DEFAULT'])

__init__(pride_dir, output_dir, *, pride_install_dir=None, cli_config=PrideCLIConfig(sample_frequency=1, system='GREC23J', frequency=['G12', 'R12', 'E15', 'C26', 'J12'], loose_edit=True, cutoff_elevation=7, interval=None, high_ion=None, tides='SOP', pride_configfile_path=None), mode=ProcessingMode.DEFAULT)[source]

Initialise the processor and all its owned subsystems.

Construction is intentionally eager: the ProductEnvironment is built, all spec YAMLs are parsed, and the WorkSpace is registered so that every subsequent process() / process_batch() call can proceed without further setup.

Parameters:
  • pride_dir (Path) – Root directory for PRIDE products and working state. Config files and pdp3 working directories will be written under pride_dir/{year}/{doy}/.

  • output_dir (Path) – Final destination for .kin / .res output files produced by pdp3.

  • pride_install_dir (Path | None) – Optional path to a PRIDE-PPPAR installation that provides additional table files. When set, its spec is registered on the WorkSpace.

  • cli_config (PrideCLIConfig | None) – Override the default pdp3 CLI flags. When None a default PrideCLIConfig (kinematic, 1 s, loose edit) is used.

  • mode (ProcessingMode | Literal['FINAL', 'DEFAULT']) –

    Product timeliness mode. Selects which dependency-spec YAML governs product resolution:

    • ProcessingMode.DEFAULT — FIN → RAP → ULT cascade.

    • ProcessingMode.FINAL — only FINAL products.

    Also accepts the string literals "DEFAULT" or "FINAL" for convenience.

Return type:

None

process(rinex, *, site=None, date=None, override=False)[source]

Process one RINEX file end-to-end.

This is the primary single-file entry point. The full pipeline is:

  1. Infer metadata — site ID and observation date are extracted from the RINEX filename / header if not provided explicitly.

  2. Resolve productsGNSSClient.resolve_dependencies() walks the preference cascade (centre × timeliness) and downloads any missing products to pride_dir.

  3. Check cache — if a valid .kin output already exists in output_dir and override is False, the run is skipped and a cached ProcessingResult is returned immediately.

  4. Write config — a config_file is written to pride_dir/{year}/{doy}/.

  5. Run pdp3 — the binary is executed with cwd set to the same {year}/{doy}/ directory. Outputs are moved to output_dir.

Parameters:
  • rinex (Path) – Path to the RINEX observation file.

  • site (str | None) – 4-char site ID. Inferred from the filename if omitted.

  • date (date | None) – Override observation date. When None the date is extracted from the RINEX header via rinex_get_time_range.

  • override (bool) – When True, re-run pdp3 even if a valid .kin file already exists.

Returns:

A ProcessingResult summarising the run outcome, including paths to output files, the resolved products, and pdp3’s return code.

Raises:

FileNotFoundError – If rinex does not exist.

Return type:

ProcessingResult

process_batch(rinex_files, *, sites=None, max_workers=1, override=False)[source]

Process multiple RINEX files, sharing product resolution per date.

This is the preferred entry point when processing many files. The pipeline is structured to minimise redundant network calls:

  1. Group by date — RINEX files are sorted by observation date so that product resolution (the expensive step) happens exactly once per unique date.

  2. Resolve & write configs — for each unique date, resolve products and write a config_file to the year/doy working directory under pride_dir.

  3. Skip cached results — any RINEX whose .kin output already exists and validates is returned immediately without running pdp3 (unless override is True).

  4. Dispatch pdp3 — remaining jobs are dispatched to a ThreadPoolExecutor for parallel subprocess execution. Resolution and config generation are always single-threaded (main thread) to avoid race conditions.

Parameters:
  • rinex_files (Sequence[Path]) – Paths to RINEX observation files.

  • sites (Sequence[str] | None) – Per-file 4-char site IDs. When None, inferred from filenames via _infer_site.

  • max_workers (int) – Maximum number of concurrent pdp3 subprocesses. 1 means fully sequential execution.

  • override (bool) – Re-run pdp3 even when valid output already exists.

Yields:

A ProcessingResult for each file as it completes. Cached results are yielded first, then pdp3 results in completion order. Wrap in list() if you need all results at once.

Raises:

ValueError – If sites length does not match rinex_files.

Return type:

Iterator[ProcessingResult]

class pride_ppp.factories.processor.ProcessingMode(*values)[source]

Bases: Enum

IGS product timeliness mode for dependency resolution.

Selects which dependency-spec YAML governs which products are accepted.

  • DEFAULT — cascades through FIN → RAP → ULT. Uses the best available product at run time. Suitable for near-real-time processing or when the observation date is within the last two weeks.

  • FINAL — accepts only IGS final (FIN) products (available ≥13 days after observation). Suitable for post-processing campaigns where reproducibility and highest accuracy are required.

IGS product latency reference (approximate):

  • FIN (final) : orbit ≈ 13 days, clock ≈ 13 days

  • RAP (rapid) : orbit ≈ 17 hours, clock ≈ 17 hours

  • ULT (ultra-rapid) : orbit ≈ 3 hours, clock predicted half

DEFAULT = 'default'
FINAL = 'final'
class pride_ppp.factories.processor.ProcessingResult(rinex_path, site, date, kin_path, res_path, config_path, resolution, returncode=0, stderr='')[source]

Bases: object

Immutable result from a single RINEX → kinematic processing run.

Attributes

rinex_pathPath

Path to the input RINEX observation file.

sitestr

4-character station identifier (e.g. "NCC1").

datedatetime.date

Observation date for this processing run.

kin_pathPath or None

Path to the output .kin file, or None if pdp3 did not produce one.

res_pathPath or None

Path to the output .res residuals file, or None.

config_pathPath

Path to the config_file used for this run.

resolutionDependencyResolution

Product resolution result (fulfilled and missing dependencies).

returncodeint

pdp3 process exit code (0 = success).

stderrstr

Captured stderr from the pdp3 subprocess.

config_path: Path
date: date
kin_path: Path | None
positions()[source]

Parse the .kin file into a DataFrame of kinematic positions.

Returns

pd.DataFrame or None

Kinematic position DataFrame indexed by UTC epoch, or None if the run failed. Columns:

  • Latitude — geodetic latitude (degrees)

  • Longitude — geodetic longitude (degrees)

  • Height — ellipsoidal height (metres)

  • Nsat — number of satellites used in the epoch solution

  • PDOP — position dilution of precision

  • wrms — phase residual WRMS per epoch (mm), merged from the .res file

Coordinates are in the reference frame of the resolved orbit/clock products (IGS20/ITRF2020 for Repro3+ products; IGS14/ITRF2014 for earlier series). Epochs with Nsat 4 or PDOP 5 should be treated with caution.

Return type:

DataFrame | None

res_path: Path | None
residuals()[source]

Parse the .res file into a WRMS DataFrame.

Returns

pd.DataFrame or None

WRMS residuals indexed by timestamp, or None.

Return type:

DataFrame | None

resolution: DependencyResolution
returncode: int = 0
rinex_path: Path
site: str
stderr: str = ''
property success: bool

True if pdp3 produced a valid .kin output file.

Parameters:

PRIDE-PPP output parsing and validation.

Helpers for reading .kin / .res files into DataFrames and validating pdp3 output.

pride_ppp.factories.output.get_wrms_from_res(res_path)[source]

Compute per-epoch phase residual WRMS from a pdp3 .res file.

The WRMS is computed as \(\sqrt{\sum w_i r_i^2 / \sum w_i}\) where \(r_i\) are the double-differenced phase residuals (cycles) and \(w_i\) are the corresponding weights, then converted to millimetres.

Parameters

res_pathstr or Path

Path to the pdp3 residual output file (res_{YYYY}{DOY}_{site}.res).

Returns

pd.DataFrame

Two-column DataFrame:

  • date — UTC epoch timestamp

  • wrms — phase residual WRMS (mm) for that epoch

pride_ppp.factories.output.kin_to_kin_position_df(source)[source]

Parse a pdp3 .kin file into a DataFrame with optional WRMS residuals.

Reads the kinematic position records after the END OF HEADER marker and converts them to a DataFrame indexed by UTC timestamp. Attempts to merge WRMS residuals from a co-located .res file (same directory, stem derived from the .kin filename); the wrms column will be None if the .res file is missing or cannot be parsed.

Parameters

sourcestr | Path

Path to the pdp3 .kin output file.

Returns

pd.DataFrame | None

DataFrame with columns including time, latitude, longitude, height, pdop, and wrms, indexed by record number. Returns None if the file has no header or contains no valid data records.

Parameters:

source (str | Path)

Return type:

DataFrame | None

pride_ppp.factories.output.plot_kin_results_wrms(kin_df, title=None, save_as=None)[source]

Plot kinematic results with WRMS in a 6-panel figure.

Subplots (top → bottom): Latitude, Longitude, Height, Nsat (red = ≤ 4), PDOP on log scale (red = ≥ 5), WRMS (mm).

Expects DataFrame columns: Latitude, Longitude, Height, Nsat, PDOP, wrms.

Parameters

kin_dfpd.DataFrame

Output from read_kin_data merged with WRMS residuals.

titlestr, optional

RINEX filename or label used in the figure title.

save_asstr, optional

If provided, save the figure to this path.

pride_ppp.factories.output.read_kin_data(kin_path)[source]

Read a .kin file into a DataFrame using fixed-width column specs.

The column widths match the pdp3 output format (PRIDE-PPPAR 3). The resulting DataFrame is indexed by UTC timestamps derived from MJD + seconds-of-day.

Parameters

kin_pathstr

Path to the .kin file.

Returns

pd.DataFrame

Fixed-width columns: Mjd, Sod, *, X, Y, Z, Latitude, Longitude, Height, Nsat, G (GPS sats), R (GLONASS), E (Galileo), C2 (BDS-2), C3 (BDS-3), J (QZSS), PDOP. Indexed by UTC datetime derived from MJD + seconds-of-day.

pride_ppp.factories.output.validate_kin_file(source)[source]

Validate a kin file.

This is done by checking if it can be parsed into a DataFrame and contains data.

Parameters

sourcestr | Path

The path to the kin file.

Returns

bool

True if the kin file is valid, False otherwise.

Parameters:

source (str | Path)

Return type:

bool