Ensure the GUI's open dialog box always shows a human readable date, even when using MJD values from a FITS header#586
Merged
Conversation
When auto-populating the date field in the GUI's Open dialog, auto convert any MJD (float) values to a human readable %Y-%m-%dT%H:%M:%S.%f format. As part of this, extract utc standardisation code from `BodyBase.__init__` to a new `BodyBase._standardise_utc_to_string` classmethod for ease of use elsewhere. #585
ortk95
marked this pull request as ready for review
July 22, 2026 12:44
Coverage Report for CI Build 29920886187Coverage remained the same at 99.61%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
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.
When opening a FITS file with the GUI's open dialog, the target, date and observer fields are auto-populated (if possible) using information from the FITS header. Previously, this meant that if the header contained dates in MJD format, the date field would show the date as a numeric value. This worked completely fine, but made it difficult to double check or understand the auto-populated value.
Therefore, this update will automatically convert auto-populated MJD values (e.g.
61043.93858073495to a human readable date (e.g.2026-01-03T22:31:33.375500), making it much easier for the user to understand what the value means.This has no functional effect, but just makes things easier to use.
This is implemented by re-using the same code that is used to convert a MJD to a SPICE-compatible date. The date standardisation code has been extracted from
BodyBase.__init__and now lives in the classmethodBodyBase._standardise_utc_to_string, where it can easily be re-used by other parts of the code as necesary. Extra unit tests have been added to ensure this conversion works as expected across different inputs, and provides a stable output.Closes #585
Pull request checklist
requirements.txtare reflected insetup.pyand conda-forge feedstockrun_ci.shor check GitHub Actions)See CONTRIBUTING.md for more details.