curryer.spicetime.native

Native (fast) time conversions.

@author: Brandon Stone

Attributes

Functions

ugps2datetime(times[, ceil_leapseconds])

Convert GPS microseconds to datetime64[us].

datetime2ugps(times)

Convert datetime64[us] to GPS microseconds.

ugps_to_gps_fraction(times)

Convert uGPS to GPS fractional days.

gps_fraction_to_ugps(times)

Convert GPS fractional days to uGPS.

gps_fraction_to_epoch_fraction(times, to_epoch)

Convert GPS fractional days to a different epoch.

epoch_fraction_to_gps_fraction(times, from_epoch)

Convert epoch fractional days to the GPS epoch.

Module Contents

curryer.spicetime.native.logger
curryer.spicetime.native.ugps2datetime(times, ceil_leapseconds=True)

Convert GPS microseconds to datetime64[us].

Fast conversion; very convenient for plotting.

Parameters:
  • times (int or list[int] or numpy.ndarray or pandas.Series) – One or more uGPS times to convert.

  • ceil_leapseconds (bool, optional) – Ceil times within a leapsecond. Datetime64 does not support times within leapseconds. Default=True, otherwise throws a ValueError if encountered.

Returns:

Converted times - output is a scalar if the input was, otherwise it’s an array.

Return type:

numpy.datetime64 or numpy.ndarray

curryer.spicetime.native.datetime2ugps(times)

Convert datetime64[us] to GPS microseconds.

Parameters:

times (numpy.datetime64 or numpy.ndarray) – Scalar or array of datetime64 values with microsecond precision.

Returns:

Converted uGPS times - output is a scalar if the input was, otherwise it’s an array.

Return type:

int or numpy.ndarray

curryer.spicetime.native.ugps_to_gps_fraction(times)

Convert uGPS to GPS fractional days.

curryer.spicetime.native.gps_fraction_to_ugps(times)

Convert GPS fractional days to uGPS.

curryer.spicetime.native.gps_fraction_to_epoch_fraction(times, to_epoch)

Convert GPS fractional days to a different epoch.

curryer.spicetime.native.epoch_fraction_to_gps_fraction(times, from_epoch)

Convert epoch fractional days to the GPS epoch.