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 datetime objects, Julian Dates (float), and skyfield.timelib.Time objects.

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" → returns float Julian Date - "datetime" → returns datetime (UTC-aware) - "skyfield" → returns skyfield.timelib.Time - "iso" → returns ISO 8601 string

Returns:

Converted time in the requested format.

Raises:

ValueError – If to_format is invalid or value type unsupported.