libera_utils.l1a.packet_ordering#
Order of the L1A PACKET axis by SRC_SEQ_CTR, and its check against packet time.
SRC_SEQ_CTR is the packet sequence counter: it advances by one for each packet of an APID and
wraps from 16383 back to 0. The order the instrument built its packets in is the counter’s order once
its wraps are counted. Packet time is not an order: it can step backward while the counter advances.
It is used only to tell which wrap of the counter a packet falls in.
parse_packets_to_l1a_dataset() calls sort_by_sequence_counter() to put
each APID’s PACKET axis in counter order and drop packets received twice, then
check_packet_order() to warn where packet time steps backward along that order.
find_obsid_runs() calls out_of_order_positions() and refuses a
product whose axis is not in counter order.
The order is found by taking packets in packet-time order and reading each counter step modulo 16384, so a
packet whose time is slightly out of order still lands by its counter. Where the counter repeats or steps
backward between packets more than REORDER_WINDOW apart in packet time, the packets are cut into
segments, and segments are stacked in packet-time order, each starting at the smallest forward counter step
from the one before it. The user guide’s packet ordering page describes the rule and its limits.
Module Attributes
The counter reorders packets only within this window of packet time. |
Functions
|
Warn where packet time steps backward along the |
|
Return the |
|
Order the |