moncenterlib.gnss.bernese_tools module

class moncenterlib.gnss.bernese_tools.Bernese52(list_stations: dict[str, dict], logger: bool | Logger | None = None)

Bases: object

Helper class for preparing Bernese 5.2 input files from GNSS station metadata.

__init__(list_stations: dict[str, dict], logger: bool | Logger | None = None)

Initialize a Bernese 5.2 helper with station metadata.

Parameters:
  • list_stations (dict[str, dict]) – Dictionary with station metadata. The plate field should use one of these 4-character plate codes: PCFC, AFRC, ANTA, ARAB, AUST, CARB, COCO, EURA, INDI, NAZC, NOAM, SOAM, JUFU, PHIL.

  • logger (bool | Logger, optional) – Logging configuration. If None, a default logger is created. If False, logging output is disabled. If a Logger instance is provided, that logger is used for all messages. Defaults to None.

Examples

>>> list_stations = {
...     "BADG": {
...         "xyz": [-838281.8740, 3865775.9807, 4987625.1818],
...         "mark_num": "12338M002",
...         "plate": "EURA",
...         "rcv_type": "JAVAD TRE_3 DELTA",
...         "ant_type": "JAVRINGANT_DM   JVDM",
...         "ant_HEN": [0.0280, 0.0000, 0.0000],
...     },
...     "NOVM": {
...         "xyz": [452260.6946, 3635877.6761, 5203453.4274],
...         "mark_num": "12367M002",
...         "plate": "EURA",
...         "rcv_type": "JPS LEGACY",
...         "ant_type": "JPSREGANT_SD_E1 NONE",
...         "ant_HEN": [0.0800, 0.0000, 0.0000],
...     },
... }
>>> bernese = Bernese52(list_stations)
apriopy_crd_for_atl(ref_system: str = 'IGS20') str

Generate coordinate records for creating an ATL file in Bernese 5.2.

The returned text can be inserted into a coordinate file when creating an ATL file in the Bernese 5.2 GUI. As an alternative, an existing EXAMPLE.CRD file may be used.

Parameters:

ref_system (str, optional) – Reference system name written to the header and station records. Defaults to “IGS20”.

Returns:

Multiline coordinate table with header, station names, marker numbers, XYZ coordinates, and the selected reference system.

Return type:

str

make_abb_info() str

Generate records for EXAMPLE.ABB.

Returns:

Multiline string containing station names, marker numbers, station abbreviations, and generated two-letter codes.

Return type:

str

Examples

>>> print(bernese.make_ABB_info())
BADG 12338M002           BADG     AA
NOVM 12367M002           NOVM     AB
make_bql_input() str

Generate station coordinates for the ocean loading service.

The returned text is formatted for direct insertion into: http://holt.oso.chalmers.se/loading/index-aside-2404271219.html

Returns:

Multiline string containing station names, marker numbers, and XYZ coordinates.

Return type:

str

Examples

>>> print(bernese.make_bql_input())
====== BQL ======
BADG 12338M002               -838281.874     3865775.981     4987625.182
NOVM 12367M002                452260.695     3635877.676     5203453.427
make_clu_info() str

Generate records for EXAMPLE.CLU.

Returns:

Multiline string containing station names, marker numbers, and the fixed cluster identifier 1.

Return type:

str

Examples

>>> print(bernese.make_clu_info())
BADG 12338M002      1
NOVM 12367M002      1
make_pld_info() str

Generate station plate data for insertion into EXAMPLE.PLD.

Returns:

Multiline string containing station index, station name, marker number, and tectonic plate code in PLD table format.

Return type:

str

Examples

>>> print(bernese.make_PLD_info())
====== PLD ======
1  BADG 12338M002                                              EURA
2  NOVM 12367M002                                              EURA
make_receiver_info(file_receiver: str)

Check receiver definitions in a RECEIVER. file.

If a receiver type from self.list_stations is missing in the input file, this method adds a formatted block that can be inserted into the RECEIVER. file.

Parameters:

file_receiver (str) – Path to the Bernese RECEIVER. file.

Returns:

Formatted text for missing receiver entries. Returns an empty string if all receiver types are already present.

Return type:

str

Examples

>>> print(bernese.make_receiver_info("/path/to/RECEIVER."))
U-BLOX ZED-F9P-01B-0   2     C1    L1:     1     GR
                             X2    L2:     1
make_sta_tab_001_info() str

Generate records for table 001 in EXAMPLE.STA.

Returns:

Multiline string containing station names, marker numbers, fixed table code 001, and wildcard station identifiers.

Return type:

str

Examples

>>> print(bernese.make_sta_tab_001_info())
BADG 12338M002        001                                            BADG*
NOVM 12367M002        001                                            NOVM*
make_sta_tab_002_info() str

Generate records for table 002 in EXAMPLE.STA.

Returns:

Multiline string containing station name, marker number, receiver type, antenna type, placeholder dates, and antenna offsets formatted for table 002.

Return type:

str

Examples

>>> print(bernese.make_sta_tab_002_info())
BADG 12338M002        001                                            JAVAD TRE_3 DELTA                           999999  JAVRINGANT_DM   JVDM                        999999    0.0000    0.0000    0.0280
NOVM 12367M002        001                                            JPS LEGACY                                  999999  JPSREGANT_SD_E1 NONE                        999999    0.0000    0.0000    0.0800
parse_rnx2snx_crd(input_path: str) DataFrame

Parse RNX2SNX coordinate output into a pandas DataFrame.

Parameters:

input_path (str) – Path to a single RNX2SNX output file or to a directory containing such files.

Raises:

FileNotFoundError – Raised if input_path does not exist.

Returns:

DataFrame with parsed coordinate records sorted by Date and ID.

Return type:

pd.DataFrame

Examples

>>> df = bernese.parse_RNX2SNX_CRD("/path/to/rnx2snx_output")
>>> df.head()
rename_rnx3_to_rnx2(input_path: str, service: str)

Rename product files from RINEX 3 naming to Bernese/RINEX 2 style.

The method accepts either a single file or a directory with files and renames supported product types (SP3, ION, CLK, ERP) according to GPS week and day. The renaming rules depend on the analysis center specified by service.

Parameters:
  • input_path (str) – Path to a file or directory containing product files to rename.

  • service (str) – Analysis center code used for special renaming rules. Supported values in the current implementation are “IGS” and “COD”.

Raises:

FileNotFoundError – Raised if input_path does not exist.

Examples

>>> bernese.rename_rnx3_to_rnx2("/path/to/products", "IGS")