Fix mistake converting string date during leap second to jd1, jd2#51
Merged
Fix mistake converting string date during leap second to jd1, jd2#51
Conversation
Contributor
|
By "because all the Chandra date formats are UTC" do you mean everything except Chandra seconds or do you not consider that a date format or? |
Member
Author
I updated the description "because all the Chandra string-based date formats with fast converter support are UTC." |
jeanconn
approved these changes
Apr 14, 2025
Contributor
jeanconn
left a comment
There was a problem hiding this comment.
Looks good to me. I remain not an expert on leap second handling in erfa, but this fix also makes sense in that it repairs the symmetry with convert_string_to_jd2_jd2 (which explicitly uses dtf2d with UTC scale). I also explicitly confirmed that the new test fails in master as expected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The function
convert_string_to_jd1_jd2mistakenly used theTTscale for conversion. I do not understand where that came from, butUTCis the right answer because all the Chandra string-based date formats with fast converter support are UTC.This only impacts conversions for times within a leap second. The last leap second was 2016-12-31, so this issue has almost no impact, but still good to fix.
Interface impacts
Testing
Unit tests
Independent check of unit tests by Jean
Functional tests
New unit test.