moncenterlib.gnss package

moncenterlib.gnss.cddis_client module

This module is designed to download one or more GNSS files from the CDDIS archive. This simplifies the process of searching and downloading various types of files. This automates your process. See more here: https://cddis.nasa.gov/Data_and_Derived_Products/GNSS/GNSS_data_and_product_archive.html

Learn more about the specific class.

class moncenterlib.gnss.cddis_client.CDDISClient(logger: bool | Logger | None = None)

Bases: object

__init__(logger: bool | Logger | None = None) None
Parameters:

logger (bool | Logger, optional) – if the logger is None, a logger will be created inside the default class. If the logger is False, then no information will be output. If you pass an instance of your logger, the information output will be implemented according to your logger. Defaults to None.

get_clock_30s(output_dir: str, query: dict, unpack=True) dict

A method for downloading files of final station clock solutions (CLK 30 seconds). See more here: https://cddis.nasa.gov/Data_and_Derived_Products/GNSS/clock_products.html

Parameters:
  • output_dir (str) – The path where the files should be saved.

  • query (dict) – A request containing a start date and an end date. Example: {“start”: “2020-12-30”, “end”: “2021-12-30”}. Format date = YYYY-MM-DD

  • unpack (bool, optional) – Deleting an archive after unpacking. Defaults to True.

Returns:

The dictionary contains 3 keys. done, no_exists, no_found_dates. The done key stores a list of files that have been successfully created. The no_exists key stores a list of files that have not been created. The no_found_dates key stores a list of dates that have not been found.

Return type:

dict

Examples

>>> cddiscli = CDDISClient()
>>> query = {"start": "2020-12-30", "end": "2021-01-02"}
>>> res = cddiscli.get_clock_30s("/output_dir", query)
>>> res
{
    "done": ["file_1", "file_2"],
    "no_exists": [],
    "no_found_dates": []
}
get_clock_5m(output_dir: str, query: dict, unpack=True) dict

A method for downloading files of final station clock solutions (CLK 5 minutes). See more here: https://cddis.nasa.gov/Data_and_Derived_Products/GNSS/clock_products.html

Parameters:
  • output_dir (str) – The path where the files should be saved.

  • query (dict) – A request containing a start date and an end date. Example: {“start”: “2020-12-30”, “end”: “2021-12-30”}. Format date = YYYY-MM-DD

  • unpack (bool, optional) – Deleting an archive after unpacking. Defaults to True.

Returns:

The dictionary contains 3 keys. done, no_exists, no_found_dates. The done key stores a list of files that have been successfully created. The no_exists key stores a list of files that have not been created. The no_found_dates key stores a list of dates that have not been found.

Return type:

dict

Examples

>>> cddiscli = CDDISClient()
>>> query = {"start": "2020-12-30", "end": "2021-01-02"}
>>> res = cddiscli.get_clock_5m("/output_dir", query)
>>> res
{
    "done": ["file_1", "file_2"],
    "no_exists": [],
    "no_found_dates": []
}
get_daily_30s_data(output_dir: str, query: dict, unpack=True) dict

This method allows you to download Daily 30-second data. It is possible to select a range of days. Also select the station, file type and RINEX version. See more here: https://cddis.nasa.gov/Data_and_Derived_Products/GNSS/daily_30second_data.html

Parameters:
  • output_dir (str) – The path where the files should be saved.

  • query (dict) – The dictionary should contain the following keys. “start” - start date, “end”- end date, “station” - station name, “type” - file type, “rinex_v” - RINEX version (2, 3, auto).

  • unpack (bool, optional) – Deleting an archive after unpacking. Defaults to True.

Raises:
  • ValueError – Path to output_dir is strange.

  • KeyError – Invalid query.

  • ValueError – Start day must be less than or equal to end day.

  • ValueError – Rinex version 3 doesn’t support.

  • ValueError – Unknow rinex version.

Returns:

The dictionary contains 3 keys. done, no_exists, no_found_dates. The done key stores a list of files that have been successfully created. The no_exists key stores a list of files that have not been created. The no_found_dates key stores a list of dates that have not been found.

Return type:

dict

Examples

>>> cddiscli = CDDISClient()
>>> query = {"start": "2020-12-30", "end": "2021-01-02", "station": "NOVM", "type": "o", "rinex_v": "2"}
>>> res = cddiscli.get_daily_30s_data("/output_path", query))
>>> res
{
    "done": ["file_1", "file_2"],
    "no_exists": [],
    "no_found_dates": []
}
get_daily_multi_gnss_brd_eph(output_dir: str, query: dict, unpack: bool = True) dict

This method allows you to download Daily RINEX V3 GNSS Broadcast Ephemeris Files or Daily Multi-GNSS Broadcast Ephemeris Files. These are the format files BRDC00IGS_R_YYYYDDDHHMM_01D_MN.rnx.gz and BRDM00DLR_S_YYYYDDDHHMM_01D_MN.rnx.gz accordingly. Daily RINEX V3 GNSS Broadcast Ephemeris Files are downloaded as a priority. If no such file was found, then the Daily Multi-GNSS Broadcast Ephemeris Files are downloaded. See more here: https://cddis.nasa.gov/Data_and_Derived_Products/GNSS/broadcast_ephemeris_data.html

Parameters:
  • output_dir (str) – The path where the files should be saved.

  • query (dict) – A request containing a start date and an end date. Example: {“start”: “2020-12-30”, “end”: “2021-12-30”}. Format date = YYYY-MM-DD

  • unpack (bool, optional) – Deleting an archive after unpacking. Defaults to True.

Raises:
  • ValueError – Path to output_dir is strange.

  • KeyError – The query must have the start and end keys.

  • ValueError – Start day must be less than or equal to end day.

Returns:

The dictionary contains 3 keys. done, no_exists, no_found_dates. The done key stores a list of files that have been successfully created. The no_exists key stores a list of files that have not been created. The no_found_dates key stores a list of dates that have not been found.

Return type:

dict

Examples

>>> cddiscli = CDDISClient()
>>> query = {"start": "2020-12-30", "end": "2021-01-02"}
>>> res = cddiscli.get_daily_multi_gnss_brd_eph("/output_dir", query)
>>> res
{
    "done": ["file_1", "file_2"],
    "no_exists": [],
    "no_found_dates": []
}
get_earth_orientation(output_dir: str, query: dict, unpack=True) dict

A method for downloading files of final Earth rotation parameters (ERP). See more here: https://cddis.nasa.gov/Data_and_Derived_Products/GNSS/orbit_products.html

Parameters:
  • output_dir (str) – The path where the files should be saved.

  • query (dict) – A request containing a start date and an end date. Example: {“start”: “2020-12-30”, “end”: “2021-12-30”}. Format date = YYYY-MM-DD

  • unpack (bool, optional) – Deleting an archive after unpacking. Defaults to True.

Returns:

The dictionary contains 3 keys. done, no_exists, no_found_dates. The done key stores a list of files that have been successfully created. The no_exists key stores a list of files that have not been created. The no_found_dates key stores a list of dates that have not been found.

Return type:

dict

Examples

>>> cddiscli = CDDISClient()
>>> query = {"start": "2020-12-30", "end": "2021-01-20"}
>>> res = cddiscli.get_earth_orientation("/output_dir", query)
>>> res
{
    "done": ["file_1", "file_2"],
    "no_exists": [],
    "no_found_dates": []
}
get_precise_orbits(output_dir: str, query: dict, unpack=True) dict

A method for downloading files of final precise orbits (SP3). See more here: https://cddis.nasa.gov/Data_and_Derived_Products/GNSS/orbit_products.html

Parameters:
  • output_dir (str) – The path where the files should be saved.

  • query (dict) – A request containing a start date and an end date. Example: {“start”: “2020-12-30”, “end”: “2021-12-30”}. Format date = YYYY-MM-DD

  • unpack (bool, optional) – Deleting an archive after unpacking. Defaults to True.

Returns:

The dictionary contains 3 keys. done, no_exists, no_found_dates. The done key stores a list of files that have been successfully created. The no_exists key stores a list of files that have not been created. The no_found_dates key stores a list of dates that have not been found.

Return type:

dict

Examples

>>> cddiscli = CDDISClient()
>>> query = {"start": "2020-12-30", "end": "2021-01-02"}
>>> res = cddiscli.get_precise_orbits("/output_dir", query)
>>> res
{
    "done": ["file_1", "file_2"],
    "no_exists": [],
    "no_found_dates": []
}

moncenterlib.gnss.gnss_time_series module

moncenterlib.gnss.gnss_time_series.parse_pos_file(path2file: str, sep: str | None = None) tuple[dict[str, list], list[list[str]]]

This function for parsing .pos file. The method returns header, name of columns and time serie.

Parameters:
  • path2file (str) – Path to the file .pos

  • sep (str | None, optional) – If .pos file has separation (e.g. ;) use sep=”;”. Defaults to None.

Returns:

Return tuple. First item is header of .pos file.

Second item is time serie.

Return type:

tuple[dict[str, list], list[list[str]]]

moncenterlib.gnss.postprocessing module

The module for standard and precise positioning with GNSS (global navigation satellite system).

  • Post‐Processing Analysis;

  • Soon.

The module has the following classes: - RtkLibPost; - Soon.

Learn more about the specific class.

class moncenterlib.gnss.postprocessing.RtkLibPost(logger: bool | Logger | None = None)

Bases: object

This class is based on the RTKLib software package. RTKLIB contains a post processing analysis AP RTKPOST. RTKPOST inputs the standard RINEX 2.10, 2.11, 2.12, 3.00, 3.01, 3.02 (draft) observation data and navigation message files (GPS, GLONASS, Galileo, QZSS, BeiDou and SBAS) and can computes the positioning solutions by various positioning modes including Single‐point, DGPS/DGNSS, Kinematic, Static, PPP‐Kinematic and PPP‐Static. See more about RTKLIB here: https://rtklib.com/ This class can postprocessing one or more files. See code usage examples in the examples folder.

__init__(logger: bool | Logger | None = None)
Parameters:

logger (bool | Logger, optional) – if the logger is None, a logger will be created inside the default class. If the logger is False, then no information will be output. If you pass an instance of your logger, the information output will be implemented according to your logger. Defaults to None.

get_default_config() dict

Return variable __default_config. __default_config isn’t editable. In the future, you will manually configure this config and send it to the start method. See documentation RTKLIB (manual_2.4.2, page 34-49), how to configuration. Also you can see in example code how to configure.

Returns:

default config for rnx2rtkp of RTKLib

Return type:

dict

Examples

>>> from moncenterlib.gnss.postprocessing import RtkLibPost
>>> rtk_post = RtkLibPost()
>>> rtk_post.get_default_config()
{
    'pos1-posmode': '0',
    'pos1-frequency':  '2',
    'pos1-soltype':  '0',
    'pos1-elmask':  '15',
    'pos1-snrmask_r':  'off',
    'pos1-snrmask_b':  'off',
    ...
}
scan_dirs(input_rnx: dict[str, str], recursion: bool = False) dict[str, list[str]]

This method scans the directories and makes a list of files for further work of the class. The method can also recursively search for files.

Parameters:
  • input_rnx (dict[str, str]) – input_rnx must be a dictionary. Key is the type of file. Value is the path to the directory. This is a list of keys that you can use. [‘rover’, ‘base’, ‘nav’, ‘sp3’, ‘clk’, ‘erp’, ‘dcb’, ‘ionex’].

  • recursion (bool, optional) – Recursively search for files. Defaults to False.

Raises:

ValueError – Unidentified key.

Returns:

Return a dict of files.

Return type:

dict[str, list[str]]

Examples

>>> from moncenterlib.gnss.postprocessing import RtkLibPost
>>> rtk_post = RtkLibPost()
>>> paths = {'rover': '/path/to/rover', 'base': '/path/to/base', 'nav': '/path/to/nav'}
>>> rtk_post.scan_dirs(paths, True)
{
    'rover': ['file1.rnx', 'file2.rnx'],
    'base': ['file1.rnx', 'file2.rnx'],
    'nav': ['file1.rnx', 'file2.rnx']
}
start(input_rnx: dict[str, str | list[str]], output: str, config: dict[str, str] | str, erp_from_config: bool = False, timeint: int = 0, recursion: bool = False, show_info_rtklib: bool = True) dict[str, list]

The method starts the postprocessing.

Parameters:
  • input_rnx (dict[str, str | list[str]]) – The dictionary where keys are a type of file and values are a list of path to the files or path to directory or path to one file.

  • output (str) – The path to the directory where the files will be saved.

  • config (dict[str, str] | str) – Dictionary with configuration. You can get the configuration by calling the get_default_config() method.

  • erp_from_config (bool, optional) – This flag indicates where to get the files from.erp for post-processing. True if the file .erp is taken from the configuration file. False if taken from the dictionary. Defaults to False.

  • timeint (int, optional) – Time interval. Defaults to 0.

  • recursion (bool, optional) – If you put a path to dir in arg input_rnx, recursively search for files. Defaults to False.

  • show_info_rtklib (bool, optional) – This flag indicates whether to display the output of the rnx2rtkp program. True to display. False is not displayed. Defaults to True.

Raises:
  • ValueError – Output directory does not exist.

  • ValueError – Config file does not exist.

Returns:

The dictionary contains 3 keys. done, no_exists, no_match. The done key stores a list of files that have been successfully created. The no_exists key stores a list of files that have not been created. The no_match key stores a list of no match files.

Return type:

dict[str, list]

Examples

>>> from moncenterlib.gnss.postprocessing import RtkLibPost
>>> rtk_post = RtkLibPost()
>>> paths = {'rover': '/path/to/rover', 'base': '/path/to/base', 'nav': '/path/to/nav'}
>>> config = rtk_post.get_default_config()
>>> rtk_post.start(paths, '/path/to/output', config, erp_from_config=False, timeint=1, recursion=False, show_info_rtklib=True)
{
    "done": ["path2pos1", "path2pos2"],
    "error": ["path2pos3", "path2pos4"],
    "no_match": [{"base": "path2file1"}, {"erp": "path2file2"}]
}

moncenterlib.gnss.quality_check module

This module is designed for monitoring the quality and quantity of multi—GNSS data. The module has the following classes: - Anubis; - Soon.

Learn more about the specific class.

class moncenterlib.gnss.quality_check.Anubis(logger: bool | Logger | None = None)

Bases: object

G-Nut/Anubis is an open source tool designed to monitor the quality and quantity of multi—GNSS data stored in RINEX 2.xx and 3.0x formats. It is capable of processing new signals from all global navigation satellite systems and their add-ons (GPS, GLONASS, Galileo, BeiDou, SBAS and QZSS). G-Nut/Anubis supports GPS, GLONASS and Galileo and performs single-point positioning, as well as provides GNSS data characteristics based on altitude and azimuth. See more about G-Nut/Anubis here: https://gnutsoftware.com/software/anubis This class can processing one or more files. See code usage examples in the examples folder.

__init__(logger: bool | Logger | None = None) None
Parameters:

logger (bool | Logger, optional) – if the logger is None, a logger will be created inside the default class. If the logger is False, then no information will be output. If you pass an instance of your logger, the information output will be implemented according to your logger. Defaults to None.

scan_dirs(input_dir_obs: str, input_dir_nav: str, recursion: bool = False) tuple[dict[str, list[list[str]]], dict[str, list[str]]]

This method scans the directory and makes a match list of files for further work of the class. The method can also recursively search for files.

Parameters:
  • input_dir_obs (str) – Path to the observation directory.

  • input_dir_nav (str) – Path to the navigation directory.

  • recursion (bool, optional) – Recursively search for files. Defaults to False.

Raises:

ValueError – Please, remove spaces in path.

Returns:

First element of the tuple is a dictionary of matching. Key is name of station. Value is list of matches. The list of matches contains observation and navigation files matched by date. Second element of the tuple is a dictionary of non-matching. The list of matches contains observation files for which no navigation files were found.

Return type:

tuple[dict[str, list[list[str]]], dict[str, list[str]]]

Examples

>>> anubis = Anubis()
>>> res = anubis.scan_dir("/path_to_dir_obs", "/path_to_dir_nav", True)
>>> res
{"station1": [["/obs1.txt", "/nav1.txt"], ["/obs2.txt", "/nav2.txt"]],
"station2": [["/obs3.txt", "/nav1.txt"], ["/obs4.txt", "/nav4.txt"]]}
start(input_data: dict | tuple, recursion: bool = False, output_dir_xtr: str | None = None) tuple[dict[str, dict[str, float | int | str | dict]], dict[str, list[str]]]

This method starts the process of calculating the quality and quantity of multi-GNSS data. The method allows you to upload one or more files for calculation.

Parameters:
  • input_data (dict | tuple) – There are several possible input options. Tuple which contains the path to the observations and navigation file(“/obs.txt”, “/nav.txt”). Tuple which contains the path to the directory of observation and navigation files, respectively(“/dir_obs”, “/dir_nav”). As well as the dictionary obtained from the scan_dirs method.

  • recursion (bool, optional) – Recursively search for files. Defaults to False.

  • output_dir_xtr (str | None, optional) – The directory where the anubis xtr output files will be saved. Defaults to None.

Raises:
  • ValueError – Please, remove spaces in path.

  • ValueError – Path to file or dir is strange.

Returns:

First element of the tuple is a dictionary of metrics for each date found for each station. Second element of the tuple is a dictionary of observation files for which no navigation files were found.

Return type:

tuple[dict[str, dict[str, float | int | str | dict]], dict[str, list[str]]]

Examples

>>> anubis = Anubis()
>>> result = anubis.start(("/path_to_dir_obs", "/path_to_dir_nav"), False, "/path2output_xtr")
>>> res
{"station1": {"date1": {"some_metrics": "123"},
              "date2": {"some_metrics": "123"}
              },
 "station2": {"date1": {"some_metrics": "123"},
              "date2": {"some_metrics": "123"}
              }
}

moncenterlib.gnss.rgs_client module

This module allows you to download various GNSS files from the service https://rgs-centre.ru This module can. 1) Download different files from different stations. 2) Get information about one or all stations. 3) Get information about files.

Learn more about the specific class.

See example code in example folder.

class moncenterlib.gnss.rgs_client.RGSClient(api_token: str, ssl: bool = True, logger: bool | Logger | None = None)

Bases: object

__init__(api_token: str, ssl: bool = True, logger: bool | Logger | None = None) None
Parameters:
  • api_token (str) – API token from personal account of rgs-centre.

  • ssl (bool, optional) – It may be that the rgs-centre will not have a security certificate. Then access to this service will be unavailable. To restore access, you must set the value to False. But be careful. It’s not safe.. Defaults to True.

  • logger (bool | Logger, optional) – if the logger is None, a logger will be created inside the default class. If the logger is False, then no information will be output. If you pass an instance of your logger, the information output will be implemented according to your logger. Defaults to None.

Raises:

ValueError – API token is empty.

download_files(output_dir: str, filter_param: dict, unpack=True) dict

Downloading files according to the specified request

Parameters:
  • output_dir (str) – The path where the files should be saved.

  • filter_param (dict) – filter. See exaples code or https://rgs-centre.ru/rest-api

  • unpack (bool, optional) – Unpack archive. Defaults to True.

Raises:
  • ValueError – Path to output_dir is strange.

  • Exception – List information about files is empty.

Returns:

The dictionary contains 3 keys. done, no_exists, no_found_dates. The done key stores a list of files that have been successfully created. The no_exists key stores a list of files that have not been created. The no_found_dates key stores a list of dates that have not been found.

Return type:

dict

get_all_stations_info() list[dict]

Get all informations of stations.

Returns:

A list with information of stations.

Return type:

list[dict]

Examples

>>> rgs_cli = RGSClient("your_api")
>>> res = rgs_cli.get_all_stations_info()
>>> res
[{some_info1}, {some_info2}]
get_info_list_of_files(filter_param: dict) list[dict]

Get information about files.

Parameters:

filter_param (dict) – filter. See exaples code or https://rgs-centre.ru/rest-api

Returns:

A list with information of files.

Return type:

list[dict]

Examples

>>> rgs_cli = RGSClient("your_api")
>>> param = {"working_center": "NSK1", "date": "2022-01-01", "type": "O"}
>>> res = rgs_cli.get_info_list_of_files(param)
>>> res
[{
    'id': 450675, 'type': 'O',
    'name': 'NSK100RUS_R_20220010000_01D_30S_MO.rnx.gz',
    'original_name': 'NSK100RUS_R_20220010000_01D_30S_MO.rnx',
    'date': '2022-01-01', 'year': 2022, 'day': 1, 'gps_week': 2190, 'gps_week_day': 6,
    'rinex_version': 3.04
}]
get_station_info(fags_name: str) dict

Get information of station. See name of stations here: https://rgs-centre.ru/fags-map or https://rgs-centre.ru/fags-coords

Parameters:

fags_name (str) – Station name.

Returns:

A dictionary with station information is returned.

Return type:

dict

Examples

>>> rgs_cli = RGSClient("your_api")
>>> res = rgs_cli.fags_info("NSK1")
>>> res
{
    'name': 'NSK1', 'iers_number': None,
    'x': 447670.3, 'y': 3638117.39, 'z': 5202281.56,
    'vx': -0.027, 'vy': 0.003, 'vz': -0.004,
    'b': 55.01225551, 'l': 82.98501852, 'h': 141.68742225,
    'vb': -0.00077, 'vl': 0.0003, 'vh': 0.01248,
    'vn': -0.00203, 've': 0.02716, 'vu': -0.00346,
    'receiver': 'LEICA GR50', 'antenna': 'LEIAR20         LEIM'
}

moncenterlib.gnss.tools4rnx module

A module for manipulating RINEX files. - Converting raw satellite receiver data into a universal RINEX format; - Soon (e.g. merge, cut rinex files).

The module has the following classes: - RtkLibConvbin; - Soon.

Learn more about the specific class.

class moncenterlib.gnss.tools4rnx.RtkLibConvbin(logger: bool | Logger | None = None)

Bases: object

This class is based on the RTKLib software package. Convert RTCM, receiver raw data log and RINEX file to RINEX and SBAS/LEX message file. SBAS message file complies with RTKLIB SBAS/LEX message format. See more about RTKLIB here: https://rtklib.com/ This class can convert one or more files. See code usage examples in the examples folder.

__init__(logger: bool | Logger | None = None)
Parameters:

logger (bool | Logger, optional) – if the logger is None, a logger will be created inside the default class. If the logger is False, then no information will be output. If you pass an instance of your logger, the information output will be implemented according to your logger. Defaults to None.

get_default_config() dict

Return variable __default_config. Default config isn’t editable. In the future, you will manually configure this config and send it to the start method. See documentation RTKLIB, how to configuration.

Returns:

default config for convbin of RTKLib

Return type:

dict

scan_dir(input_dir: str, recursion: bool = False) list[str]

This method scans the directory and makes a list of files for further work of the class. The method can also recursively search for files.

Parameters:
  • input_dir (str) – Path to the directory.

  • recursion (bool, optional) – Recursively search for files. Defaults to False.

Raises:

ValueError – Path to dir is strange.

Returns:

List of files.

Return type:

list[str]

Examples

>>> t4r = RtkLibConvib()
>>> res = t4r.scan_dir("/some_path_to_dir", True)
>>> res
["file_1", "file_2"]
start(input_raw: str | list, output: str, config: dict, recursion: bool = False) dict

The method starts the process of preserving files in the RINEX format.

Parameters:
  • input_raw (str | list) – The input method can accept a path of up to one file. The path to the directory where several files are stored. As well as a list of files generated by the scan_dirs method.

  • output (str) – The path to the directory where the files will be saved.

  • config (dict) – Dictionary with configuration. You can get the configuration by calling the get_default_config() method.

  • recursion (bool, optional) – When you put path to directory, you can use recursively search for files. Defaults to False.

Raises:
  • ValueError – Path to file or dir is strange.

  • TypeError – The type of the ‘input_raw’ variable should be ‘str’ or ‘list’.

  • ValueError – Path to output dir is strange.

Returns:

The dictionary contains 2 keys. Done and error. The done key stores a list of files that have been successfully created. The error key stores a list of files that have not been created.

Return type:

dict

Examples

>>> t4r = RtkLibConvib()
>>> list_files = t4r.scan_dir("/some_path_to_dir", True)
>>> config = t4r.get_default_config()
>>> config["format"] = "ubx"
>>> res = t4r.start(list_files, "/some_output_dir", config, True)
>>> res
{
    'done': ["file_1", "file_2"],
    'error': ["file_3"]
}

Module contents