Contributor
Vishnunarayan K I

Transition to astropy time


Mentors
Punyaslok Pattnaik, Nabobalis
Organization
OpenAstronomy

SunPy uses python datetime module for handling almost all time related things. datetime is not the best choice for astronomy related projects due to a lot of reasons (for instance, it does not handle leap seconds). The answer is to use time module from astropy.

astropy.time.Time can do a lot things including:

  • Handle leap seconds
  • Easy conversion between format like iso, isot etc.
  • Easy conversion between scales like utc, tai etc.
  • Can be initialized from and converted to a lot of popular time formats and even supports python datetime.
  • Ability to create custom classes to support extra formats of time.

This makes astropy.time the best candidate to replace python datetime in SunPy.

This project will transition the whole of SunPy to use astropy.time instead of python datetime.