4848def processing_dependencies (codice_lut_path ):
4949 eff_file = "imap_codice_l2-lo-efficiency_20251008_v001.csv"
5050 gf_file = "imap_codice_l2-lo-gfactor_20251008_v001.csv"
51- mpq_file = "imap_codice_lo-mpq-cal_20250101_v001.csv"
52- return ProcessingInputCollection (
53- AncillaryInput (gf_file ), AncillaryInput (eff_file ), AncillaryInput (mpq_file )
54- )
51+ return ProcessingInputCollection (AncillaryInput (gf_file ), AncillaryInput (eff_file ))
5552
5653
5754@pytest .fixture
@@ -181,9 +178,9 @@ def test_get_efficiency_lut(processing_dependencies, mock_get_file_paths):
181178def test_get_tof_ns_from_mpq_lut (processing_dependencies , mock_get_file_paths ):
182179 tof_ns = get_mpq_calc_tof_conversion_vals (processing_dependencies )
183180 assert tof_ns .shape == (1024 ,)
184- mpq_calc_lut_file = processing_dependencies .get_file_paths (descriptor = "lo-mpq-cal" )[
185- 0
186- ]
181+ mpq_calc_lut_file = processing_dependencies .get_file_paths (
182+ descriptor = "l2-lo-onboard-mpq-cal"
183+ )[ 0 ]
187184 mpq_df = pd .read_csv (mpq_calc_lut_file , header = None )
188185 expected_tof_ns = mpq_df .loc [6 :, 1 ].to_numpy ().astype (np .float64 )
189186 # Calculated values should be more precise than LUT but should be close
@@ -193,9 +190,9 @@ def test_get_tof_ns_from_mpq_lut(processing_dependencies, mock_get_file_paths):
193190def test_get_energy_kev_from_mpq_lut (processing_dependencies , mock_get_file_paths ):
194191 energy_kev = get_mpq_calc_energy_conversion_vals (processing_dependencies )
195192 assert energy_kev .shape == (128 ,)
196- mpq_calc_lut_file = processing_dependencies .get_file_paths (descriptor = "lo-mpq-cal" )[
197- 0
198- ]
193+ mpq_calc_lut_file = processing_dependencies .get_file_paths (
194+ descriptor = "l2-lo-onboard-mpq-cal"
195+ )[ 0 ]
199196 mpq_df = pd .read_csv (mpq_calc_lut_file , header = None )
200197 expected_tof_ns = mpq_df .loc [5 , 4 :].to_numpy ().astype (np .float64 )
201198 # Calculated values should be more precise than LUT but should be close
@@ -524,6 +521,7 @@ def test_codice_l2_lo_de(mock_get_file_paths, codice_lut_path):
524521 codice_lut_path (descriptor = "l2-lo-onboard-energy-table" ),
525522 codice_lut_path (descriptor = "l2-lo-onboard-energy-bins" ),
526523 codice_lut_path (descriptor = "l2-lo-onboard-mpq-cal" ),
524+ codice_lut_path (descriptor = "l2-lo-onboard-mpq-cal" ),
527525 ]
528526
529527 processed_l2_ds = process_codice_l2 ("lo-direct-events" , ProcessingInputCollection ())
@@ -538,7 +536,9 @@ def test_codice_l2_lo_de(mock_get_file_paths, codice_lut_path):
538536 f"_{ VALIDATION_FILE_VERSION } .cdf"
539537 )
540538 )
539+
541540 l2_val_data = load_cdf (l2_val_data )
541+
542542 for variable in l2_val_data .data_vars :
543543 if variable in ["spin_angle" ]:
544544 # TODO remove this block when joey fixes spin_angle calculation
@@ -555,11 +555,11 @@ def test_codice_l2_lo_de(mock_get_file_paths, codice_lut_path):
555555 l2_val_data [variable ].values ,
556556 rtol = 5e-5 ,
557557 err_msg = f"Mismatch in variable '{ variable } '" ,
558+ equal_nan = True ,
558559 )
559-
560560 processed_l2_ds .attrs ["Data_version" ] = "001"
561561 assert processed_l2_ds .attrs ["Logical_source" ] == "imap_codice_l2_lo-direct-events"
562562 file = write_cdf (processed_l2_ds )
563- errors = CDFValidator ().validate_raw (file )
563+ errors = CDFValidator ().validate (file )
564564 assert not errors
565565 load_cdf (file )
0 commit comments