imap_processing.mag.l1a.mag_l1a_data.MagL1a#

class imap_processing.mag.l1a.mag_l1a_data.MagL1a(is_mago: bool, is_active: int, shcoarse: int, vectors: np.ndarray, starting_packet: InitVar[MagL1aPacketProperties], missing_sequences: list[int] = <factory>)#

Data class for MAG Level 1A data.

One MAG L1A object corresponds to part of one MAG L0 packet, which corresponds to one packet of data from the MAG instrument. Each L0 packet consists of data from two sensors, MAGO (outboard) and MAGI (inboard). One of these sensors is designated as the primary sensor (first part of data stream), and one as the secondary.

We expect the primary sensor to be MAGO, and the secondary to be MAGI, but this is not guaranteed. Each MagL1A object contains data from one sensor. The primary/secondary construct is only used to sort the vectors into MAGo and MAGi data, and therefore is not used at higher levels.

is_mago#

True if the data is from MagO, False if data is from MagI

Type:

bool

is_active#

1 if the sensor is active, 0 if not

Type:

int

shcoarse#

Mission elapsed time for the first packet, the start time for the whole day

Type:

int

vectors#

List of magnetic vector samples, starting at start_time. [x, y, z, range, time], where time is numpy.datetime64[ns]

Type:

numpy.ndarray

starting_packet#

The packet properties for the first packet in the day. As an InitVar, this cannot be accessed from an instance of the class. Instead, packet_definitions should be used.

Type:

InitVar[MagL1aPacketProperties]

packet_definitions#

Dictionary of packet properties for each packet in the day. The key is the start time of the packet, and the value is a dataclass of packet properties.

Type:

dict[numpy.datetime64, MagL1aPacketProperties]

most_recent_sequence#

Sequence number of the most recent packet added to the object

Type:

int

missing_sequences#

List of missing sequence numbers in the day

Type:

list[int]

start_time#

Start time of the day, in ns since J2000 epoch

Type:

numpy.datetime64

append_vectors()#
calculate_vector_time()#
process_vector_data()#
__init__(is_mago: bool, is_active: int, shcoarse: int, vectors: np.ndarray, starting_packet: InitVar[MagL1aPacketProperties], missing_sequences: list[int] = <factory>) None#

Methods

__init__(is_mago, is_active, shcoarse, ...)

append_vectors(additional_vectors, ...)

Append additional vectors to the current vectors array.

calculate_vector_time(vectors, ...)

Add timestamps to the vector list, turning the shape from (n, 4) to (n, 5).

process_vector_data(vector_data, ...)

Given raw packet data, process into Vectors.

Attributes