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
12 changes: 6 additions & 6 deletions imap_processing/cdf/config/imap_codice_l1a_variable_attrs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ nso_half_spin:
VALIDMAX: 255
VALIDMIN: 0
VAR_NOTES: Indicates the half spin when No Scan Operation (NSO) was activated. In NSO, the ESA voltage is set to the first step in the scan and remains fixed until the next cycle boundary.
VAR_TYPE: data
VAR_TYPE: support_data

nso_spin_sector:
CATDESC: Spin Sector When No Scan Operation (NSO) was activated
Expand All @@ -279,7 +279,7 @@ nso_spin_sector:
VALIDMAX: 255
VALIDMIN: 0
VAR_NOTES: Indicates the spin sector when No Scan Operation (NSO) was activated. In NSO, the ESA voltage is set to the first step in the scan and remains fixed until the next cycle boundary.
VAR_TYPE: data
VAR_TYPE: support_data

nso_esa_step:
CATDESC: Energy Step When No Scan Operation (NSO) was activated
Expand All @@ -294,7 +294,7 @@ nso_esa_step:
VALIDMAX: 255
VALIDMIN: 0
VAR_NOTES: Indicates the energy step when No Scan Operation (NSO) was activated. In NSO, the ESA voltage is set to the first step in the scan and remains fixed until the next cycle boundary.
VAR_TYPE: data
VAR_TYPE: support_data

rgfo_half_spin:
CATDESC: Half Spin When Reduced Gain Factor Operation (RGFO) was activated
Expand All @@ -309,7 +309,7 @@ rgfo_half_spin:
VALIDMAX: 255
VALIDMIN: 0
VAR_NOTES: Indicates the half spin when Reduced Gain Factor Operation (RGFO) was activated. In RGFO, the Entrance ESA voltage is reduced in order to limit the number of ions that reach the detectors.
VAR_TYPE: data
VAR_TYPE: support_data

rgfo_spin_sector:
CATDESC: Spin Sector When Reduced Gain Factor Operation (RGFO) was activated
Expand All @@ -324,7 +324,7 @@ rgfo_spin_sector:
VALIDMAX: 255
VALIDMIN: 0
VAR_NOTES: Indicates the spin sector when Reduced Gain Factor Operation (RGFO) was activated. In RGFO, the Entrance ESA voltage is reduced in order to limit the number of ions that reach the detectors.
VAR_TYPE: data
VAR_TYPE: support_data

rgfo_esa_step:
CATDESC: Energy Step When Reduced Gain Factor Operation (RGFO) was activated
Expand All @@ -339,7 +339,7 @@ rgfo_esa_step:
VALIDMAX: 255
VALIDMIN: 0
VAR_NOTES: Indicates the energy step when Reduced Gain Factor Operation (RGFO) was activated. In RGFO, the Entrance ESA voltage is reduced in order to limit the number of ions that reach the detectors.
VAR_TYPE: data
VAR_TYPE: support_data

spin_period:
CATDESC: The spin period as reported by the spacecraft.
Expand Down
12 changes: 12 additions & 0 deletions imap_processing/tests/codice/test_codice_l1a.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@
# and num_spins max = 16 in the current CoDICE timing model. That yields a
# worst-case delta of 128 s = 128000000000 ns.
EXPECTED_EPOCH_DELTA_VALIDMAX = 128000000000
LO_MODE_SUPPORT_VARIABLES = [
"rgfo_half_spin",
"rgfo_spin_sector",
"rgfo_esa_step",
"nso_half_spin",
"nso_spin_sector",
"nso_esa_step",
]


def assert_epoch_delta_cdf_metadata(cdf_file):
Expand Down Expand Up @@ -606,6 +614,10 @@ def test_lo_direct_events(mock_get_file_paths, codice_lut_path):
cdf_file.name
== f"imap_codice_l1a_lo-direct-events_{VALIDATION_FILE_DATE}_v002.cdf"
)
with cdflib.CDF(cdf_file) as cdf:
for variable in LO_MODE_SUPPORT_VARIABLES:
attrs = cdf.varattsget(variable)
assert attrs["VAR_TYPE"] == "support_data"


def test_direct_events_incomplete_groups(codice_lut_path, caplog):
Expand Down
20 changes: 20 additions & 0 deletions imap_processing/tests/codice/test_codice_l2.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ def assert_l2_epoch_delta_cdf_metadata(cdf_file):
"ssd_id": "no_plot",
},
}
LO_DIRECT_EVENT_SUPPORT_VARIABLES = [
"nso_half_spin",
"nso_spin_sector",
"nso_esa_step",
]


@pytest.fixture
Expand Down Expand Up @@ -730,3 +735,18 @@ def test_codice_l2_direct_events_display_type_cdf_metadata(
"(Double Coincidence Rate; STA+STB+SP), 2 = APD-only energy "
"event (APD with only one or two of STA, STB, and SP)."
)


@patch("imap_data_access.processing_input.ProcessingInputCollection.get_file_paths")
def test_codice_l2_lo_direct_events_support_var_type_cdf_metadata(
mock_get_file_paths, codice_lut_path
):
file = _generate_direct_events_l2_file(
mock_get_file_paths, codice_lut_path, "lo-direct-events"
)
with cdflib.CDF(str(file)) as cdf_file:
written_variables = set(cdf_file.cdf_info().zVariables)
assert set(LO_DIRECT_EVENT_SUPPORT_VARIABLES) <= written_variables
for variable in LO_DIRECT_EVENT_SUPPORT_VARIABLES:
attrs = cdf_file.varattsget(variable)
assert attrs["VAR_TYPE"] == "support_data"
Loading