seisglitch time

The time function allows you to convert times both ways between UTC (earth time) and InSight’s local mean solar time (LMST). Note that InSight landed on Mars on November 26, 2018 (Sol 0, a sol is a Martian day with around 24h 40m).

The time formats should follow:

UTC: 2019-05-23T02:23:16
LMST: 173M02:58:53 (where 173 is Sol 173 with respect to the InSight landing)

In the config.yml you have two options. If you want to convert many times you can pass a text file, or if you want to convert one time only you can simply pass it with the result immediately printed. You can also access the time conversion tool from within the Python interpreter:

from seisglitch.util import marstime

time_instance = marstime(UTC='2019-05-23T02:23:16') # pass a string or time object
LMST_string   = time_instance.LMST_string           # returns string
print(LMST_string)

or similarly to convert LMST to UTC:

from seisglitch.util import marstime

time_instance = marstime(LMST='173M02:58:53')       # pass a string
UTC_string    = time_instance.UTC_string            # returns string
UTC_time      = time_instance.UTC_time              # returns UTCDateTime object
print(UTC_time)