autorino.handle package

Submodules

autorino.handle.handle_cls module

Created on Wed Jan 10 15:00:40 2024

@author: psakic

class autorino.handle.handle_cls.HandleGnss(**kwargs: Any)[source]

Bases: StepGnss

__init__(**kwargs: Any) → None[source]

Initialize a HandleGnss object.

This constructor initializes a HandleGnss object, which is used for handling GNSS data processing. It inherits from the StepGnss class.

Parameters:

**kwargs (keyword arguments) –

Additional keyword arguments passed to the parent StepGnss class. Common parameters include: - out_dir : str - The output directory for the processed files. - tmp_dir : str - The temporary directory for intermediate files. - log_dir : str - The directory for log files. - inp_dir : str, optional - The input directory for raw files. Default is None. - inp_file_regex : str, optional - Regular expression pattern for input files. - epoch_range : EpochRange, optional - The range of epochs to be processed. Default is None. - site : dict, optional - Information about the site. Default is None. - session : dict, optional - Information about the session. Default is None. - options : dict, optional - Additional options for the processing operation. Default is None. - metadata : str or list, optional - The metadata to be included in the converted RINEX files.

Possible inputs are:
  • list of string (sitelog file paths),

  • single string (single sitelog file path)

  • single string (directory containing the sitelogs)

  • list of MetaData objects

  • single MetaData object.

Defaults to None.

analyze_rnxs() → DataFrame[source]

this function do the basic analysis of the table of RINEXs

Note

Flags meaning

  • 0 = OK

  • 1 = missing RINEX or critical content

  • 2 = incomplete RINEX

check() → None[source]
feed_by_epochs(step_obj_feeder: StepGnss, mode: str = 'split', print_table: bool = True, add_extra_margin: bool = False) → None[source]

For a HandleGnss object, with a predefined epoch range find the corresponding RINEX for splice/split in the step_obj_feeder StepGnss, which a list of possible RINEXs candidates for the splice/split operation

Parameters:
  • step_obj_feeder (StepGnss) – StepGnss object, which a list of possible RINEXs candidates for the splice/split operation

  • mode (str) – split or splice if split: for fpath_inp, only one RINEX is returned (the need one for the split) if splice: for fpath_inp, a SpliceGnss object with several RINEXs is returned (all the needed ones for the splice)

  • add_extra_margin (bool, optional) – If True, adds an extra margin to the end epoch for splicing operations. This is useful for handling cases where the end epoch of the RINEX files may be slightly over the theoretical end epoch, such as with Leica raw files. Default is False (no extra margin).

  • print_table (bool) – If True, prints the tables for debugging purposes. Default is False.

Return type:

None

find_local_inp(return_as_step_obj: bool = True, rnx3_regex: bool = False) → StepGnss | list[str][source]

Guess the paths and name of the local raw files based on the EpochRange and inp_basename attributes of the DownloadGnss object.

Parameters:
  • return_as_step_obj (bool) – If True, returns the result as a StepGnss object. If False, returns a list of file paths. Default is True.

  • rnx3_regex (bool) – If True, uses a regex pattern for RINEX 3 filenames. If False, uses a wildcard pattern. Default is False.

Returns:

If return_as_step_obj is True, returns a StepGnss object populated with the found RINEX files. If return_as_step_obj is False, returns a list of found file paths.

Return type:

StepGnss or list

group_by_epochs(period: str = '1d', rolling_period: bool = False, rolling_ref: int = -1, round_method: str = 'floor', drop_epoch_rnd: bool = False) → tuple[HandleGnss, list[HandleGnss]][source]

Group the data by epochs.

This method groups the data in the table by epochs, rounding the epochs according to the specified period and method. It creates a main HandleGnss object and individual HandleGnss objects for each epoch group.

Parameters:
  • period (str, optional) – The period for rounding the epochs. Default is “1d”.

  • rolling_period (bool, optional) – Whether to use a rolling period for rounding. Default is False.

  • rolling_ref (int, optional) – The reference for the rolling period. Default is -1.

  • round_method (str, optional) – The method for rounding the epochs. Default is “floor”.

  • drop_epoch_rnd (bool, optional) – Whether to drop the temporary epoch_rnd column after grouping. Default is False.

Returns:

A tuple containing the main HandleGnss object and a list of individual HandleGnss objects for each epoch group.

Return type:

tuple

handl_soft_opts(irow: Any, handl_soft: str = 'converto', mode: str = 'splice', handl_opts_supl: str | list[str] | None = None, handl_kwopts_supl: dict | None = None) → tuple[list[str], dict][source]
load_input_rnxs(input_mode: str, input_rinexs: str | list | StepGnss | None = None) → StepGnss[source]

Get the input RINEX files for handeling (splice or split).

This method retrieves the input RINEX files based on the specified input mode and input RINEXs. It can find local input files or use a provided input list.

this method is tricky because it return a StepGnss, but do not modify the current object in place. it is a static method in fact, but not declared as such to be able to use self.logger

Parameters:
  • input_mode (str) – The mode for finding input RINEX files. It can be: - “find”: to find local input files. - “given”: to use provided input RINEX files.

  • input_rinexs (str or list or StepGnss) – The input RINEX files. Only useful for “given” mode. It can be: - A list of RINEX file paths. - An existing StepGnss object. Default is None.

Returns:

A StepGnss object containing the input RINEX files, or None if an error occurs.

Return type:

StepGnss

autorino.handle.modify_cls module

Created on 20/05/2025 20:27:15

@author: psakic

class autorino.handle.modify_cls.ModifyGnss(**kwargs: Any)[source]

Bases: HandleGnss

__init__(**kwargs: Any) → None[source]

Initialize a ModifyGnss object.

This constructor initializes a ModifyGnss object, which is used for a stand-alone application of RinexMod actions on RINEX files. It inherits from the HandleGnss class.

Parameters:

**kwargs (keyword arguments) – Additional keyword arguments passed to the parent HandleGnss class. Common parameters include: - out_dir : str - The output directory for the modified RINEX files. - tmp_dir : str - The temporary directory for intermediate files. - log_dir : str - The directory for log files. - inp_dir : str, optional - The input directory for raw files. Default is None. - inp_file_regex : str, optional - Regular expression pattern for input files. - epoch_range : EpochRange, optional - The range of epochs to be processed. Default is None. - site : dict, optional - Information about the site. Default is None. - session : dict, optional - Information about the session. Default is None. - options : dict, optional - Additional options for the modification operation. Default is None. - metadata : str or list, optional - Metadata for the modification operation. Default is None.

modify(verbose: bool = False, force: bool = False, reverse_order: bool = False, rinexmod_options: dict | None = None) → None[source]

Apply RINEX modifications to the data.

This method iterates over the rows of the table and applies RINEX modifications using the specified options. It checks if the operation is valid for each row before proceeding.

Parameters:
  • verbose (bool, optional) – If True, prints the table of operations. Default is False.

  • force (bool, optional) – If True, forces the rinexmod operation even if the output files already exist. Default is False.

  • reverse_order (bool, optional) – If True, processes the files in reverse order (anti-chronological, newer first). Default is False.

  • rinexmod_options (dict, optional) – The options to be used by the rinexmod function. If not provided, default options are used.

Return type:

None

autorino.handle.splice_cls module

Created on 20/05/2025 20:26:56

@author: psakic

class autorino.handle.splice_cls.SpliceGnss(**kwargs: Any)[source]

Bases: HandleGnss

__init__(**kwargs: Any) → None[source]

Initialize a SpliceGnss object.

This constructor initializes a SpliceGnss object, which is used for handling the splicing of RINEX files. It inherits from the HandleGnss class.

Parameters:

**kwargs (keyword arguments) – Additional keyword arguments passed to the parent HandleGnss class. Common parameters include: - out_dir : str - The output directory for the spliced RINEX files. - tmp_dir : str - The temporary directory for intermediate files. - log_dir : str - The directory for log files. - inp_dir : str, optional - The input directory for raw files. Default is None. - inp_file_regex : str, optional - Regular expression pattern for input files. - epoch_range : EpochRange, optional - The range of epochs to be processed. Default is None. - site : dict, optional - Information about the site. Default is None. - session : dict, optional - Information about the session. Default is None. - options : dict, optional - Additional options for the splicing operation. Default is None. - metadata : str or list, optional - Metadata for the splicing operation. Default is None.

mono_splice(irow: Any, out_dir: str | None = None, table_col: str = 'fpath_inp', handle_software: str = 'converto', handle_software_options: str | list[str] | None = None) → str | None[source]

“on row” method

for each row of the table, splice the ‘table_col’ entry, typically ‘fpath_inp’ file

in the splice case, fpath_inp in another SpliceGnss object, containing the RINEXs to splice

splice(input_mode: str = 'find', input_rinexs: str | list | Any | None = None, handle_software: str = 'converto', handle_software_options: str | list[str] | None = None, rinexmod_options: dict | None = None, verbose: bool = False, force: bool = False, reverse_order: bool = False, add_extra_margin: bool = False) → None[source]

Splice RINEX files.

This method splices RINEX files based on the provided input. It can find local input files, convert a list of RINEX files to a StepGnss object, or use an existing StepGnss object. The splicing operation is performed using the specified software and options.

Parameters:
  • input_mode (str, optional) – The mode for finding input RINEX files. It can be: - “find”: to find local input files. - “given”: to use provided input RINEX files. Default is “find”.

  • input_rinexs (str or list or StepGnss or None, optional) – The input RINEX files. It can be: - A list of RINEX file paths. - An existing StepGnss object. Default is None.

  • handle_software (str, optional) – The software to use for handling the RINEX files. Default is “converto”.

  • handle_software_options (str or list of str or None, optional) –

    Additional options for the handling software. It can be: - A string of options to be passed to the handling software. - A list of strings, where each string is an option to be passed to the handling

    software.

    • None, if no additional options are needed. Default is None.

  • rinexmod_options (dict, optional) – Additional options for the RINEX modification. Default is None.

  • verbose (bool, optional) – If True, prints the table for debugging purposes. Default is False.

  • force (bool, optional) – If True, forces the splicing operation. Default is False.

  • reverse_order (bool, optional) – If True, processes the files in reverse order (anti-chronological, newer first). Default is False.

  • add_extra_margin (bool, optional) – If True, adds an extra margin to the splicing operation. This can be useful for handling Leica raw files that can be a bit over their nominal end. Default is False.

Return type:

None

splice_core(handle_software: str = 'converto', handle_software_options: str | list[str] | None = None, rinexmod_options: dict | None = None) → None[source]

Perform the core splicing operation.

This method handles the core splicing operation for RINEX files. It iterates over each row in the table, performs the splicing operation using the specified software, and applies RINEX modifications if necessary. Temporary files are removed after the operation.

Parameters:
  • handle_software (str, optional) – The software to use for handling the RINEX files. Default is “converto”.

  • rinexmod_options (dict, optional) – Additional options for the RINEX modification. Default is None.

  • handle_software – The software to use for handling the RINEX files. Default is “converto”.

  • handle_software_options (str or list of str or None, optional) – Additional options for the handling software. It can be: - A string of options to be passed to the handling software. - A list of strings, where each string is an option to be passed to the handling software. - None, if no additional options are needed. Default is None.

Return type:

None

autorino.handle.split_cls module

Created on 20/05/2025 20:26:44

@author: psakic

class autorino.handle.split_cls.SplitGnss(**kwargs: Any)[source]

Bases: HandleGnss

__init__(**kwargs: Any) → None[source]

Initialize a SplitGnss object.

This constructor initializes a SplitGnss object, which is used for handling the splitting of RINEX files. It inherits from the HandleGnss class.

Parameters:

**kwargs (keyword arguments) – Additional keyword arguments passed to the parent HandleGnss class. Common parameters include: - out_dir : str - The output directory for the split RINEX files. - tmp_dir : str - The temporary directory for intermediate files. - log_dir : str - The directory for log files. - inp_dir : str, optional - The input directory for raw files. Default is None. - inp_file_regex : str, optional - Regular expression pattern for input files. - epoch_range : EpochRange, optional - The range of epochs to be processed. Default is None. - site : dict, optional - Information about the site. Default is None. - session : dict, optional - Information about the session. Default is None. - options : dict, optional - Additional options for the splitting operation. Default is None. - metadata : str or list, optional - Metadata for the splitting operation. Default is None.

mono_split(irow: Any, out_dir: str | None = None, table_col: str = 'fpath_inp', handle_software: str = 'converto', handle_software_options: str | list[str] | None = None) → str | None[source]

“on row” method

for each row of the table, split the ‘table_col’ entry, typically ‘fpath_inp’ file

split(input_mode: str = 'given', input_rinexs: str | list | Any | None = None, handle_software: str = 'converto', handle_software_options: str | list[str] | None = None, rinexmod_options: dict | None = None, verbose: bool = False, force: bool = False, reverse_order: bool = False, add_extra_margin: bool = False) → None[source]

Split RINEX files.

This method splits RINEX files based on the provided input. It can find local input files, convert a list of RINEX files to a StepGnss object, or use an existing StepGnss object. The splitting operation is performed using the specified software and options.

Parameters:
  • input_mode (str, optional) – The mode for finding input RINEX files. It can be: - “find”: to find local input files. - “given”: to use provided input RINEX files. Default is “given”.

  • input_rinexs (str or list or StepGnss or None, optional) – The input RINEX files. It can be: - A list of RINEX file paths. - An existing StepGnss object. Default is None.

  • handle_software (str, optional) – The software to use for handling the RINEX files. Default is “converto”.

  • handle_software_options (str or list of str or None, optional) – Additional options for the handling software. It can be: - A string of options to be passed to the software. - A list of strings, where each string is an option to be passed to the software. - None, if no additional options are needed. Default is None.

  • rinexmod_options (dict, optional) – Additional options for the RINEX modification. Default is None.

  • verbose (bool, optional) – If True, prints the table for debugging purposes. Default is False.

  • force (bool, optional) – If True, forces the splitting operation. Default is False.

  • reverse_order (bool, optional) – If True, processes the files in reverse order (anti-chronological, newer first). Default is False.

  • add_extra_margin (bool, optional) – If True, adds an extra margin to the epochs for splitting. Default is False.

Return type:

None

split_core(handle_software: str = 'converto', handle_software_options: str | list[str] | None = None, rinexmod_options: dict | None = None) → None[source]

Perform the core splitting operation.

This method handles the core splitting operation for RINEX files. It iterates over each row in the table, performs the splitting operation using the specified software, and applies RINEX modifications if necessary. Temporary files are removed after the operation.

Parameters:
  • handle_software (str, optional) – The software to use for handling the RINEX files. Default is “converto”.

  • handle_software_options (str or list of str or None, optional) – Additional options for the handling software. It can be: - A string of options to be passed to the software. - A list of strings, where each string is an option to be passed to the software. - None, if no additional options are needed. Default is None.

  • rinexmod_options (dict, optional) – Additional options for the RINEX modification. Default is None.

Return type:

None