Skip to content

Instantly share code, notes, and snippets.

@prateekiiest
Created March 25, 2018 05:18
Show Gist options
  • Save prateekiiest/25281428071374b5ba91baa465bffaa2 to your computer and use it in GitHub Desktop.
Save prateekiiest/25281428071374b5ba91baa465bffaa2 to your computer and use it in GitHub Desktop.
TimeDelta Enhancement
import astropy.Time as T
def parse_time(time_string, time_format='', **kwargs):
if time_format == 'utime' or isinstance(time_string, (int, float)):
return T.Time(T.Time('1979-01-01')) + T.TimeDelta(time_string, format = 'sec')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment