imap_processing.codice.codice_l1a.group_data#

imap_processing.codice.codice_l1a.group_data(packets: Dataset) list[bytes]#

Organize continuation packets into appropriate groups.

Some packets are continuation packets, as in, they are packets that are part of a group of packets. These packets are marked by the seq_flgs field in the CCSDS header of the packet. For CoDICE, the values are defined as follows:

3 = Packet is not part of a group 1 = Packet is the first packet of the group 0 = Packet is in the middle of the group 2 = Packet is the last packet of the group

For packets that are part of a group, the byte count associated with the first packet of the group signifies the byte count for the entire group.

Parameters:

packets (xarray.Dataset) – Dataset containing the packets to group.

Returns:

grouped_data – The packet data, converted to bytes and grouped appropriately.

Return type:

list[bytes]