ssapy_toolkit.Time_Functions.absolute_times_to_relative

Functions

time_abs_to_rel(times[, anchor])

Convert absolute timestamps into relative seconds, choosing which sample is 0.

ssapy_toolkit.Time_Functions.absolute_times_to_relative.time_abs_to_rel(times, anchor='start')[source]

Convert absolute timestamps into relative seconds, choosing which sample is 0.

Parameters:
  • times (array-like of astropy.time.Time, str, or float/int) – Sequence of absolute timestamps. - If Time: used directly. - If str: parsed by astropy as UTC strings. - If float/int: interpreted as GPS seconds.

  • anchor ({'start', 'end'}, default 'start') – Which sample is treated as t=0 in the output. - ‘start’: output[0] == 0 - ‘end’ : output[-1] == 0 (earlier values will be <= 0)

Returns:

1D float array of relative seconds.

Return type:

numpy.ndarray

Notes

  • Designed to mirror time_rel_to_abs(…, anchor=…).

  • With anchor=’end’, earlier samples become negative so that the last is 0.