geodezyx.files_rw.write package

Submodules

geodezyx.files_rw.write.write_geo_files module

@author: psakic

This sub-module of geodezyx.files_rw contains functions to write misc. geodetic data in dedicated files.

it can be imported directly with: from geodezyx import files_rw

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/IPGP/geodezyx

geodezyx.files_rw.write.write_geo_files.ine_block_mono(sat, dt_in, extra_intrvl_strt=0.1, extra_intrvl_end=0.4, step=300)

Write an EPOS INE block

geodezyx.files_rw.write.write_geo_files.sp3_overlap_creator(ac_list, dir_in, dir_out, suffix_out_input=None, overlap_size=7200, force=False, manage_missing_sats='exclude_missing_epoch', eliminate_null_sat=True, severe=False, separated_systems_export=False, first_date=None, end_date=None, exclude_bad_epoch=True, sys=None, new_name=False)

Generate an SP3 Orbit file with overlap based on the SP3s of the days before and after

Parameters:
  • ac_list (list) – 3-character codes of the ACs.

  • dir_in (str) – where the input sp3 are.

  • dir_out (str) – where the output sp3 will be outputed.

  • suffix_out_input (str, optional) – last char of the 3-char. code. if None, then it is the same as input.

  • overlap_size (int, optional) – Overlapsize. The default is 7200.

  • force (True, optional) – force overwrite. The default is False.

  • manage_missing_sats (str, optional) –

    ‘exclude_missing_day’ : generate a file with only the common sat between the 3 days. Thus, exclude the missing sats for a complete day

    ’exclude_missing_epoch’ : generate a file with only sat with full epochs

    ’extrapolate’ : extrapolate the missing sats based on the first/last epoch

    The default is ‘exclude_missing_epoch’.

  • eliminate_null_sat (bool, optional) – eliminate null sat. The default is True.

  • severe (bool, optional) – raise an exception if problem. The default is False.

  • separated_systems_export (bool, optional) – export different sp3 for different system. The default is False.

  • first_date (datetime, optional) – exclude SP3 before this epoch

  • end_date (datetime, optional) – exclude SP3 after this epoch

  • exclude_bad_epoch (bool, optional) – remove bad epoch (usually filled with 99999999.9999999 or 0.00000000)

  • sys (string, optional) – if just to keep one system (e.g.: G)

Return type:

None.

Note

start/end date are not implemented the force option skips existing files not implemented for new names

geodezyx.files_rw.write.write_geo_files.write_clk(df_clk_in, outpath, outname=None, prefix='orb', header='', output_std_values=False)

Write a SP3 Clock file from an Clock DataFrame

Parameters:
  • df_clk_in (DataFrame) – Input Clock DataFrame.

  • outpath (str) – The output path of the file (see also outname).

  • outname (None or str, optional) – None = outpath is the full path (directory + filename) of the output. A string = a manual name for the file. ‘auto_old_cnv’ = automatically generate the filename (old convention) ‘auto_new_cnv’ = automatically generate the filename (new convention) The default is None.

  • prefix (str, optional) – the output 3-char. name of the AC. The default is ‘orb’.

  • header (str, optional) – A string describing the clk file header. The default is “”.

  • output_std_values (bool, optional) – Add observation sigmas as the last column. The default is False.

Return type:

The string containing the formatted clock data.

geodezyx.files_rw.write.write_geo_files.write_epos_sta_coords(df_inp, file_out, sort_wrt='site', no_time_limit_for_first_period=True, no_time_limit_for_last_period=True, soln_in_df=True, trf_name='xTRFnn')

Write an EPOS coordinate file

Parameters:
  • df_inp (DataFrame) – Input Orbit DataFrame.

  • file_out (str) – The output path of the file.

  • sort_wrt (bool, optional) – Sort the values with respect to a DF column. The default is “site”.

  • no_time_limit_for_first_period (bool, optional) – No time limit for the first period. The default is True.

  • no_time_limit_for_last_period (bool, optional) – No time limit for the last period. The default is True.

  • soln_in_df (bool, optional) – Soln in DF. The default is True.

Return type:

None.

geodezyx.files_rw.write.write_geo_files.write_ine_dummy_file(Sat_list, dt_in, extra_intrvl_strt=0.1, extra_intrvl_end=0.4, step=300, out_file_path=None)

Write an EPOS INE dummy (empty values) file

geodezyx.files_rw.write.write_geo_files.write_sp3(orb_df_in, outpath, outname=None, prefix='orb', skip_null_epoch=True, force_format_c=False)

Write a SP3 file from an Orbit DataFrame

Parameters:
  • orb_df_in (DataFrame) – Input Orbit DataFrame.

  • outpath (str) – The output path of the file (see also outname).

  • outname (None or str, optional) – None = outpath is the full path (directory + filename) of the output. A string = a manual name for the file. ‘auto_old_cnv’ = automatically generate the filename (old convention) ‘auto_new_cnv’ = automatically generate the filename (new convention) The default is None.

  • prefix (str, optional) – the output 3-char. name of the AC. The default is ‘orb’.

  • skip_null_epoch (bool, optional) – Do not write an epoch if all sats are null (filtering). The default is True.

  • force_format_c (bool, optional) – force SP3’s format c. The default is False.

Return type:

The string containing the formatted SP3 data.

geodezyx.files_rw.write.write_rinex module

@author: psakic

This sub-module of geodezyx.files_rw contains functions to read RINEX files observation files.

it can be imported directly with: from geodezyx import files_rw

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/IPGP/geodezyx

geodezyx.files_rw.write.write_rinex.header_rinex3_generic()
geodezyx.files_rw.write.write_rinex.write_epoch_rinex3(epoch, nsats, epoch_flag=0, clk_offset=0.0)

Write the epoch line in the RINEX3 format

Parameters:
  • epoch (datetime) – the epoch.

  • nsats (int) – numbers of satellites for the epoch.

  • epoch_flag (int, optional) – Epoch flag: 0 : OK 1 : power failure between previous and current epoch >1 : Special event (see documentation) The default is 0.

  • clk_offset (float, optional) – Receiver clock offset correction (seconds, optional). The default is 0..

Returns:

lout – output string line.

Return type:

str

geodezyx.files_rw.write.write_rinex.write_rinex3(DFrnx_in, rnx_header='')
geodezyx.files_rw.write.write_rinex.write_rinex3_body(DFrnx_in)

Write the body (data records) of a RINEX files (Version 3 only)

Parameters:

DFrnx_in (RINEX DataFrame) – Input RINEX DataFrame.

Returns:

  • rnx_str_out (str) – The RINEX data records as string.

  • dict_sys_obs (dict) – A dictionnary with GNSS system as key (G,R,E…). And the observables for each system as values (gives the order of the observables)

geodezyx.files_rw.write.write_tropo_spotgins module

geodezyx.files_rw.write.write_tropo_spotgins.extract_data_from_gz(gz_path: Path)

Lit le .gz à l’envers, ne garde que la dernière estimation par horodatage. Retourne une liste triée: [iso_date, ZTD, ZTD_STD, ZHD, ZWD, TGN, STD_TGN, TGE, STD_TGE].

geodezyx.files_rw.write.write_tropo_spotgins.generate_header(station_name: str, position: dict | None)

Construit l’entête SPOTGINS. Si position est None, utilise des 0.0.

geodezyx.files_rw.write.write_tropo_spotgins.main()
geodezyx.files_rw.write.write_tropo_spotgins.parse_args()
geodezyx.files_rw.write.write_tropo_spotgins.read_master_file(station_name: str, master_file_path: Path)

Retourne un dict avec X,Y,Z,Lon,Lat,H ou None si fichier absent / station non trouvée.