libera_utils.l1a.packet_ordering.REORDER_WINDOW#
- libera_utils.l1a.packet_ordering.REORDER_WINDOW = np.timedelta64(10,'s')#
The counter reorders packets only within this window of packet time. Taking packets in packet-time order, a counter step that repeats or goes backward between packets more than this apart cuts them into segments placed by packet time: the counter restarted, more than 8,191 packets were lost, or a packet clock is wrong, and the counter alone cannot tell these apart. A forward step is read as forward across a gap of any length.
A change to the window must keep both of these limits:
Lower: it must exceed the largest backward packet-time step between neighbors in counter order, or those packets are placed by packet time instead of by counter. In the second Day-in-the-Life ground test (DITL2) that step is at most 1.99 s across the 33 WFOV SCI files and 3.7 ms across NOM-HK.
Upper: a counter restart that resumes within the window is placed by its counter, ahead of the packets built before it, so a longer window misorders more restarts. Losing 8,192 or more packets within the window reads as a backward step and is placed by counter, so an APID must send fewer than 8,192 packets in it: about 819 packets/s at 10 s, against ~85 packets/s for WFOV SCI (APID 1040) in DITL2.