datetime_to_mjd_years

giant.catalogues.utilities:

giant.catalogues.utilities.datetime_to_mjd_years(date)[source]

This function converts a python datetime objects to the number of SI years since the MJD Epoch of November 17, 1858.

This is computed by computing the time delta between the MJD_EPOCH and the input datetime object, and then using timedelta_to_si_years() to convert to the fractional years since the epoch.

Parameters:

date (<module 'datetime' from '/Users/aliounis/mambaforge/envs/giant_public/lib/python3.11/datetime.py'>) – the python datetime object to be converted to MJD years

Returns:

the number of SI years since November 17, 1858

Return type:

float