geodezyx.operational.gins_runner package

Created on 26/02/2025 11:01:41

@author: psakic

Subpackages

Submodules

geodezyx.operational.gins_runner.gins_bd_update module

Created on 27/02/2025 10:37:26

@author: psakic

geodezyx.operational.gins_runner.gins_bd_update.bdgins_update(date_srt=datetime.datetime(2020, 5, 3, 0, 0), date_end=None, dir_bdgins='', login='', password='', compress=False)

Update the BDGINS repository with the necessary files for the given date range.

Parameters:
  • date_srt (datetime) – The start date for the update. The default is 2020-05-03 (origin of G20 products, end of GPS’s Selectable Avaiability).

  • date_end (datetime) – The end date for the update. If not provided, the default is the 15 days ago.

  • dir_bdgins (str, optional) – The directory for BDGINS. Defaults to an empty string.

  • login (str, optional) – The login for the remote server. Defaults to an empty string.

  • password (str, optional) – The password for the remote server. Defaults to an empty string.

  • compress (bool, optional) – Whether to gzip-compress the clock files. experimental, and not recommended Defaults to False.

Return type:

None

geodezyx.operational.gins_runner.gins_bd_update.create_dir(parent_dir, subdirs)
geodezyx.operational.gins_runner.gins_bd_update.download_rsync(file_list, remote_user, remote_host, remote_path, local_destination, rsync_options=None, password=None)

Downloads a list of files using rsync.

geodezyx.operational.gins_runner.gins_bd_update.main()
geodezyx.operational.gins_runner.gins_bd_update.read_credentials(file_path)

geodezyx.operational.gins_runner.gins_common module

@author: psakic

This sub-module of geodezyx.operational contains functions to run the GNSS processing software GINS.

it can be imported directly with: from geodezyx import operational

The GeodeZYX Toolbox is a software for simple but useful functions for Geodesy and Geophysics under the GNU LGPL v3 License

Copyright (C) 2019 Pierre Sakic et al. (IPGP, sakic@ipgp.fr) GitHub repository : https://github.com/GeodeZYX/geodezyx-toolbox

geodezyx.operational.gins_runner.gins_common.bring_to_gin(file_path_inp, temp_data_folder=None, gins_path=None, verbose=True)

Ensure a file is within the GIN path, copying it to the temporary data folder if necessary.

Combo of check_if_in_gin and copy_in_gin functions.

Parameters:
  • file_path_inp (str) – The path of the file to be checked and possibly copied.

  • temp_data_folder (str, optional) – The path to the temporary data folder. If not provided, it defaults to ‘TEMP_DATA’ inside the GIN path.

  • gins_path (str, optional) – The GIN path to check against. If not provided, it defaults to the ‘gin’ directory inside the GIN path.

  • verbose (bool) – verbose messages. Default is True.

Returns:

The path of the file within the GIN path.

Return type:

str

geodezyx.operational.gins_runner.gins_common.check_if_in_gin(file_path_inp, gins_path=None, verbose=True)

Check if a file is within the GIN path.

Parameters:
  • file_path_inp (str) – The path of the file to check.

  • gins_path (str, optional) – The GIN path to check against. If not provided, it defaults to the ‘gin’ directory inside the GIN path.

  • verbose (bool) – verbose messages. Default is True.

Returns:

True if the file is within the GIN path, False otherwise.

Return type:

bool

geodezyx.operational.gins_runner.gins_common.check_site_stfl(stat, stationfile)

Check if a station code is present in a station file.

Parameters:
  • stat (str) – The station code to search for.

  • stationfile (str) – The path to the station file.

Returns:

True if the station code is found in the station file, False otherwise.

Return type:

bool

geodezyx.operational.gins_runner.gins_common.check_solution(dir_name_inp, gin_path_inp=None, verbose=True)

Check if a solution already exists for the given directory name.

geodezyx.operational.gins_runner.gins_common.chek_domes_oclo(domes, oclofile)

Check if a DOMES number is present in an OCLO file.

Parameters:
  • domes (str) – The DOMES number to search for.

  • oclofile (str) – The path to the OCLO file.

Returns:

True if the DOMES number is found in the OCLO file, False otherwise.

Return type:

bool

geodezyx.operational.gins_runner.gins_common.copy_in_gin(file_path_inp, temp_data_folder=None, verbose=True)

Copy a file to the GIN temporary data folder.

Parameters:
  • file_path_inp (str) – The path of the file to be copied.

  • temp_data_folder (str, optional) – The path to the temporary data folder. If not provided, it defaults to ‘TEMP_DATA’ inside the GIN path.

  • verbose (bool) – verbose messages. Default is True.

Returns:

The path of the copied file in the temporary data folder.

Return type:

str

geodezyx.operational.gins_runner.gins_common.find_domes_in_stfl(stat_code, stationfile)

Find the DOMES number for a station code in a station file.

geodezyx.operational.gins_runner.gins_common.get_gin_path(extended=False)

Get the GIN path from the environment variable GS_USER.

Parameters:

extended (bool, optional) – If True, returns the path to the ‘gin’ directory inside the GIN path. Defaults to False.

Returns:

The GIN path or None if the environment variable GS_USER does not exist.

Return type:

str or None

geodezyx.operational.gins_runner.gins_common.get_spotgins_path()
geodezyx.operational.gins_runner.gins_common.get_temp_data_gins_path()

Get the path to the temporary data folder within the GIN directory.

geodezyx.operational.gins_runner.gins_common.make_path_ginsstyle(pathin)

Convert an absolute path containing ‘/gin/’ to a GINS director-compatible path.

Parameters:

pathin (str) – The input path, which must be an absolute path containing ‘/gin/’.

Returns:

The converted path with ‘.temp.gin’ as the root directory,

or None if the input path does not contain ‘/gin/’.

Return type:

str or None

geodezyx.operational.gins_runner.gins_common.rm_old_tmp_shel(directory='/tmp', age_sec=600)

Removes files in the specified directory older than the given age in minutes.

Parameters: directory (str): The directory to search in. age_sec (int): Age of files in minutes to delete. Default is 10 minutes.

geodezyx.operational.gins_runner.gins_dirs_gen module

Created on 26/02/2025 11:06:06

@author: psakic

geodezyx.operational.gins_runner.gins_dirs_gen.gen_dirs_rnxs(rnx_paths_inp, director_generik_path, director_name_prefix, out_director_folder=None, temp_data_folder=None, stations_file=None, oceanload_file=None, options_prairie_file=None, auto_stations_file=False, auto_oceanload=False, perso_orbclk=False, ac='igs', repro=2, auto_interval=True, out_coords='NULL', prairie=False, prairie_kwargs={'with_historik': 1, 'with_wsb': 1}, force=False, verbose=True, sites_id9=None, add_tropo_sol=True)

Generate directors from RINEX files.

This function can manage both a single RINEX file or a list of RINEX files. It produces a director from a RINEX file and writes it to a specified location.

If the RINEX is not in a gins style folder, it will be copied in the temp_data_folder

Parameters:
  • rnx_paths_inp (str or list) – Path to a RINEX file or a list of RINEX file paths.

  • director_generik_path (str) – Path to the generic director file.

  • director_name_prefix (str) – Prefix for the director name.

  • out_director_folder (str, optional) – Output folder for the director. Defaults to None. is not specified, output director will be created in the ../gin/data/directeur folder

  • temp_data_folder (str, optional) – Temporary data folder. Defaults to None. is not specified RINEXs will be copied in an ad hoc folder ../gin/TMP_GYNS

  • stations_file (str, optional) – Path to the stations file. Defaults to None.

  • oceanload_file (str, optional) – Path to the ocean load file. Defaults to None.

  • options_prairie_file (str, optional) – Path to the prairie options file. Defaults to None.

  • auto_stations_file (bool, optional)

  • auto_oceanload (bool, optional) – Automatically create station and ocean loading files. create automatically a station file and a ocean loading file with the rinex header auto mode is prioritary upon the manu mode so, if a path for stat file or ocload file is specified and auto_staocl is on, it will be the automatic stat/ocload which will be used Defaults to False.

  • perso_orbclk (bool, optional) – Download and use specific orbits/clocks. Defaults to False.

  • ac (str, optional) – Analysis center for perso orbits/clocks. Defaults to “igs”.

  • repro (int, optional) – Reprocessing version for perso orbits/clocks. Defaults to 2.

  • auto_interval (bool, optional) –

    Automatically find the interval in RINEX and apply it to the director.

    Defaults to False.

  • out_coords (str, optional) – Output coordinates type (‘XYZ’ or ‘FLH’/’PLH’). Defaults to “NULL”.

  • prairie (bool, optional) – Run prairie externally. Defaults to False. if True, prairie_kwargs control the arguments of the function prairie_manual (cf above)

  • prairie_kwargs (dict, optional) – Arguments for the prairie_manual function. Defaults to {“with_historik”: 1, “with_wsb”: 1}.

  • force (bool, optional) – Force the generation of the director even if a solution already exists. Defaults to False.

  • verbose (bool) – verbose messages. Default is True.

  • sites_id9 (iterable, optional) – A list, Pandas series… containing the site_id9 information. This is used to extract the site_id9 if the RINEX name is ambiguous.

  • add_tropo_sol (bool, optional) – Add tropospheric solution keys to the director and then results in the listing and solution. Defaults to True.

Returns:

Path of the produced director as a string, or a list of paths if multiple RINEX files are processed.

Return type:

str or list

geodezyx.operational.gins_runner.gins_dirs_run module

Created on 26/02/2025 11:07:24

@author: psakic

geodezyx.operational.gins_runner.gins_dirs_run.check_for_retry(stderr_inp)
geodezyx.operational.gins_runner.gins_dirs_run.run_directors(dir_paths_inp, opts_gins_pc='', opts_gins_90='', version='OPERA', cmd_mode='exe_gins_dir', force=False, verbose=True, sleep_time_max=10)

Executes GINS commands for a single or multiple directories, handling different modes and retry logic.

Parameters:
  • dir_paths_inp (str or list) – Path(s) to the directory/directories to process. Can be a single directory (str) or a list of directories (list).

  • opts_gins_pc (str, optional) – Options for the GINS PC command. Default is an empty string.

  • opts_gins_90 (str, optional) – Options for the GINS 90 command. Default is an empty string.

  • version (str, optional) – Version of the GINS software to use. Default is “OPERA”.

  • cmd_mode (str, optional) – Mode of execution. Can be “ginspc”, “exe_gins_dir”, or “exe_gins_fic”. Default is “exe_gins_dir”.

  • force (bool, optional) – If True, forces execution even if solutions already exist. Default is False.

  • verbose (bool, optional) – If True, enables verbose logging. Default is True.

  • sleep_time_max (int, optional) – Maximum sleep time (in seconds) to avoid conflicts during parallel execution. Default is 10.

Returns:

The function does not return any value.

Return type:

None

Notes

  • Handles both single and multi-directory modes.

  • Automatically detects .fic files and adjusts the command mode accordingly.

  • Implements retry logic for failed executions.

  • Logs execution details, including start and end times, and handles parallel execution conflicts.

geodezyx.operational.gins_runner.gins_orbclk_concat module

Created on 10/08/2025 11:38:34

@author: psakic

geodezyx.operational.gins_runner.gins_orbclk_concat.concat_orb_clk(date_srt, date_end, nprocs=1, prod='G20', verbose=True)

Concatenate orbit and clock files for a given date range using multiprocessing.

Parameters:
  • date_srt (datetime) – Start date for the concatenation process.

  • date_end (datetime) – End date for the concatenation process.

  • nprocs (int) – Number of processes to use for multiprocessing.

  • prod (str, optional) – Product type (e.g., “G20”). Default is “G20”.

  • verbose (bool, optional) – If True, enable verbose logging. Default is True.

Return type:

None

geodezyx.operational.gins_runner.gins_orbclk_concat.main()

Command-line interface for concatenating orbit and clock files.

geodezyx.operational.gins_runner.gins_prairie module

Created on 26/02/2025 11:09:30

@author: psakic

geodezyx.operational.gins_runner.gins_prairie.prairie_manual(rinex_paths_in, temp_data_folder='', force=True, with_historik=True, with_wsb=True, argsdict={})

Process RINEX files using the GINS prairie manual method.

This function processes one or more RINEX files through the GINS prairie executable, handling file management, decompression, and command execution automatically. It supports various prairie processing options and ensures proper file placement within the GINS environment.

Parameters:
  • rinex_paths_in (str or list of str) – Path(s) to the RINEX file(s) to process. Can be a single string path or a list of string paths for batch processing.

  • temp_data_folder (str, optional) – Path to the temporary data folder where files will be processed. If empty string (default), uses the default GINS TEMP_DATA folder.

  • force (bool, optional) – If True, forces processing even if the output file already exists. Default is True.

  • with_historik (bool, optional) – If True, includes GLONASS historik processing using the default historik file. Default is True.

  • with_wsb (bool, optional) – If True, includes WSB (satellite clock bias) processing using the default WSB reference file. Default is True.

  • argsdict (dict, optional) – Additional arguments for the prairie command. Keys should be argument names (e.g., ‘-options’), and values should be their corresponding file paths or values. Arguments cc2noncc, wsb, options, and out are automatically managed if not provided.

Returns:

Path(s) to the output prairie file(s). Returns a single string if one file is processed, or a list of strings if multiple files are processed.

Return type:

str or list of str

Notes

  • Automatically copies RINEX files to the temporary data folder if needed

  • Decompresses compressed RINEX files (.crx, .gz) automatically

  • Manages default prairie command arguments for standard processing

  • Executes the prairie command using subprocess in the temp data folder

  • Validates output file creation and size before returning paths

Examples

>>> # Process a single RINEX file
>>> output = prairie_manual('/path/to/rinex.obs')
>>> # Process multiple files with custom options
>>> files = ['/path/to/file1.obs', '/path/to/file2.obs']
>>> args = {'-options': '/custom/options.dat'}
>>> outputs = prairie_manual(files, argsdict=args)
argsdict :

a dictionnary so as argsdict[argument] = val e.g. argsdict[‘-options’] = “/home/psakicki/THESE/SOFTWARES/GINSv2B/gin/data/prairie/options_GPS.dat” argsdict[‘-wsb’] = “/home/psakicki/THESE/SOFTWARES/GINSv2B/gin/data/prairie/WSB_NEW_1996.dat”

argument cc2noncc, wsb, options, and out are automatically managed

geodezyx.operational.gins_runner.singugins_run module

Created on 21/03/2025 21:57:04

@author: psakic

geodezyx.operational.gins_runner.singugins_run.main()
geodezyx.operational.gins_runner.singugins_run.singugins_run(results_folder, specific_sites=[], start_epoch=datetime.datetime(2000, 5, 3, 0, 0), end_epoch=datetime.datetime(2099, 12, 31, 0, 0), bdrnx_folder='/root/020_BDRNX/', nprocs=8, no_updatebd=False, no_concat_orb_clk=False, verbose=False, force=False, spotgins_run_kwargs={}, no_rnx2=False, no_rnx3=False)

Run the SPOTGINS process within a SINGUGINS container.

Parameters:
  • results_folder (str) – Path to the folder where the results will be stored. We strongly recommend using a subfolder within the default SINGUGINS results folder /root/030_RESULTS/<your_subfolder>.

  • specific_sites (list, optional) – List of specific RINEXs site IDs to include in the process. Default is an empty list.

  • start_epoch (datetime, optional) – Start date and time for the selected RINEXs. Default is May 3, 2000.

  • end_epoch (datetime, optional) – End date and time for the selected RINEXs. Default is December 31, 2099.

  • bdrnx_folder (str, optional) – Path to the folder containing the RINEX files. Default is “/root/020_BDRNX/”.

  • nprocs (int, optional) – Number of processes to use. Default is 8.

  • no_updatebd (bool, optional) – Flag to indicate whether to update the database. Default is False.

  • no_concat_orb_clk (bool, optional) – Flag to indicate whether to concatenate the orbit and clock files prior to the main processing Default is False.

  • verbose (bool, optional) – Verbose mode. If True, additional information will be printed.

  • force (bool, optional) – Flag to force the process to run even if the results already exist.

  • spotgins_run_kwargs (dict, optional) – Additional keyword arguments to pass to the spotgins_run function. Default is an empty dictionary.

  • no_rnx2 (bool, optional) – If True, RINEX2 files will not be processed. Default is False (RINEX2 files will be processed).

  • no_rnx3 (bool, optional) – If True, RINEX3 files will not be processed. Default is False (RINEX3 files will be processed).

Return type:

None

geodezyx.operational.gins_runner.spotgins_run module

Created on 28/02/2025 18:52:44

@author: psakic

geodezyx.operational.gins_runner.spotgins_run.archiv_gins_run(dir_inp, archive_folder, verbose=True)

Archive the GINS run results to the specified archive folder.

Parameters:
  • dir_inp (str) – Path to the directory containing the GINS run results.

  • archive_folder (str) – Path to the archive folder.

  • verbose (bool, optional) – If True, enable verbose logging. Default is True.

Return type:

None

geodezyx.operational.gins_runner.spotgins_run.check_arch_sol(rnx_path_inp, archive_folder_inp, verbose=True)

Check if the solution for the given RINEX file is already archived.

Parameters:
  • rnx_path_inp (str) – Path to the input RINEX file.

  • archive_folder_inp (str) – Path to the archive folder.

  • verbose (bool, optional) – If True, enable verbose logging. Default is True.

Returns:

True if the solution is found in the archive, False otherwise.

Return type:

bool

geodezyx.operational.gins_runner.spotgins_run.const_adapt(const_inp, dir_inp, verbose=True)

manage ERREUR : Galileo integer ambiguity fixing not possible before 7th October 2018. solution GPS-only before this date

geodezyx.operational.gins_runner.spotgins_run.get_spotgins_files(director_generik_path_inp, stations_file_inp, oceanload_file_inp, options_prairie_file_inp, stations_master_file_inp)

Retrieve the paths of the files needed for the SPOTGINS process.

Parameters:
  • director_generik_path_inp (str) – Path to the generic director file.

  • stations_file_inp (str) – Path to the stations file.

  • oceanload_file_inp (str) – Path to the ocean load file.

  • options_prairie_file_inp (str) – Path to the options prairie file.

  • stations_master_file_inp (str) – Path to the stations master file.

Returns:

A tuple containing the paths to the director file, stations file, ocean load file, options prairie file, and site IDs.

Return type:

tuple

geodezyx.operational.gins_runner.spotgins_run.rm_prov_listing(dir_inp)

Remove potential PROV folders and related files in the listing folder.

If a processing is interrupted this temp PROV folder remains, occupy a lot of space and can eventually crashs the whole machine/container.

Thus it must be removed ASAP

Parameters:
  • dir_inp (str) – Path to the input directeur whose associated PROV folders and files need to be removed.

  • Functionality

  • -------------

  • directeur. (1. Identifies and removes all PROV folders associated with the given)

  • (e.g. (2. Identifies and removes specific files) – related to the directory in the batch listing folder.

  • files) (.qsub and .sh) – related to the directory in the batch listing folder.

Return type:

None

geodezyx.operational.gins_runner.spotgins_run.spotgins_run(rnxs_path_inp, results_folder_inp, nprocs=8, version='VALIDE_25_1', const='GE', director_generik_path_inp=None, director_name_prefix_inp='', stations_file_inp=None, oceanload_file_inp=None, options_prairie_file_inp=None, stations_master_file_inp=None, force=False, no_archive=False, no_clean_tmp=False, no_updatebd=False, no_concat_orb_clk=False, verbose=False, updatebd_login='')

Run the SPOTGINS process on the provided RINEX paths using multiprocessing.

Parameters:
  • rnxs_path_inp (list) – List of input RINEX file paths.

  • results_folder_inp (str) – Path to the archive folder.

  • nprocs (int, optional) – Number of processes to use for multiprocessing. Default is 8.

  • version (str, optional) –

    Version of the GINS software to use.

    Default is the global variable LAST_VERSION_VALIDE.

  • const (str, optional) – GNSS constellation to use. Default is “G”.

  • director_generik_path_inp (str, optional) – Path to the generic director file. Default is None.

  • director_name_prefix_inp (str, optional) – Prefix for the director name. Default is an empty string.

  • stations_file_inp (str, optional) – Path to the stations file. Default is None.

  • oceanload_file_inp (str, optional) – Path to the ocean load file. Default is None.

  • options_prairie_file_inp (str, optional) – Path to the options prairie file. Default is None.

  • stations_master_file_inp (str, optional) – Path to the stations master file. Default is None.

  • force (bool, optional) – Force the generation and run of directors even if they already exist. Default is False.

  • no_archive (bool, optional) – If True, do not archive the results. Default is False.

  • no_clean_tmp (bool, optional) – If True, do not clean the temporary files. Default is False.

  • no_updatebd (bool, optional) – If True, do not update the BDGINS repository. Default is False.

  • no_concat_orb_clk (bool, optional) –

    If True, do not concatenate the orbit and clock files prior to the main processing.

    Default is False.

  • verbose (bool, optional) – If True, enable verbose logging. Default is False.

  • updatebd_login (str) – The login to connect to the remote tite GINS server to update the database. We assume that SSH keys have been exchanged to automatize the connexion

Return type:

None