imap_processing.spice.time.epoch_to_fractional_doy#

imap_processing.spice.time.epoch_to_fractional_doy(epoch: int | Iterable[int]) float | ndarray#

Convert epoch in TTJ2000ns to floating point day-of-year.

Uses SPICE’s timout function to directly extract day of year and # codespell:ignore time components, avoiding intermediate datetime parsing.

Parameters:

epoch (int or Iterable[int]) – Epoch in TTJ2000ns format (nanoseconds since J2000). Can be a single integer or an iterable of integers.

Returns:

doy – Floating point day of year (1.0 = Jan 1 00:00:00). Returns a scalar when epoch is a single integer, or a NumPy array when epoch is an iterable.

Return type:

float or numpy.ndarray

References

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/timout_c.html