libera_utils.l1a.nom_hk_trim.find_obsid_runs#
- libera_utils.l1a.nom_hk_trim.find_obsid_runs(nom_hk: Dataset, *, source: NomHkObsidSource | None = None) list[tuple[ObsIdSpec, slice]]#
Detect contiguous trim-eligible ObsID runs in a NOM-HK Dataset.
- Parameters:
nom_hk (xr.Dataset) – Decoded NOM-HK Dataset with a
PACKETdimension.source (NomHkObsidSource or None) – If set, only scan that ObsID field; otherwise scan all trim-eligible sources.
- Returns:
Ordered list of runs. Each slice indexes
PACKET.- Return type:
- Raises:
ValueError – If
nom_hkhas noPACKETdimension, or noPACKET_ICIE_TIMEorSRC_SEQ_CTRvariable, or ifSRC_SEQ_CTRrepeats or steps backward between packets whose packet times are withinpacket_ordering.REORDER_WINDOW(10 s).
Notes
Run slices are positions on the
PACKETaxis, so they are contiguous acquisition only when the axis is inSRC_SEQ_CTRorder, asparse_packets_to_l1a_datasetwrites it. This raises when it is not.