datetime_to_et¶
giant.utilities.spice_interface
:
- giant.utilities.spice_interface.datetime_to_et(date)[source]¶
This function converts a python datetime object to ephemeris time correcting for leap seconds
If you have spiceypy installed in your python distribution then this is essentially just a wrapper around the str2et function from spice. If you don’t have spiceypy installed then this emulates str2et in python code with a hardcoded version of the tls kernel in this module. If the tls kernel is changed and you are not using spiceypy then this module needs to be updated!
- Parameters:
date (datetime | datetime64 | DatetimeIndex) – The datetime instance to be converted
- Returns:
The ephemeris time corresponding to observation_date for use in the spice system
- Return type:
float