Commit e012343249d4942a2cec2ebe5103d1c6f0808e44

Authored by Jürgen Knödlseder
1 parent c48c64ae

Add leap second for 1 January 2017 (#1887)

ChangeLog
1   -2016-11-22
  1 +2016-12-01
2 2  
3 3 * Version 1.2.0 released
4 4 =========================
5 5  
  6 + Add leap second for 1-1-2017 (#1887)
6 7 Add region() method to GModelSpatial (#1764)
7 8 Add composite spatial and spectral models (#1706)
8 9 Add GObservations::save_covmat() method (#1863)
... ...
1 1 New Features and Important Changes in GammaLib 1.2.0
2 2  
3   -22 November 2016
  3 +1 December 2016
4 4  
5 5  
6 6 1. Introduction
... ... @@ -195,6 +195,9 @@ been added to the GTime class that sets the time to the current time (see
195 195 The GObservations::save_covmat() method computes and saves the covariance
196 196 matrix into a FITS file (#1863).
197 197  
  198 +A leap second has been added to GTime::leap_seconds() for 1 January 2017
  199 +(#1887).
  200 +
198 201  
199 202 11. Optimization module
200 203 -----------------------
... ...
src/obs/GTime.cpp
... ... @@ -1046,7 +1046,7 @@ void GTime::free_members(void)
1046 1046 *
1047 1047 * Return the number of leap seconds for a given MJD specified in the UTC
1048 1048 * time system. This method returns valid number of leap seconds for the
1049   - * years 1972-2015.
  1049 + * years 1972-2017.
1050 1050 *
1051 1051 * See http://www.nist.gov/pml/div688/grp50/leapsecond.cfm for a table of
1052 1052 * leap seconds.
... ... @@ -1082,18 +1082,18 @@ double GTime::leap_seconds(const double& mjd) const
1082 1082 53735, // 2005-12-31
1083 1083 54831, // 2008-12-31
1084 1084 56108, // 2012-06-30
1085   - 57204}; // 2015-07-01
  1085 + 57204, // 2015-07-01
  1086 + 57754}; // 2017-01-01
1086 1087 const double leapsecs[] = {10.0, 11.0, 12.0, 13.0, 14.0,
1087 1088 15.0, 16.0, 17.0, 18.0, 19.0,
1088 1089 20.0, 21.0, 22.0, 23.0, 24.0,
1089 1090 25.0, 26.0, 27.0, 28.0, 29.0,
1090 1091 30.0, 31.0, 32.0, 33.0, 34.0,
1091   - 35.0, 36.0};
  1092 + 35.0, 36.0, 37.0};
1092 1093 const int n_leapsecs = sizeof(leapsmjd)/sizeof(long);
1093 1094  
1094 1095 // Extract MJD day and MJD fraction
1095   - long day = (long)mjd;
1096   - //double fraction = mjd - (double)day;
  1096 + long day = (long)mjd;
1097 1097  
1098 1098 // Find the leap second MJD that is equal or larger to the specified
1099 1099 // day
... ...