Skip to content

Commit 2c63ea6

Browse files
authored
Exclude certain variables in CoDICE housekeeping products (IMAP-Science-Operations-Center#1399)
* Added variables to exclude in L1a+ housekeeping products
1 parent 7f6c01a commit 2c63ea6

File tree

2 files changed

+25
-27
lines changed

2 files changed

+25
-27
lines changed

imap_processing/codice/codice_l1a.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,23 @@ def create_hskp_dataset(
561561
attrs=cdf_attrs.get_global_attributes("imap_codice_l1a_hskp"),
562562
)
563563

564+
# These variables don't need to carry over from L0 to L1a
565+
exclude_variables = [
566+
"spare_1",
567+
"spare_2",
568+
"spare_3",
569+
"spare_4",
570+
"spare_5",
571+
"spare_6",
572+
"spare_62",
573+
"spare_68",
574+
"chksum",
575+
]
576+
564577
for variable in packet:
578+
if variable in exclude_variables:
579+
continue
580+
565581
attrs = cdf_attrs.get_variable_attributes(variable)
566582

567583
dataset[variable] = xr.DataArray(

imap_processing/tests/codice/test_codice_l1a.py

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
EXPECTED_NUM_VARIABLES = [
6363
0, # hi-ialirt # TODO: Need to implement
6464
0, # lo-ialirt # TODO: Need to implement
65-
148, # hskp
65+
139, # hskp
6666
8 + len(constants.LO_COUNTERS_AGGREGATED_VARIABLE_NAMES), # lo-counters-aggregated
6767
9, # lo-counters-singles
6868
13, # lo-sw-priority
@@ -247,35 +247,17 @@ def test_l1a_validate_hskp_data(test_l1a_data):
247247
# Load the validation housekeeping data
248248
validation_hskp_data = load_cdf(validation_hskp_filepath)
249249

250-
# These variables are present in the decommed test data, but not present in
251-
# the validation data
252-
# TODO: Ask Joey if these can be removed from the L1a housekeeping CDFs
250+
# These variables are not present in the validation dataset
253251
exclude_variables = [
254-
"spare_1",
255-
"spare_2",
256-
"spare_3",
257-
"spare_4",
258-
"spare_5",
259-
"spare_6",
260-
"spare_62",
261-
"spare_68",
252+
"version",
253+
"type",
254+
"sec_hdr_flg",
255+
"pkt_apid",
256+
"seq_flgs",
257+
"src_seq_ctr",
258+
"pkt_len",
262259
]
263260

264-
# These variables are not present in the validation data
265-
# TODO: Ask joey if this is expected
266-
exclude_variables.extend(
267-
[
268-
"version",
269-
"type",
270-
"sec_hdr_flg",
271-
"pkt_apid",
272-
"seq_flgs",
273-
"src_seq_ctr",
274-
"pkt_len",
275-
"chksum",
276-
]
277-
)
278-
279261
for variable in hskp_data:
280262
if variable not in exclude_variables:
281263
np.testing.assert_array_equal(

0 commit comments

Comments
 (0)