opticam_new.utils.time_helpers ============================== .. py:module:: opticam_new.utils.time_helpers Functions --------- .. autoapisummary:: opticam_new.utils.time_helpers.apply_barycentric_correction opticam_new.utils.time_helpers.get_time opticam_new.utils.time_helpers.infer_gtis Module Contents --------------- .. py:function:: apply_barycentric_correction(original_times, coords) Apply barycentric corrections to a time array. Parameters ---------- times : float | NDArray The time(s) to correct. coords : SkyCoord The coordinates of the source. Returns ------- float | NDArray The corrected time(s). .. py:function:: get_time(header, file) Parse the time from the header of a FITS file. Parameters ---------- header The FITS file header. file : str The path to the file. Returns ------- float The time of the observation in MJD. Raises ------ ValueError If the time cannot be parsed from the header. KeyError If neither 'GPSTIME' nor 'UT' keys are found in the header. .. py:function:: infer_gtis(time, threshold = 1.5) Infer GTIs from a light curve. Parameters ---------- time : ArrayLike The time array. threshold : float, optional The threshold for detecting gaps in units of the median time resolution, by default 1.5. Returns ------- List[Tuple[float, float]] The inferred GTIs.