util.epoch_u
Utility functions for converting different epochs.
Attributes:
GMST_epoch
: [description]epoch2datetime
epoch2datetime(epoch_str: str) → datetime
Converts a fractional epoch string to a datetime object.
Args: epoch_str: fractional year epoch
Returns: equivalent datetime
epochEarlierThan
epochEarlierThan(epoch_a: str, epoch_b: str) → bool
Check if epoch A is earlier than epoch B.
Args:
epoch_a
: TLE epoch string Aepoch_b
: TLE epoch string BReturns: True if epoch A is earlier than epoch B
epochLaterThan
epochLaterThan(epoch_a: str, epoch_b: str) → bool
Check if epoch A is later than epoch B.
Args:
epoch_a
: TLE epoch string Aepoch_b
: TLE epoch string BReturns: True if epoch A is later than epoch B
datetime2TLEepoch
datetime2TLEepoch(date: datetime) → str
Converts a datetime to a TLE epoch string.
Args:
date
: Datetime objectReturns: TLE epoch string, with fractional seconds
datetime2sgp4epoch
datetime2sgp4epoch(date: datetime) → float
Converts a datetime to an sgp4 epoch.
Args:
date
: Datetime objectReturns: SGP4 epoch, with fractional seconds
findClosestDatetimeIndices
findClosestDatetimeIndices(
test_arr: ndarray[tuple[int], dtype[datetime64]],
source_arr: ndarray[tuple[int], dtype[datetime64]]
) → ndarray[tuple[int], dtype[int64]]
Find the index of the closest datetime in source arr for each datetime in test_arr.
Both search_arr and source_arr must be sorted.
Args:
test_arr
: Mx1 array of datetimes, will find closest time for each element in this arraysource_arr
: Nx1: array of datetimes to compare toReturns: Mx1 array of indices of source_arr
getStoredEpochs
getStoredEpochs(tle_path: Path) → None | tuple[datetime, datetime | None]
Return the start and end epoch for tle_path.
Args:
tle_path
: tle fileReturns: (first epoch datetime, last epoch datetime) None if no spacetrack tle stored for sat_id
This file was automatically generated via lazydocs.