New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DM-7587: Time scale fixes #12
Conversation
@@ -63,15 +63,15 @@ class DateTime { | |||
explicit DateTime(double date, DateSystem system = MJD, Timescale scale = TAI); | |||
DateTime(int year, int month, int day, int hr, int min, int sec, | |||
Timescale scale = TAI); | |||
explicit DateTime(std::string const& iso8601); | |||
explicit DateTime(std::string const& iso8601, Timescale scale); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No default? Does the name iso8601 still make sense for all possible values of Timescale?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http://dotat.at/tmp/ISO_8601-2004_E.pdf does mention TAI is fine in this format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only choices DateTime supports are TAI, TT and UTC. TT is just an offset from TAI. So I think it makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@timj While the document mentions TAI as a possible timescale, it's a little wishy-washy about how it should be represented. Note that 4.2.1 mentions non-UTC timescales but no particular representation, and none of the subsequent subsections that do give representations seem appropriate for a TAI time that is not a local time nor a "UTC of day".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It's a bit loose. http://docs.astropy.org/en/v1.2.1/time/index.html has some examples and I remember getting very confused when plugging astropy.time
in as a backend for DateTime
.
Add a scale argument to DateTime's ISO string constructor and toString method. It has no default, so existing code must be retrofitted.
The constant TT_MINUS_TAI_NSECS was being approximated by a double instead of using a long long, resulting small errors.
1d4d179
to
5d86e5d
Compare
No description provided.