astra.time module¶
ASTRA Core time conversion utilities.
Provides a unified interface between Python datetime, Julian Dates,
skyfield Time objects, and ISO 8601 strings.
The Skyfield Timescale is the managed IERS-backed instance from
data_pipeline.get_skyfield_timescale(), not builtin=True.
- astra.time.prefetch_iers_data_async()[source]¶
Pre-fetch IERS / ephemeris data asynchronously (non-blocking).
- astra.time.convert_time(value, to_format)[source]¶
Universal time format converter.
Converts between ISO 8601 strings, Python
datetimeobjects, Julian Dates (float), andskyfield.timelib.Timeobjects.- Parameters:
value – The time value to convert. Accepted types: -
str— ISO 8601 format"YYYY-MM-DDTHH:MM:SSZ"-datetime— timezone-aware or naive (assumed UTC) -float— Julian Date (UTC)to_format – Target format. Must be one of: -
"jd"→ returnsfloatJulian Date -"datetime"→ returnsdatetime(UTC-aware) -"skyfield"→ returnsskyfield.timelib.Time-"iso"→ returns ISO 8601 string
- Returns:
Converted time in the requested format.
- Raises:
ValueError – If
to_formatis invalid orvaluetype unsupported.