geodezyx.operational.gins_runner package
Created on 26/02/2025 11:01:41
@author: psakic
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
foldertemp_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_double_diff module
Created on 26/02/2025 11:03:05
@author: psakic
- geodezyx.operational.gins_runner.gins_double_diff.double90_runner(inp_prarie_file, temp_data_folder='')
- geodezyx.operational.gins_runner.gins_double_diff.double_diff_binom(rinex_path_A, rinex_path_B, temp_data_folder='', final_data_folder='')
DISCONTINUED
- geodezyx.operational.gins_runner.gins_double_diff.double_diff_multi(rinex_path_list, temp_data_folder='', final_data_folder='', remove=True, ignore_glo_gal=False)
- rinex_path_list :
List of RINEXs paths
- temp_data_folder & final_data_folder :
if empty string (‘’), files are saved in pygins_runner “TEMP_DATA” folder and in the specified folder else
- geodezyx.operational.gins_runner.gins_double_diff.gen_dirs_from_double_diff(dd_files_paths_in, director_generik_path, director_name_prefix, out_director_folder='', temp_data_folder='', stations_file='', oceanload_file='', auto_staocl=False, perso_orbclk=False, gins_style_orb='GRG', ac='igs', repro=2, auto_interval=True, out_coords='NULL')
NEW FCT WHICH CAN MANAGE BOTH ONE RINEX OR A LIST OF RINEX
produce a director from a rinex, and write it in the specific location
- Input:
rinex_paths_in : can be a rinex path (a string) or a list of paths
- Return :
the path of the produced director as a string
If the rinex is not in a gins style folder, it will be copied in the
temp_data_folder
If
temp_data_folder
is not specified ( == ‘’) rinex will be copied in a ad hoc folder../gin/TEMP_DATA
If
out_director_folder
is not specified ( == ‘’), output director will be created in the../gin/data/directeur folder
- auto_staoclTrue or False
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
- perso_orbclkTrue or False
download and use specifics orbits according to ac & repro args (they are useless if perso_orbclk aren’t activated)
- auto_intervalTrue or False
find the interval in RINEX and apply it to the director
- out_coords‘XYZ’ or ‘FLH’/’PLH’
for geocentrical or geographical coords in output. any other string leaves the type of the generic director.
- prairieTrue or False
run prairie externally if True, prairie_kwargs control the arguments of the function prairie_manual (cf above)
geodezyx.operational.gins_runner.gins_legacy module
Created on 19/04/2025 17:32:02
@author: psakic
- geodezyx.operational.gins_runner.gins_legacy.check_gins_exe(streamin, director_name)
Check the execution status of a GINS director.
- Parameters:
streamin (file-like object) – The input stream to read the execution output from.
director_name (str) – The name of the director being checked.
- Returns:
True if the execution was successful, False otherwise.
- Return type:
bool
- geodezyx.operational.gins_runner.gins_legacy.dirs_copy_generik_2_working(director_name_prefix, director_generik_path, temp_data_folder=None)
- geodezyx.operational.gins_runner.gins_legacy.export_results_gins_listing(listings_list_in, outpath, static_or_kinematic='kine', outprefix='', coordtype='FLH')
- geodezyx.operational.gins_runner.gins_legacy.get_director_list(wildcard_dir)
with a wildcard (e.g. ‘GWADA_MK2*’) and return a list of corresponding directors found in gin/data/directeur folder
- geodezyx.operational.gins_runner.gins_legacy.merge_yaml(yaml1, yaml2, yaml_out=None)
- geodezyx.operational.gins_runner.gins_legacy.run_director_list_wrap(tupinp)
- geodezyx.operational.gins_runner.gins_legacy.run_dirs_kwwrap(kwarg)
- geodezyx.operational.gins_runner.gins_legacy.run_dirs_multi(dir_paths_inp, nprocs=4, opts_gins_pc='', opts_gins_90='', version='OPERA', cmd_mode='exe_gins_dir', force=False)
- geodezyx.operational.gins_runner.gins_legacy.run_dirs_multislots_custom(director_lis, slots_lis=['', 'U', 'L', 'R'], opts_gins_pc='', opts_gins_90='', version='OPERA', mode='ginspc')
- geodezyx.operational.gins_runner.gins_legacy.smart_directors_to_run(wildcard_dir='', full_path_out=True)
smart runner check directors who worked, and thus give a list of directors whitout those who worked
listing and directeur folders are inspected automatically
- geodezyx.operational.gins_runner.gins_legacy.smart_listing_archive(wildcard_dir, gins_main_archive, gins_anex_archive, prepars_archive, director_archive)
for each listing corresponding to the wildcard : if it’s a prepars => go to the prepars_archive if it’s a gins without duplicate => go to the gins_main_archive if it’s a gins with duplcates => one goes to gins_main_archive
the others in gins_anex_archive
- geodezyx.operational.gins_runner.gins_legacy.sort_by_stations(archive_path, wildcard, i)
i is the indice of the first character of the station name in eg : i = 18 for filename KARIB_MK3_FLH_v2__bara_22282_2011_003
archive path is ABSOLUTE b.c. it can be outside of the gins folder
- geodezyx.operational.gins_runner.gins_legacy.write_oclo_file(station_file, oceanload_out_file, fes_yyyy=2004)
geodezyx.operational.gins_runner.gins_orbclk module
Created on 26/02/2025 11:36:09
@author: psakic
- geodezyx.operational.gins_runner.gins_orbclk.bad_sat_finder(orbfilein, egrep_ready=True)
- geodezyx.operational.gins_runner.gins_orbclk.clk_2_gins(clk_pathin)
- geodezyx.operational.gins_runner.gins_orbclk.download_convert_2_gins_orb_clk(centraldate, work_folder=None, ac='jpl', repro=2, rm_temp_files=True, data_center='cddis', force=False)
- geodezyx.operational.gins_runner.gins_orbclk.orbit_cleaner(orbfilein, orbfileout)
remove sat of a gins orbit file without a nominal number of epoch
- geodezyx.operational.gins_runner.gins_orbclk.sort_orbit_gins(pathin, pathout)
- geodezyx.operational.gins_runner.gins_orbclk.sp3_2_gins(sp3_pathin)
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={})
- 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.
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.concat_orb_clk(date_srt, date_end, nprocs, 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.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_24_2', 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 “VALIDE_23_2”.
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