feat: add FFI-backed time scales and conversion traits for various ti…#3
Merged
feat: add FFI-backed time scales and conversion traits for various ti…#3
Conversation
…me representations
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.
This pull request significantly expands support for time scales in the
tempochlibrary, introducing new types for a variety of astronomical and atomic time standards. It implements generic infrastructure for time scale traits, conversion, and arithmetic, and adds user-friendly type aliases for these new scales. Additionally, it introduces a UT1-specific method for computing ΔT (difference between Terrestrial Time and Universal Time).The most important changes are:
New time scale types and aliases
scales.hpp, each with documentation and intended storage format.time.hppfor each new time scale, e.g.,using TT = Time<TTScale>,using TAI = Time<TAIScale>, etc., making these types easier to use throughout the codebase.Time scale traits and conversion infrastructure
JDBackedScaleTraitstemplate inscales.hppto handle arithmetic and civil time conversion for all JD-backed scales, reducing code duplication and standardizing behavior.TimeScaleTraitsfor each new scale, using the generic JD-backed helper, and provided human-readable labels for each.TimeConvertTraitsto support direct and indirect (via JD) conversions between all supported time scales, including identity conversions and explicit specializations for JD↔{TT, TAI, TDB, TCG, TCB, GPS, UT1, JDE, UnixTime}.UT1-specific functionality
delta_t()method toTime<UTScale>(Universal Time), which computes ΔT (TT - UT1) in seconds, enabled only for UT1 time points.Submodule update
tempochsubmodule to the latest commit.