.. _program_listing_file_interfaces_sp3_loader.h: Program Listing for File sp3_loader.h ===================================== |exhale_lsh| :ref:`Return to documentation for file ` (``interfaces/sp3_loader.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include #include #include #include #include "lupnt/core/constants.h" #include "lupnt/core/definitions.h" #include "lupnt/numerics/cheby_fit.h" namespace lupnt { class Sp3Loader { public: Sp3Loader() = default; explicit Sp3Loader(const std::filesystem::path& filepath); explicit Sp3Loader(const std::vector& filepaths); void LoadFile(const std::filesystem::path& filepath); static std::string FilenameForEpoch(Real epoch, Time time_scale = Time::UTC); static std::string UrlForEpoch(Real epoch, Time time_scale = Time::UTC); static std::filesystem::path DownloadFileForEpoch(Real epoch, Time time_scale = Time::UTC, const std::filesystem::path& cache_dir = std::filesystem::path()); const std::vector& GetSatellites() const { return sats_; } 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; Vec6 GetPosVel(const std::string& sat_id, Real t_tai) const; std::pair GetTimeSpan(const std::string& sat_id) const; private: std::vector sats_; // SP3 identifiers, e.g. "G01" std::map epochs_tai_; // sat -> [N] epochs (TAI seconds, sorted) std::map pos_clock_; // sat -> [N x 4] ECEF (x,y,z) [m], clock [s] std::map pos_clock_cheby_; // sat -> [x,y,z,clock] fit void ParseFile(const std::filesystem::path& filepath); void RebuildChebyshevModels(); }; } // namespace lupnt