Expand description
Time scales: Julian dates, FITS DATE-OBS strings, Julian epochs, and
sidereal time.
Provenance: parse_date_obs / format_date_obs are extracted from
fits-header (src/dates.rs); the MJD/JD conversions and gmst /
lst are written fresh, validated against Meeus, Astronomical
Algorithms 2nd ed. (chapters 7 and 12).
GMST uses the IAU-1982 polynomial (Meeus eq. 12.4) on the UT1 ≈ UTC
assumption: |ΔUT1| < 0.9 s of time ≈ 13.5″ of hour angle, inside the
crate’s planning-grade contract. Functions taking OffsetDateTime
convert to UTC internally, so passing local civil time cannot skew
sidereal results. JD/MJD are carried as f64 — microsecond-level
resolution in the current era.
Functions§
- datetime_
to_ mjd - Modified Julian Date of a timezone-naive instant (taken as UTC). Inverse
of
mjd_to_datetime. - format_
date_ obs - Format a date/time back to the FITS civil form
(
YYYY-MM-DDThh:mm:ss[.fff]), dropping a zero sub-second part. Inverse ofparse_date_obs. - gmst
- Greenwich Mean Sidereal Time, normalized to
[0h, 24h). Feedslstat an observer’s longitude. - jd_
to_ mjd - Convert a Julian Date to a Modified Julian Date. Inverse of
mjd_to_jd. - julian_
date - Julian Date of an instant; the offset is folded in (UTC internally).
- julian_
epoch_ of - The Julian epoch of an instant, e.g.
Epoch::OfDate(2026.52…)for mid-July 2026. Feedsprecesswhen moving anEquatorialposition to “tonight”. - lst
- Local Sidereal Time at an east-positive longitude, normalized to
[0h, 24h).lst(at, lon) == gmst(at) + lon(wrapped). - mjd_
to_ datetime - Timezone-naive UTC instant of a Modified Julian Date. Inverse of
datetime_to_mjd. - mjd_
to_ jd - Convert a Modified Julian Date to a Julian Date. Inverse of
jd_to_mjd. - parse_
date_ obs - Parse a FITS civil date/time (
YYYY-MM-DD[Thh:mm:ss[.fff]]), timezone-naive; a date-only value means midnight. Quoted card values and surrounding whitespace are tolerated. FITS strings carry no offset — bridge toOffsetDateTimewithparse_date_obs(s)?.assume_utc(). Inverse offormat_date_obs.