libera_utils.packets.array_from_packets#

libera_utils.packets.array_from_packets(packets: list, apid: int = None)#

Create an array from a list of packets. This function assumes that the fields and format for every packet is identical for a given APID.

Parameters:
  • packets (list) – List of lasp_packets.parser.Packet objects.

  • apid (int) – Application Packet ID to create an array from. We can only create an array for a single APID because we need to assume the same fields in every packet. If not specified, every packet must be of the same APID.

Returns:

Record array with one column per field name in the packet type. Values are derived if a derived value exists, otherwise, the values are the raw values.

Return type:

numpy.recarray