OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
LeapSecondDatabase.hpp
Go to the documentation of this file.
1 #ifndef FOCS_LEAPSECONDDATABASE
2 #define FOCS_LEAPSECONDDATABASE
3 
4 // #include <chrono>
5 // #include <functional>
6 // #include <iterator>
7 #include <string>
8 // #include <tuple>
9 // #include <unordered_map>
10 #include <vector>
11 
12 #include <boost/date_time/posix_time/posix_time.hpp>
13 
14 namespace focs {
20  class LeapSecond {
21  public:
31  LeapSecond(unsigned short year, unsigned short month, unsigned short day, float leap_seconds_) : time{boost::gregorian::date{year, month, day}}, leap_seconds{leap_seconds_}{}
32  boost::posix_time::ptime time;
33  float leap_seconds;
34  };
44  public:
57  explicit LeapSecondDatabase(const std::string& file){load_file(file);}
61  inline static LeapSecondDatabase& get_default(){
62  static LeapSecondDatabase _instance{};
63  return _instance;
64  }
65 
73  float leap_seconds_since(const boost::posix_time::ptime& time);
74 
82  bool is_leap_second(const boost::posix_time::ptime& time);
83  private:
84  std::string path_;
85  std::vector<LeapSecond> leap_seconds_{};
86 
87  void load_file(const std::string& file);
88  };
89 
90 } // namespace focs
91 
92 #endif // FOCS_LEAPSECONDDATABASE
93 
boost::posix_time::ptime time
Instance in time of leap second addition.
int32_t day
float leap_seconds_since(const boost::posix_time::ptime &time)
Look up how many leap seconds are in effect on a given date.
static LeapSecondDatabase & get_default()
Obtain a singleton of a default database.
@ string
float leap_seconds
New count of leap seconds.
Class representing the instant in time a leap second was/will be added.
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude resolving resolving GSFcd00179 Corrected handling of fill values for[Sensor|Solar][Zenith|Azimuth] resolving MODxl01751 Changed to validate LUT version against a value retrieved from the resolving MODxl02056 Changed to calculate Solar Diffuser angles without adjustment for estimated post launch changes in the MODIS orientation relative to incidentally resolving defects MODxl01766 Also resolves MODxl01947 Changed to ignore fill values in SCI_ABNORM and SCI_STATE rather than treating them as resolving MODxl01780 Changed to use spacecraft ancillary data to recognise when the mirror encoder data is being set by side A or side B and to change calculations accordingly This removes the need for seperate LUTs for Side A and Side B data it makes the new LUTs incompatible with older versions of the and vice versa Also resolves MODxl01685 A more robust GRing algorithm is being which will create a non default GRing anytime there s even a single geolocated pixel in a granule Removed obsolete messages from seed file
Definition: HISTORY.txt:413
LeapSecondDatabase(const std::string &file)
Read the database at the given location.
Reader of leap second databases.
bool is_leap_second(const boost::posix_time::ptime &time)
Check if a given time is a leap second.
LeapSecond(unsigned short year, unsigned short month, unsigned short day, float leap_seconds_)
Construct a with a date and the number of leap seconds in effect starting at the input date.
this program makes no use of any feature of the SDP Toolkit that could generate such a then geolocation is calculated at that and then aggregated up to Resolved feature request Bug by adding three new int8 SDSs for each high resolution offsets between the high resolution geolocation and a bi linear interpolation extrapolation of the positions This can be used to reconstruct the high resolution geolocation Resolved Bug by delaying cumulation of gflags until after validation of derived products Resolved Bug by setting Latitude and Longitude to the correct fill resolving to support Near Real Time because they may be unnecessary if use of entrained ephemeris and attitude data is turned resolving bug report Corrected to filter out Aqua attitude records with missing status helping resolve bug MOD_PR03 will still correctly write scan and pixel data that does not depend upon the start time
Definition: HISTORY.txt:248
LeapSecondDatabase()
Default constructor, using default locations for database file.