Class Sp3Loader¶
Defined in File sp3_loader.h
Class Documentation¶
-
class Sp3Loader¶
Loader / interpolator for IGS SP3 precise-ephemeris files.
Satellites are identified by their SP3 identifiers, e.g.
"G01"(GPS PRN 1),"E11"(Galileo PRN 11),"C06"(BeiDou PRN 6),"J03"(QZSS PRN 3).Public Functions
-
Sp3Loader() = default¶
-
explicit Sp3Loader(const std::filesystem::path &filepath)¶
Construct and load a single SP3 file.
-
explicit Sp3Loader(const std::vector<std::filesystem::path> &filepaths)¶
Construct and load multiple SP3 files (e.g. consecutive days); samples are concatenated and sorted by epoch per satellite.
-
void LoadFile(const std::filesystem::path &filepath)¶
Parse an additional SP3 file and merge its samples in.
-
inline const std::vector<std::string> &GetSatellites() const¶
SP3 identifiers of all satellites with data loaded so far, e.g.
{"G01", "G02", ..., "E11", ...}.
-
bool HasSatellite(const std::string &sat_id) const¶
-
void GetPosVelClock(const std::string &sat_id, Real t_tai, Vec6 &rv_ecef, Real &clock_bias_s) const¶
Interpolated ECEF position [m] / velocity [m/s] (
rv_ecef, columns 0-2 / 3-5) and clock bias [s] (clock_bias_s, including the relativistic correction-2/c^2 * dot(r, v), mirroringSP3Loader.get_posvelclock) of satellitesat_idat epocht_tai(TAI seconds). Throws ifsat_idis unknown ort_taiis outside the loaded ephemeris span (no orbital-propagation fallback, unlike the Python reference — the precise-ephemeris window is expected to cover the requested epochs).
Public Static Functions
-
static std::string FilenameForEpoch(Real epoch, Time time_scale = Time::UTC)¶
Build the modern CDDIS/COD MGEX final SP3 filename for
epoch.- Parameters:
epoch – Epoch value in
time_scaleseconds.time_scale – Time scale of
epoch(UTC by default).
- Returns:
Filename such as
COD0MGXFIN_20250010000_01D_05M_ORB.SP3.
-
static std::string UrlForEpoch(Real epoch, Time time_scale = Time::UTC)¶
Build the CDDIS download URL for the SP3 product covering
epoch.This follows the same modern COD/MGEX final-product convention as the Python
SP3Loader. Pre-2017 legacy.Zproducts are intentionally not supported by the C++ helper.
-
static std::filesystem::path DownloadFileForEpoch(Real epoch, Time time_scale = Time::UTC, const std::filesystem::path &cache_dir = std::filesystem::path())¶
Download/cache the SP3 file covering
epoch, then return the uncompressed.SP3path.The default cache directory is
GetOutputDir("gnss_files") / "sp3", matching the Python loader. Downloads usecurl -L --netrc-optional, so credentials can be supplied with~/.netrc; ifEARTHDATA_USERNAMEandEARTHDATA_PASSWORDare set, they are also passed to curl. Throws if CDDIS returns an Earthdata Login HTML page.
-
Sp3Loader() = default¶