libera_utils.packets.parse_packets_to_l1a_dataset#

libera_utils.packets.parse_packets_to_l1a_dataset(packet_files: list[PathLike | str], apid: int) Dataset#

Parse packets to L1A dataset with configurable sample expansion.

This function parses binary packet files and expands multi-sample fields according to the a configuration identified by APID. It creates proper xarray Datasets with time coordinates as dimensions.

Parameters:
  • packet_files (list[PathLike | str]) – List of filepaths to packet files.

  • apid (int) – The APID (Application Process Identifier) value for the packet type. Used to select the appropriate configuration for generating the L1A Dataset structure.

Returns:

xarray Dataset with: - Main packet data array with packet timestamp dimension - Separate arrays for each sample group with optional multi-field expansion - All time coordinates properly set as dimensions

Return type:

xr.Dataset