Rinex navigation files are pulled from one of five sources. More about
rinex files can be found in the CDDIS documentation [1].
If rinex for the current day is requested or if rinex for the
previous is requested and it is too early in the UTC day for
yesterday’s combined rinex file to be uploaded, then the
BRDC00WRD_S rinex 3 file is downloaded from IGS and includes:
GPS+GLO+GAL+BDS+QZSS+SBAS.
If only GPS is requested, then the brdc<dddd>.<yy>n rinex 2 file is
downloaded from CDDIS and includes: GPS.
If only Glonass is requested, then the brdc<dddd>.<yy>g rinex 2 file
is downloaded from CDDIS and includes: GLO.
If the request is for multi-gnss and for a date before Nov. 25, 2019,
but after Jan 1, 2013 (the start of multi-gnss) then the BRDM00DLR_R
rinex 3 file is downloaded from CDDIS. If multi-gnss is requested
for Nov. 25, 2019 or later, then the BRDM00DLR_S rinex 3 file is
downloaded from CDDIS. These multi-gnss files include:
GPS+GLO+GAL+BDS+QZSS+IRNSS+SBAS. For more information on multi-gnss
combined rinex navigation files, see MGEX documentation [2].
SP3 and CLK files are obtained from CDDIS and produced by either the
Center for Orbit Determination in Europe (CODE), GeoForschungsZentrum
Potsdam (GFZ) or Wuhan University. Products are available through the
MGEX data program [4]. Details on the MGEX precise orbit and clock
products can be found on the IGS website [4].
If the SP3 or CLK date requested is within the three days, then the
rapid solution from CODE is downloaded (COD0OPSRAP). The CODE rapid
solution includes: GPS+GLO+GAL.
If the SP3 or CLK date requested is within the last two weeks, then the
rapid solution from GFZ is downloaded (GFZ0MGXRAP). The GFZ rapid
solution became available starting GPS week 2038 or Jan 27, 2019. The
GFZ rapid solution includes: GPS+GLO+GAL+BDS+QZS. More about the GFZ
solution can be found on their MGEX website [8].
If the SP3 date requested is more than two weeks previous to the
current date and GPS week 1962 or later, then the CODE final solution
is downloaded (COD0MGXFIN). The CODE final SP3 solutions became
available starting GPS week 1962 or Aug 13, 2017. The CODE final
solution includes: GPS+GLO+GAL+BDS+QZS. More about the CODE solution can
be found in their papers [6][7].
If the SP3 date requested is between GPS week 1690 and 1961 or between
May 25, 2012 and Aug 12, 2017, then the CODE ‘com’ short name solution
is downloaded. More about the CODE ‘com’ solution can be found in their
papers [9][10].
If the CLK date requested is more than two weeks previous to the
current date and GPS week 2113 or later, then the CODE final solution
is downloaded (COD0MGXFIN). The CODE final CLK solutions became
available starting GPS week 2113 or July 5th, 2020. The CODE final
solution includes: GPS+GLO+GAL+BDS+QZS. More about the CODE solution can
be found in their papers [6][7].
If the CLK date requested is between GPS week 2034 and 2112 or between
Jan 1, 2019 and July 4th, 2020, then the Wuhan University final
solution is downloaded (WUM0MGXFIN). More about the WUM0MGXFIN solution
can be found in their documention [11].
If the CLK date requested is week GPS week 2034 and between Dec 30, 2018
and Dec 31, 2018, then the GFZ short name solution is downloaded (gbm).
More about the GFZ ‘gbm’ solution can be found in their
documentation [13][14].
If the CLK date requested is between GPS week 1962 and 2033 or between
Aug 13, 2017 and Dec 29th, 2018 then the Wuhan University short name
solution is downloaded (wum). More about the “wum” solution can be found
in their paper [12].
If the CLK date requested is between GPS week 1710 and 1961 or between
Oct 14, 2012 and Aug 12, 2017, then the CODE ‘com’ short name solution
is downloaded. More about the CODE ‘com’ solution can be found in their
papers [9][10].
Copyright (c) 2021, Mitchell D Johnson
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Figure out which dates ephemeris is needed for from datetimes.
Rinex files are only guaranteed to have data for between 02:00 and
22:00. If the timestamp is bewteen 00:00 and 02:00, the previous day
will also be included. If after 22:00, the next day will also be
included.
To appropriately compute fit satellite position and clock esimates,
sp3 and clk files are also pulled for the previous or next day if
the timestamps are close to the start or end of the day.
Parameters:
file_type (string) – File type to download either “rinex_nav”, “sp3”, or “clk”.
dt_timestamps (np.ndarray) – Datetime timestamps.
Returns:
needed_dates – List of datetime.date objects of the days in UTC for which
ephemeris needs to be retrieved in order sorted by date.
Check whether a valid ephemeris already exists in file_paths.
See file header for detailed documentation on the methodology on
the sources used to downloaded files.
Parameters:
date (datetime.date) – Days in UTC for which ephemeris needs to be retrieved.
possible_types (list) – What file types would fulfill the requirement in preference
order.
file_paths (string or path-like) – Paths to existing ephemeris files if they exist.
Returns:
valid (bool) – Whether or not a valid ephemeris already exists. If true, then
the correct ephemeris file already exists in file_paths.
If false, a new file will be downloaded unless file already
exists in the download directory.
recommended_file (string) – Path to existing file if valid is True, otherwise a tuple
containing the url and filepath to the file that should be
downloaded.
Verify which ephemeris to download if not in file_paths.
Parameters:
file_type (string) – File type to download either “rinex_nav”, “sp3”, or “clk”.
gps_millis (float or np.ndarray of floats) – GPS milliseconds for which downloaded ephemeris should be
obtained.
constellations (list, set, or array-like) – Constellations for which to download ephemeris, i.e. [“gps”].
file_paths (list, string or path-like) – Paths to existing ephemeris files if they exist.
download_directory (string or path-like) – Directory where ephemeris files are downloaded if necessary.
verbose (bool) – Prints extra debugging statements if true.
Returns:
file_paths – Paths to downloaded and/or existing ephemeris files. Only files
that need to be used are returned. Superfluous path inputs that
are not needed are not returned