libera_utils.packet_configs.PacketConfiguration#

class libera_utils.packet_configs.PacketConfiguration(packet_apid: ~libera_utils.constants.LiberaApid, packet_time_fields: ~libera_utils.packet_configs.TimeFieldMapping, sample_groups: list[~libera_utils.packet_configs.SampleGroup] = <factory>, aggregation_groups: list[~libera_utils.packet_configs.AggregationGroup] = <factory>, packet_definition_config_key: str = 'LIBERA_PACKET_DEFINITION', packet_time_source: ~libera_utils.packet_configs.SampleTimeSource = SampleTimeSource.ICIE, packet_generator_kwargs: dict = <factory>)#

Bases: ABC

Abstract base class for packet configurations.

All packet configurations must subclass this and will be automatically registered when decorated with @register_packet_config.

This class defines how to parse packets that may contain multiple groups of samples with their own timestamps, allowing for proper expansion and reshaping of the data.

packet_apid#

The APID (Application Process Identifier) for the packet type

Type:

LiberaApid

packet_time_fields#

Mapping of packet timestamp fields to their time units for multipart_to_dt64 conversion.

Type:

TimeFieldMapping

sample_groups#

List of sample group configurations for this packet type.

Type:

list[SampleGroup]

aggregation_groups#

List of aggregation group configurations for this packet type.

Type:

list[AggregationGroup]

packet_definition_config_key#

Configuration key to fetch the packet definition path from config. Defaults to “LIBERA_PACKET_DEFINITION”.

Type:

str

packet_time_source#

The time source for packet timestamps.

Type:

SampleTimeSource

packet_generator_kwargs#

Additional keyword arguments passed to the packet generator in space_packet_parser. Default is no additional kwargs.

Type:

dict

Attributes:
packet_time_coordinate

Get the packet time coordinate name following the consistent pattern.

Methods

get_sample_group(name)

Get a sample group by name

__init__(packet_apid: ~libera_utils.constants.LiberaApid, packet_time_fields: ~libera_utils.packet_configs.TimeFieldMapping, sample_groups: list[~libera_utils.packet_configs.SampleGroup] = <factory>, aggregation_groups: list[~libera_utils.packet_configs.AggregationGroup] = <factory>, packet_definition_config_key: str = 'LIBERA_PACKET_DEFINITION', packet_time_source: ~libera_utils.packet_configs.SampleTimeSource = SampleTimeSource.ICIE, packet_generator_kwargs: dict = <factory>) None#

Methods

get_sample_group(name)

Get a sample group by name

Attributes

get_sample_group(name: str) SampleGroup#

Get a sample group by name

property packet_time_coordinate: str#

Get the packet time coordinate name following the consistent pattern.

Returns:

The packet coordinate name, e.g. “PACKET_ICIE_TIME”

Return type:

str