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(ssl: bool = True, logger: bool | Logger | None = None)

Bases: object

__init__(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'
}