es_sfgtools.pride_tools package
- class es_sfgtools.pride_tools.PrideCLIConfig(*, sample_frequency: float = 1, system: str = 'GREC23J', frequency: list = ['G12', 'R12', 'E15', 'C26', 'J12'], loose_edit: bool = True, cutoff_elevation: int = 7, interval: float | None = None, high_ion: bool | None = None, tides: str = 'SOP', local_pdp3_path: str | None = None, override: bool = False, override_products_download: bool = False, pride_configfile_path: Path | None = None)
Bases:
BaseModelPrideCLIConfig is a configuration class for setting up and generating commands to run the pdp3 GNSS processing tool. .. attribute:: system
The GNSS system(s) to use. Default is “GREC23J” which is “GPS/GLONASS/Galileo/BDS/BDS-2/BDS-3/QZSS”.
- type:
str
- frequency
The GNSS frequencies to use. Default is [“G12”, “R12”, “E15”, “C26”, “J12”]. Refer to Table 5-4 in PRIDE-PPP-AR v.3.0 manual for more options.
- Type:
list
- loose_edit
Disable strict editing mode, which should be used when high dynamic data quality is poor. Default is True.
- Type:
bool
- cutoff_elevation
The elevation cutoff angle in degrees (0-60 degrees). Default is 7.
- Type:
int
- interval
Processing interval, values range from 0.02s to 30s. If this item is not specified and the configuration file is specified, the processing interval in the configuration file will be read, otherwise, the sampling rate of the observation file is used by default.
- Type:
float
- high_ion
Use 2nd ionospheric delay model with CODE’s GIM product. When this option is not entered, no higher-order ionospheric correction is performed. Default is False.
- Type:
bool
- tides
Enter one or more of “S” “O” “P”, e.g SO for solid, ocean, and polar tides. Default is “SOP”, which uses all tides.
- Type:
str
- local_pdp3_path
The path to the local pdp3 binary. Default is None.
- Type:
str
- generate_pdp_command(site
str, local_file_path: str) -> List[str]: Generate the command to run pdp3 with the given parameters.
site (str): The site identifier for the GNSS data. local_file_path (str): The local file path to the GNSS data.
- Returns:
The command to run pdp3 with the specified configuration.
- Return type:
List[str]
- cutoff_elevation: int
- frequency: list
- generate_pdp_command(site: str, local_file_path: str) List[str]
Generate the command to run pdp3 with the given parameters
- high_ion: bool | None
- interval: float | None
- local_pdp3_path: str | None
- loose_edit: bool
- model_computed_fields = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields = {'cutoff_elevation': FieldInfo(annotation=int, required=False, default=7), 'frequency': FieldInfo(annotation=list, required=False, default=['G12', 'R12', 'E15', 'C26', 'J12']), 'high_ion': FieldInfo(annotation=Union[bool, NoneType], required=False, default=None), 'interval': FieldInfo(annotation=Union[float, NoneType], required=False, default=None), 'local_pdp3_path': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, title='Local Path to pdp3 Binary', description='Path to the local pdp3 binary. If not provided, the system PATH will be used.'), 'loose_edit': FieldInfo(annotation=bool, required=False, default=True), 'override': FieldInfo(annotation=bool, required=False, default=False), 'override_products_download': FieldInfo(annotation=bool, required=False, default=False, title='Flag to Override Existing Products Download'), 'pride_configfile_path': FieldInfo(annotation=Union[Path, NoneType], required=False, default=None, title='Path to Pride Config File', description='Path to the Pride config file. If not provided, the default config will be used.'), 'sample_frequency': FieldInfo(annotation=float, required=False, default=1), 'system': FieldInfo(annotation=str, required=False, default='GREC23J'), 'tides': FieldInfo(annotation=str, required=False, default='SOP')}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- override: bool
- override_products_download: bool
- pride_configfile_path: Path | None
- sample_frequency: float
- system: str
- tides: str
- es_sfgtools.pride_tools.get_gnss_products(rinex_path: Path, pride_dir: Path, override: bool = False, source: Literal['all', 'wuhan', 'cligs'] = 'all', date: date | datetime | None = None, override_config: bool = True) Path | None
Generates or retrieves GNSS products for a given RINEX file or date and returns a pride config file path that catalogs the products.
- Parameters:
rinex_path (Path) – The path to the RINEX file.
pride_dir (Path) – The directory where the PRIDE products are stored.
override (bool) – If True, the function will attempt to download the products even if they already exist.
source (Literal["all", "wuhan", "cligs"]) – The source from which to download the products. Defaults to “all”.
date (Optional[datetime.date | datetime.datetime]) – The date for which to retrieve the products. If provided, it will be used to determine the year and day of year (DOY) for the products. If rinex_path is provided, this will be ignored.
override_config (bool) – If True, the function will attempt to re-download the products even if a config file already exists.
- Returns:
The path to the config file that catalogs the products, or None if the products could not be retrieved or generated.
- Return type:
Path | None
Attempts to build a navigation file for a given RINEX file by downloading the necessary files from the IGS FTP server.
- Parameters:
rinex_path (Path) – The path to the RINEX file.
override (bool) – If True, the function will attempt to download the navigation file even if it already exists.
mode (Literal['process','test']) – The mode in which the function is running. Test mode attempt downloads from all resources
- Returns:
The path to the navigation file.
- Return type:
brdm_path (Path)
- Raises:
Warning – If the navigation file cannot be built or located.
Examples
>>> rinex_path = Path("data/NCB11750.23o") >>> nav_path = get_nav_file(rinex_path) Attempting to build nav file for data/NCB11750.23o >>> nav_path Path("data/BRDC00IGS_R_20231750000_01D_MN.rnx.gz")
- es_sfgtools.pride_tools.kin_to_kin_position_df(source: str | Path) DataFrame | None
Create a KinPositionDataFrame from a kin file from PRIDE-PPP.
This includes WRMS residuals.
- Parameters:
source (str | Path) – The path to the kin file.
- Returns:
DataFrame with kinematic data and residuals, or None if the file cannot be parsed.
- Return type:
pd.DataFrame | None
- es_sfgtools.pride_tools.rinex_to_kin(source: str, writedir: Path, pridedir: Path, site='SIT1', pride_cli_config: PrideCLIConfig = None) Tuple[Path, Path]
Generate kinematic and residual files from a RINEX file.
This function is a wrapper for the PRIDE-PPP processing tool (pdp3).
- Parameters:
source (str) – The source RINEX file to convert.
writedir (Path) – The directory to write the converted kin file.
pridedir (Path) – The directory where PRIDE-PPP observables are stored.
site (str, optional) – The site name, by default “SIT1”.
pride_cli_config (PrideCLIConfig, optional) – The configuration for PRIDE-PPP processing. If None, uses default settings.
- Returns:
The generated kin and result files as Path objects.
- Return type:
Tuple[Path, Path]
- Raises:
FileNotFoundError – If the PRIDE-PPP binary is not found in the system path.
FileNotFoundError – If the source RINEX file does not exist.
Examples
>>> source = Path("/path/to/NCB12450.24o") # Example RINEX file path >>> writedir = Path("/writedir") # Directory to write the kin file >>> pridedir = Path("/pridedir") # Directory where PRIDE-PPP observables are stored # Get the PRIDE configuration file path >>> pride_configfile_path = get_gnss_products( ... rinex_path=source, ... pride_dir=pridedir, ... override=False, ... source="all" ... ) # Create a PrideCLIConfig instance with the configuration file path >>> pride_config = PrideCLIConfig( ... sample_frequency=1, ... override=False, ... pride_configfile_path=pride_configfile_path, ... ) # Run PRIDE-PPP to generate kin and res files >>> kin_file, res_file = rinex_to_kin( ... source=source, ... writedir=writedir, ... pridedir=pridedir, ... site="NCB1", ... pride_config=pride_config, ... ) >>> kin_file Path("writedir/kin_2024126_ncb1.kin") >>> res_file Path("writedir/res_2024126_ncb1.res")
Submodules
- es_sfgtools.pride_tools.gnss_product_operations module
- es_sfgtools.pride_tools.gnss_product_schemas module
CLSIGSGSSCPotsdamRemoteQueryRemoteResourceFTPWuhanIGSWuhanIGS.ftpserverWuhanIGS.daily_gps_dirWuhanIGS.daily_product_dirWuhanIGS.constellation_tagWuhanIGS.constellation_tagWuhanIGS.daily_gps_dirWuhanIGS.daily_product_dirWuhanIGS.ftpserverWuhanIGS.get_product_bias()WuhanIGS.get_product_clk()WuhanIGS.get_product_erp()WuhanIGS.get_product_obx()WuhanIGS.get_product_sp3()WuhanIGS.get_product_sum()WuhanIGS.get_rinex_2_nav()WuhanIGS.get_rinex_3_nav()
- es_sfgtools.pride_tools.kin_file_operations module
PridePPPPridePPP.ConfigPridePPP.eastPridePPP.from_kin_file()PridePPP.heightPridePPP.latitudePridePPP.longitudePridePPP.model_computed_fieldsPridePPP.model_configPridePPP.model_fieldsPridePPP.modified_julian_datePridePPP.northPridePPP.number_of_satellitesPridePPP.pdopPridePPP.populate_time()PridePPP.second_of_dayPridePPP.timePridePPP.upPridePPP.validate_time()
get_wrms_from_res()kin_to_kin_position_df()plot_kin_results_wrms()read_kin_data()validate_kin_file()
- es_sfgtools.pride_tools.pride_cli_config module
ConstellationsPrideCLIConfigPrideCLIConfig.frequencyPrideCLIConfig.loose_editPrideCLIConfig.cutoff_elevationPrideCLIConfig.intervalPrideCLIConfig.high_ionPrideCLIConfig.tidesPrideCLIConfig.local_pdp3_pathPrideCLIConfig.cutoff_elevationPrideCLIConfig.frequencyPrideCLIConfig.generate_pdp_command()PrideCLIConfig.high_ionPrideCLIConfig.intervalPrideCLIConfig.local_pdp3_pathPrideCLIConfig.loose_editPrideCLIConfig.model_computed_fieldsPrideCLIConfig.model_configPrideCLIConfig.model_fieldsPrideCLIConfig.overridePrideCLIConfig.override_products_downloadPrideCLIConfig.pride_configfile_pathPrideCLIConfig.sample_frequencyPrideCLIConfig.systemPrideCLIConfig.tides
Tides
- es_sfgtools.pride_tools.pride_file_config module
AmbiguityFixingOptionsAmbiguityFixingOptions.ai_ambiguity_validationAmbiguityFixingOptions.ambiguity_co_varAmbiguityFixingOptions.ambiguity_durationAmbiguityFixingOptions.critical_searchAmbiguityFixingOptions.cutoff_elevationAmbiguityFixingOptions.model_computed_fieldsAmbiguityFixingOptions.model_configAmbiguityFixingOptions.model_fieldsAmbiguityFixingOptions.narrowlane_decisionAmbiguityFixingOptions.pco_on_wide_laneAmbiguityFixingOptions.truncate_at_midnightAmbiguityFixingOptions.verbose_outputAmbiguityFixingOptions.widelane_decision
DataProcessingStrategiesDataProcessingStrategies.htg_modelDataProcessingStrategies.iono_2ndDataProcessingStrategies.isb_modelDataProcessingStrategies.model_computed_fieldsDataProcessingStrategies.model_configDataProcessingStrategies.model_fieldsDataProcessingStrategies.multipathDataProcessingStrategies.rck_modelDataProcessingStrategies.strict_editingDataProcessingStrategies.tidesDataProcessingStrategies.ztd_model
ObservationConfigPRIDEPPPFileConfigPRIDEPPPFileConfig.ambiguityPRIDEPPPFileConfig.load_default()PRIDEPPPFileConfig.model_computed_fieldsPRIDEPPPFileConfig.model_configPRIDEPPPFileConfig.model_fieldsPRIDEPPPFileConfig.observationPRIDEPPPFileConfig.processingPRIDEPPPFileConfig.read_config_file()PRIDEPPPFileConfig.satellite_productsPRIDEPPPFileConfig.satellitesPRIDEPPPFileConfig.station_usedPRIDEPPPFileConfig.write_config_file()
SatelliteListSatelliteProductsSatelliteProducts.code_phase_biasSatelliteProducts.erpSatelliteProducts.leo_quaternionsSatelliteProducts.model_computed_fieldsSatelliteProducts.model_configSatelliteProducts.model_fieldsSatelliteProducts.override_patternmatch()SatelliteProducts.product_directorySatelliteProducts.quaternionsSatelliteProducts.satellite_clockSatelliteProducts.satellite_orbit
StationUsedStationUsed.clkmStationUsed.evStationUsed.htgmStationUsed.mapStationUsed.model_computed_fieldsStationUsed.model_configStationUsed.model_fieldsStationUsed.nameStationUsed.phscStationUsed.podmStationUsed.polnsStationUsed.poxemStationUsed.poynmStationUsed.pozhmStationUsed.ragmStationUsed.tpStationUsed.ztdm
- es_sfgtools.pride_tools.pride_operations module
- es_sfgtools.pride_tools.rinex_utils module