libera_utils.packets.parse_packets_to_dataframe#

libera_utils.packets.parse_packets_to_dataframe(packet_definition: str | CloudPath | Path | XtcePacketDefinition, packet_data_filepaths: list[str | CloudPath | Path], apid: int | None = None, skip_header_bytes: int = 0) DataFrame#

Parse packets from files into a pandas DataFrame using Space Packet Parser v6.0.0rc3.

Parameters:
  • packet_definition (str | PathType | XtcePacketDefinition) – XTCE packet definition file path or pre-loaded XtcePacketDefinition object.

  • packet_data_filepaths (list[str | PathType]) – List of filepaths to packet files.

  • apid (Optional[int]) – Filter on APID so we don’t get mismatches in case the parser finds multiple parsable packet definitions in the files. This can happen if the XTCE document contains definitions for multiple packet types and >1 of those packet types is present in the packet data files.

  • skip_header_bytes (int) – Number of header bytes to skip when reading packet files. Default is 0.

Returns:

pandas DataFrame containing parsed packet data.

Return type:

pd.DataFrame