libera_utils.l1a.packet_ordering.out_of_order_positions#

libera_utils.l1a.packet_ordering.out_of_order_positions(packet_ds: Dataset, packet_time_coordinate: str) → ndarray#

Return the PACKET positions i where SRC_SEQ_CTR repeats or steps backward from i to i + 1.

Only steps whose packet times are within REORDER_WINDOW of each other count, since further apart the counter may have restarted. An axis in SRC_SEQ_CTR order, as parse_packets_to_l1a_dataset writes it, has none.

Parameters:
  • packet_ds (xr.Dataset) – Dataset with SRC_SEQ_CTR and packet_time_coordinate on its PACKET axis.

  • packet_time_coordinate (str) – Name of the packet time variable.

Returns:

The positions i, in ascending order; empty when the axis is in SRC_SEQ_CTR order.

Return type:

np.ndarray

Raises:

ValueError – If packet_ds has no SRC_SEQ_CTR or no packet_time_coordinate variable.