Source code for ecpi.common.mission.time

'''
Created on 6 February 2019

@author: Catalano Camille, APC/IN2P3/CNRS
'''


[docs]def get_mjd_ref(): """return the mjd reference for the SVOM mission :return: mjd reference in mjd :rtype: float """ return 57754.0
[docs]def convert_mjd_in_svomref_seconds(time_mjd): """ convert a time in mjd in a time in seconds from the mjd reference :param time_mjd: time in mjd :type time_mjd: float :return: time in seconds :rtype: float """ return (time_mjd - get_mjd_ref())*24*3600
[docs]def convert_mjd_in_svomref_seconds_ref(time_mjd, time_mjd_ref): """ convert a time in mjd in a time in seconds from the mjd reference :param time_mjd: time in mjd :type time_mjd: float :param time_mjd_ref: time in mjd :type time_mjd_ref: float :return: time in seconds :rtype: float """ return (time_mjd - time_mjd_ref)*24*3600
[docs]def convert_svomref_seconds_in_mjd(time_s): """ convert a time in seconds from the mjd reference in a time in mjd :param time_s: time in s from mjdref :type time_s: float :return: time in mjd :rtype: float """ return time_s/24./3600. + get_mjd_ref()