curryer.spicetime.native ======================== .. py:module:: curryer.spicetime.native .. autoapi-nested-parse:: Native (fast) time conversions. @author: Brandon Stone Attributes ---------- .. autoapisummary:: curryer.spicetime.native.logger Functions --------- .. autoapisummary:: curryer.spicetime.native.ugps2datetime curryer.spicetime.native.datetime2ugps curryer.spicetime.native.ugps_to_gps_fraction curryer.spicetime.native.gps_fraction_to_ugps curryer.spicetime.native.gps_fraction_to_epoch_fraction curryer.spicetime.native.epoch_fraction_to_gps_fraction Module Contents --------------- .. py:data:: logger .. py:function:: ugps2datetime(times, ceil_leapseconds=True) Convert GPS microseconds to datetime64[us]. Fast conversion; very convenient for plotting. :param times: One or more uGPS times to convert. :type times: int or list[int] or numpy.ndarray or pandas.Series :param ceil_leapseconds: Ceil times within a leapsecond. Datetime64 does not support times within leapseconds. Default=True, otherwise throws a ValueError if encountered. :type ceil_leapseconds: bool, optional :returns: Converted times - output is a scalar if the input was, otherwise it's an array. :rtype: numpy.datetime64 or numpy.ndarray .. py:function:: datetime2ugps(times) Convert datetime64[us] to GPS microseconds. :param times: Scalar or array of datetime64 values with microsecond precision. :type times: numpy.datetime64 or numpy.ndarray :returns: Converted uGPS times - output is a scalar if the input was, otherwise it's an array. :rtype: int or numpy.ndarray .. py:function:: ugps_to_gps_fraction(times) Convert uGPS to GPS fractional days. .. py:function:: gps_fraction_to_ugps(times) Convert GPS fractional days to uGPS. .. py:function:: gps_fraction_to_epoch_fraction(times, to_epoch) Convert GPS fractional days to a different epoch. .. py:function:: epoch_fraction_to_gps_fraction(times, from_epoch) Convert epoch fractional days to the GPS epoch.