A Python class that allows for convenient conversion between different date and time formats/units
A Python class that allows for convenient conversion between different date and time formats and units.
The library supports both general-purpose Earth-based time units (such as Python's
datetime type, Day-of-year or
POSIX time) as well as time units useful for working with data from the Mars Science Laboratory and Chang'e 4 space
missions. It can be easily extended to support additional units.
pip3 install time_converter
Yes, it's that simple.
from time_converter import Time Time(2019.5, 'decimalyear').to('dt') # > datetime.datetime(2019, 7, 2, 12, 0)
you can also supply list-like objects as input, the output will be a
Time([2018.0, 2018.1], 'decimalyear').to('dt') # > array([datetime.datetime(2019, 1, 1, 0, 0), # datetime.datetime(2019, 2, 6, 11, 59, 59, 999997)], dtype=object)
Earth-based time units
|Python datetime (UTC)||
|DoY Tuple (year, day of year)||
Mars Science Laboratory
The MSL spacecraft clock (
sclk) measures the number of seconds since January 1 2000, 11:58:55.816 UTC. However, due to
drifting of the clock, some corrections need to be applied based on
files supplied by NASA,
which this tool uses to do the conversion between
sclk and other units.
|MSL mission sol||
|MSL spacecraft clock||
For Chang'E 4, the conversion of spacecraft clock time to datetime has already implemented, so it does not need to be included in time_converter. But we have implemented a converter for the lunar day number and local solar time at Chang'E 4's landing site:
|Local solar time at Chang'E 4||
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size time_converter-1.2.3.tar.gz (330.4 kB)||File type Source||Python version None||Upload date||Hashes View hashes|