chaosmagpy.data_utils.dyear_to_mjd¶
- chaosmagpy.data_utils.dyear_to_mjd(time, leap_year=None)[source]¶
Convert time from decimal years to modified Julian date 2000.
Leap years are accounted for by default.
- Parameters:
- timefloat, ndarray, shape (…)
Time in decimal years.
- leap_year{True, False}, optional
Take leap years into account by using a conversion factor of 365 or 366 days in a year (leap year, used by default). If
False
a conversion factor of 365.25 days in a year is used.
- Returns:
- timendarray, shape (…)
Time in modified Julian date 2000.
Examples
>>> dyear_to_mjd([2000.5, 2001.5]) # account for leap years array([183. , 548.5])
>>> dyear_to_mjd([2000.5, 2001.5], leap_year=False) array([182.625, 547.875])