11"""Parses Rinex .n files.
2- #TODO: Remove this description and move to the tutorials and description
3- #in the documentation
4- The Ephemeris Manager provides broadcast ephemeris for specific
5- satellites at a specific timestep. The EphemerisDownloader class should be
6- initialized and then the ``get_ephemeris`` function can be used to
7- retrieve ephemeris for specific satellites. ``get_ephemeris`` returns
8- the most recent broadcast ephemeris for the provided list of satellites
9- that was broadcast BEFORE the provided timestamp. For example GPS daily
10- ephemeris files contain data at a two hour frequency, so if the
11- timestamp provided is 5am, then ``get_ephemeris`` will return the 4am
12- data but not 6am. If provided a timestamp between midnight and 2am then
13- the ephemeris from around midnight (might be the day before) will be
14- provided. If no list of satellites is provided, then ``get_ephemeris``
15- will return data for all satellites.
16-
17- When multiple observations are provided for the same satellite and same
18- timestep, the Ephemeris Manager will only return the first instance.
19- This is applicable when requesting ephemeris for multi-GNSS for the
20- current day. Same-day multi GNSS data is pulled from same day. For
21- same-day multi-GNSS from https://igs.org/data/ which often has multiple
22- observations.
2+
3+ Loads rinex navigation files into a NavData object. Loading time can be
4+ sped up significantly by passing in the "satellites" parameter which in
5+ turn gets passed into the georinex library used to parse the rinex file.
6+
7+ Rinex files can be downloaded with the load_ephemeris function in the
8+ utils/ephemeris_downloader.py file.
239
2410"""
2511
2814__date__ = "13 July 2021"
2915
3016import os
31- from datetime import timezone
3217import warnings
18+ from datetime import timezone
3319
3420import numpy as np
3521import pandas as pd
4228
4329
4430class RinexNav (NavData ):
45- """Class to handle Rinex files containing SV parameters.
31+ """Class to parse Rinex navigation files containing SV parameters.
4632
47- The Ephemeris Manager provides broadcast ephemeris for specific
48- satellites at a specific timestep. The EphemerisDownloader class
49- should be initialized and then the ``get_ephemeris`` function
50- can be used to retrieve ephemeris for specific satellites.
51- ``get_ephemeris`` returns the most recent broadcast ephemeris
52- for the provided list of satellites that was broadcast BEFORE
53- the provided timestamp. For example GPS daily ephemeris files
54- contain data at a two hour frequency, so if the timestamp
55- provided is 5am, then ``get_ephemeris`` will return the 4am data
56- but not 6am. If provided a timestamp between midnight and 2am
57- then the ephemeris from around midnight (might be the day
58- before) will be provided. If no list of satellites is provided,
59- then ``get_ephemeris`` will return data for all satellites.
6033
61- When multiple observations are provided for the same satellite
62- and same timestep, the Ephemeris Manager will only return the
63- first instance. This is applicable when requesting ephemeris for
64- multi-GNSS for the current day. Same-day multi GNSS data is
65- pulled from same day. For same-day multi-GNSS from
66- https://igs.org/data/ which often has multiple observations.
34+ Loads rinex navigation files into a NavData object. Loading time can
35+ be sped up significantly by passing in the "satellites" parameter
36+ which in turn gets passed into the georinex library used to parse
37+ the rinex file.
6738
6839 Inherits from NavData().
6940
@@ -214,14 +185,16 @@ def _get_ephemeris_dataframe(self, rinex_path, constellations=None):
214185 ----------
215186 rinex_path : string or path-like
216187 Filepath to rinex file
217-
218- constellations : Set
188+ constellations : set
219189 Set of satellites {"ConstIDSVID"}
220190
221191 Returns
222192 -------
223193 data : pd.DataFrame
224194 Parsed ephemeris DataFrame
195+ data_header : dict
196+ Header information from Rinex file.
197+
225198 """
226199
227200 if constellations is not None :
@@ -258,7 +231,7 @@ def get_iono_params(self, rinex_header, constellations=None):
258231
259232 Parameters
260233 ----------
261- rinex_head : dict
234+ rinex_header : dict
262235 Dictionary containing RINEX file header information
263236 constellations : list
264237 List of strings indicating which constellations ionosphere
@@ -325,6 +298,15 @@ def get_iono_params(self, rinex_header, constellations=None):
325298
326299 @staticmethod
327300 def _iono_corr_key ():
301+ """Correlations between satellite name and iono param name.
302+
303+ Returns
304+ -------
305+ iono_corr_key : list
306+ String names for ionospheric correction parameters within
307+ the rinex navigation file.
308+
309+ """
328310 iono_corr_key = {}
329311 iono_corr_key ['gps' ] = ['GPSA' , 'GPSB' ]
330312 iono_corr_key ['galileo' ] = ['GAL' ]
@@ -339,7 +321,7 @@ def load_leapseconds(self, rinex_header):
339321 Parameters
340322 ----------
341323 rinex_header : dict
342- Header information from Rinex file
324+ Header information from Rinex file.
343325
344326 Returns
345327 -------
@@ -513,12 +495,14 @@ def get_time_cropped_rinex(gps_millis, satellites=None,
513495 List of satellite IDs as a string, for example ['G01','E11',
514496 'R06']. Defaults to None which returns get_ephemeris for
515497 all satellites.
498+ ephemeris_directory : string or path-like
499+ Directory where ephemeris files are downloaded if necessary.
516500 verbose : bool
517501 Prints extra debugging statements.
518502
519503 Returns
520504 -------
521- data : gnss_lib_py.parsers.navdata.NavData
505+ rinex_data : gnss_lib_py.parsers.navdata.NavData
522506 ephemeris entries corresponding to timestamp
523507
524508 Notes
0 commit comments