Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions imap_processing/cdf/config/imap_mag_l2_variable_attrs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ vector_attrs: &vectors_default
LABL_PTR_1: direction_label
FILLVAL: 9223372036854775807
FORMAT: F12.5
CDF_DATA_TYPE: CDF_FLOAT
DICT_KEY: "SPASE>Field>FieldQuantity:Magnetic,Qualifier:Vector,CoordinateSystemName:DSRF,CoordinateRepresentation:Cartesian"

# Frame-specific vector attributes
Expand Down Expand Up @@ -99,6 +100,7 @@ magnitude:
UNITS: nT
VALIDMIN: 0
VALIDMAX: 1.0e+5
CDF_DATA_TYPE: CDF_FLOAT
DICT_KEY: SPASE>Field>FieldQuantity:Magnetic,Qualifier:Scalar

range:
Expand All @@ -111,6 +113,7 @@ range:
UNITS: ' '
VALIDMAX: 3
VALIDMIN: 0
CDF_DATA_TYPE: CDF_UINT1
DICT_KEY: SPASE>Support>SupportQuantity:InstrumentMode

pri_sens:
Expand Down
12 changes: 9 additions & 3 deletions imap_processing/mag/l2/mag_l2_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ def generate_dataset(
self.vectors,
name="vectors",
dims=["epoch", "direction"],
attrs=attribute_manager.get_variable_attributes(vector_attrs_name),
attrs=attribute_manager.get_variable_attributes(
vector_attrs_name, check_schema=False
),
)

quality_flags = xr.DataArray(
Expand All @@ -171,14 +173,18 @@ def generate_dataset(
self.range,
name="range",
dims=["epoch"],
attrs=attribute_manager.get_variable_attributes("range"),
attrs=attribute_manager.get_variable_attributes(
"range", check_schema=False
),
)

magnitude = xr.DataArray(
self.magnitude,
name="magnitude",
dims=["epoch"],
attrs=attribute_manager.get_variable_attributes("magnitude"),
attrs=attribute_manager.get_variable_attributes(
"magnitude", check_schema=False
),
)

global_attributes = (
Expand Down
1 change: 1 addition & 0 deletions imap_processing/tests/mag/test_mag_l2.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def test_mag_l2_attributes(norm_dataset, mag_test_l2_data, data_mode):
assert dataset["range"].attrs["DICT_KEY"] == (
"SPASE>Support>SupportQuantity:InstrumentMode"
)
assert dataset["vectors"].attrs["CDF_DATA_TYPE"] == "CDF_FLOAT"


def test_mag_l2(norm_dataset, mag_test_l2_data):
Expand Down