From df589c559ad49fc0021d8b43574a408dafc702ff Mon Sep 17 00:00:00 2001 From: Luisa Date: Fri, 27 Feb 2026 10:38:03 -0700 Subject: [PATCH 01/15] tests --- imap_processing/ultra/l1b/extendedspin.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/imap_processing/ultra/l1b/extendedspin.py b/imap_processing/ultra/l1b/extendedspin.py index 41eed8642..21c965082 100644 --- a/imap_processing/ultra/l1b/extendedspin.py +++ b/imap_processing/ultra/l1b/extendedspin.py @@ -151,6 +151,14 @@ def calculate_extendedspin( # is flagged will have the bitflag of all the energy flags combined. voltage_qf = voltage_qf * np.bitwise_or.reduce(energy_bin_flags) # Expand binned quality flags to individual spins. + # high energy and statistical outlier flags are energy dependent + # Collapse them into a single flag array + high_energy_qf = np.bitwise_or.reduce( + high_energy_qf * energy_bin_flags[:, np.newaxis], axis=1 + ) + stat_outliers_qf = np.bitwise_or.reduce( + stat_outliers_qf * energy_bin_flags[:, np.newaxis], axis=1 + ) high_energy_qf = expand_bin_flags_to_spins(len(spin), high_energy_qf, spin_bin_size) voltage_qf = expand_bin_flags_to_spins(len(spin), voltage_qf, spin_bin_size) stat_outliers_qf = expand_bin_flags_to_spins( From d548265170868ecc7c9e6b06e7cc7d47b1c6feb0 Mon Sep 17 00:00:00 2001 From: Luisa Date: Fri, 27 Feb 2026 10:59:34 -0700 Subject: [PATCH 02/15] fix voltage flags --- imap_processing/ultra/l1b/extendedspin.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/imap_processing/ultra/l1b/extendedspin.py b/imap_processing/ultra/l1b/extendedspin.py index 21c965082..17fc87f24 100644 --- a/imap_processing/ultra/l1b/extendedspin.py +++ b/imap_processing/ultra/l1b/extendedspin.py @@ -159,6 +159,11 @@ def calculate_extendedspin( stat_outliers_qf = np.bitwise_or.reduce( stat_outliers_qf * energy_bin_flags[:, np.newaxis], axis=1 ) + # Low voltage flag is shape (n_spin_bins,) but we want to convert from a boolean + # to a bitwise flag to be consistent with the other flags, where each spin that + # is flagged will have the bitflag of all the energy flags combined. + voltage_qf = voltage_qf * np.bitwise_or.reduce(energy_bin_flags) + # Expand binned quality flags to individual spins. high_energy_qf = expand_bin_flags_to_spins(len(spin), high_energy_qf, spin_bin_size) voltage_qf = expand_bin_flags_to_spins(len(spin), voltage_qf, spin_bin_size) stat_outliers_qf = expand_bin_flags_to_spins( From bb1d7634af7d774372c5b8bf21c68890e47476cf Mon Sep 17 00:00:00 2001 From: Luisa Date: Fri, 27 Feb 2026 11:57:04 -0700 Subject: [PATCH 03/15] address pr comments --- imap_processing/ultra/l1b/extendedspin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imap_processing/ultra/l1b/extendedspin.py b/imap_processing/ultra/l1b/extendedspin.py index 17fc87f24..1300c717b 100644 --- a/imap_processing/ultra/l1b/extendedspin.py +++ b/imap_processing/ultra/l1b/extendedspin.py @@ -154,10 +154,10 @@ def calculate_extendedspin( # high energy and statistical outlier flags are energy dependent # Collapse them into a single flag array high_energy_qf = np.bitwise_or.reduce( - high_energy_qf * energy_bin_flags[:, np.newaxis], axis=1 + high_energy_qf * energy_bin_flags[:, np.newaxis], axis=0 ) stat_outliers_qf = np.bitwise_or.reduce( - stat_outliers_qf * energy_bin_flags[:, np.newaxis], axis=1 + stat_outliers_qf * energy_bin_flags[:, np.newaxis], axis=0 ) # Low voltage flag is shape (n_spin_bins,) but we want to convert from a boolean # to a bitwise flag to be consistent with the other flags, where each spin that From b7380aa608a1441e3990948a281c4e38ab8c31d3 Mon Sep 17 00:00:00 2001 From: Luisa Date: Mon, 2 Mar 2026 11:23:35 -0700 Subject: [PATCH 04/15] ultra l1b energy and spin bin updates --- .../tests/ultra/unit/test_ultra_l1b_culling.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py b/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py index 5757dc781..6278359f2 100644 --- a/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py +++ b/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py @@ -862,3 +862,12 @@ def test_get_binned_energy_ranges(): expected_energy_ranges = np.array([4.2, 9.4425, 21.2116, 47.2388, 105.202, 316.335]) np.testing.assert_array_equal(energy_ranges, expected_energy_ranges) + + +def test_get_binned_energy_ranges(): + """Tests get_binned_energy_ranges function.""" + intervals, _, _ = build_energy_bins() + energy_ranges = get_binned_energy_ranges(intervals) + + expected_energy_ranges = np.array([4.2, 9.4425, 21.2116, 47.2388, 105.202, 316.335]) + np.testing.assert_array_equal(energy_ranges, expected_energy_ranges) From 86a499a594756e486aa159dc571698151dc8b3fa Mon Sep 17 00:00:00 2001 From: Luisa Date: Mon, 2 Mar 2026 11:30:13 -0700 Subject: [PATCH 05/15] remove duplicate code --- imap_processing/ultra/l1b/extendedspin.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/imap_processing/ultra/l1b/extendedspin.py b/imap_processing/ultra/l1b/extendedspin.py index 1300c717b..41eed8642 100644 --- a/imap_processing/ultra/l1b/extendedspin.py +++ b/imap_processing/ultra/l1b/extendedspin.py @@ -151,19 +151,6 @@ def calculate_extendedspin( # is flagged will have the bitflag of all the energy flags combined. voltage_qf = voltage_qf * np.bitwise_or.reduce(energy_bin_flags) # Expand binned quality flags to individual spins. - # high energy and statistical outlier flags are energy dependent - # Collapse them into a single flag array - high_energy_qf = np.bitwise_or.reduce( - high_energy_qf * energy_bin_flags[:, np.newaxis], axis=0 - ) - stat_outliers_qf = np.bitwise_or.reduce( - stat_outliers_qf * energy_bin_flags[:, np.newaxis], axis=0 - ) - # Low voltage flag is shape (n_spin_bins,) but we want to convert from a boolean - # to a bitwise flag to be consistent with the other flags, where each spin that - # is flagged will have the bitflag of all the energy flags combined. - voltage_qf = voltage_qf * np.bitwise_or.reduce(energy_bin_flags) - # Expand binned quality flags to individual spins. high_energy_qf = expand_bin_flags_to_spins(len(spin), high_energy_qf, spin_bin_size) voltage_qf = expand_bin_flags_to_spins(len(spin), voltage_qf, spin_bin_size) stat_outliers_qf = expand_bin_flags_to_spins( From 91173641031d72496c429546289fc1c2da83f321 Mon Sep 17 00:00:00 2001 From: Luisa Date: Fri, 27 Feb 2026 11:39:05 -0700 Subject: [PATCH 06/15] base for val test --- .../ultra/unit/test_ultra_l1b_culling.py | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py b/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py index 6278359f2..6fd3acc6e 100644 --- a/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py +++ b/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py @@ -844,6 +844,38 @@ def test_get_poisson_stats(): assert outlier_mask[-1] +@pytest.mark.external_test_data +def test_validate_stat_cull(): + """Validate that flag_statistical_outliers are correctly flagged""" + # read test data from csv files + # xspin = pd.read_csv(TEST_PATH / "extendedspin_test_data_repoint00047.csv") + # expected_qf = pd.read_csv( + # TEST_PATH / "validate_high_energy_culling_results_repoint00047.csv" + # ).to_numpy() + # de_df = pd.read_csv(TEST_PATH / "de_test_data_repoint00047.csv") + # de_ds = xr.Dataset( + # { + # "de_event_met": ("epoch", de_df.event_times.values), + # "energy_spacecraft": ("epoch", de_df.energy_spacecraft.values), + # "quality_outliers": ("epoch", de_df.quality_outliers.values), + # "quality_scattering": ("epoch", de_df.quality_scattering.values), + # "ebin": ("epoch", de_df.ebin.values), + # } + # ) + # # Use constants from the code to ensure consistency with the actual culling code + # spin_bin_size = UltraConstants.SPIN_BIN_SIZE + # spin_tbin_edges = get_binned_spins_edges( + # xspin.spin_number.values, + # xspin.spin_period.values, + # xspin.spin_start_time.values, + # spin_bin_size, + # ) + # intervals, _, _ = build_energy_bins() + # # Get the energy ranges + # energy_ranges = get_binned_energy_ranges(intervals) + pass + + def test_get_energy_range_flags(): """Tests get_binned_energy_range_flags function.""" # Get energy bins used at l1c From 220d57f62d2e0dec3e096b9c0dd43eb82417b36a Mon Sep 17 00:00:00 2001 From: Luisa Date: Fri, 27 Feb 2026 14:47:30 -0700 Subject: [PATCH 07/15] comment otu ocde --- .../tests/ultra/unit/test_ultra_l1b_culling.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py b/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py index 6fd3acc6e..2086ecffc 100644 --- a/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py +++ b/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py @@ -847,10 +847,10 @@ def test_get_poisson_stats(): @pytest.mark.external_test_data def test_validate_stat_cull(): """Validate that flag_statistical_outliers are correctly flagged""" - # read test data from csv files + # #read test data from csv files # xspin = pd.read_csv(TEST_PATH / "extendedspin_test_data_repoint00047.csv") # expected_qf = pd.read_csv( - # TEST_PATH / "validate_high_energy_culling_results_repoint00047.csv" + # TEST_PATH / "validate_stat_culling_results_repoint00047.csv" # ).to_numpy() # de_df = pd.read_csv(TEST_PATH / "de_test_data_repoint00047.csv") # de_ds = xr.Dataset( @@ -873,6 +873,10 @@ def test_validate_stat_cull(): # intervals, _, _ = build_energy_bins() # # Get the energy ranges # energy_ranges = get_binned_energy_ranges(intervals) + # flags, _,_,_ = flag_statistical_outliers( + # de_ds, spin_tbin_edges, energy_ranges, get_energy_range_flags(energy_ranges), + # 6 + # ) pass From 84828703c07731a2fa0774011f2292b1147a03f6 Mon Sep 17 00:00:00 2001 From: Luisa Date: Fri, 27 Feb 2026 10:38:03 -0700 Subject: [PATCH 08/15] tests --- imap_processing/ultra/l1b/extendedspin.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/imap_processing/ultra/l1b/extendedspin.py b/imap_processing/ultra/l1b/extendedspin.py index 41eed8642..21c965082 100644 --- a/imap_processing/ultra/l1b/extendedspin.py +++ b/imap_processing/ultra/l1b/extendedspin.py @@ -151,6 +151,14 @@ def calculate_extendedspin( # is flagged will have the bitflag of all the energy flags combined. voltage_qf = voltage_qf * np.bitwise_or.reduce(energy_bin_flags) # Expand binned quality flags to individual spins. + # high energy and statistical outlier flags are energy dependent + # Collapse them into a single flag array + high_energy_qf = np.bitwise_or.reduce( + high_energy_qf * energy_bin_flags[:, np.newaxis], axis=1 + ) + stat_outliers_qf = np.bitwise_or.reduce( + stat_outliers_qf * energy_bin_flags[:, np.newaxis], axis=1 + ) high_energy_qf = expand_bin_flags_to_spins(len(spin), high_energy_qf, spin_bin_size) voltage_qf = expand_bin_flags_to_spins(len(spin), voltage_qf, spin_bin_size) stat_outliers_qf = expand_bin_flags_to_spins( From 94777359a90f1d558b83f061ce23ebe3ca4a9361 Mon Sep 17 00:00:00 2001 From: Luisa Date: Fri, 27 Feb 2026 15:02:42 -0700 Subject: [PATCH 09/15] validation test --- .../ultra/unit/test_ultra_l1b_culling.py | 63 ++++++++++--------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py b/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py index 2086ecffc..a7c883abb 100644 --- a/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py +++ b/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py @@ -847,37 +847,38 @@ def test_get_poisson_stats(): @pytest.mark.external_test_data def test_validate_stat_cull(): """Validate that flag_statistical_outliers are correctly flagged""" - # #read test data from csv files - # xspin = pd.read_csv(TEST_PATH / "extendedspin_test_data_repoint00047.csv") - # expected_qf = pd.read_csv( - # TEST_PATH / "validate_stat_culling_results_repoint00047.csv" - # ).to_numpy() - # de_df = pd.read_csv(TEST_PATH / "de_test_data_repoint00047.csv") - # de_ds = xr.Dataset( - # { - # "de_event_met": ("epoch", de_df.event_times.values), - # "energy_spacecraft": ("epoch", de_df.energy_spacecraft.values), - # "quality_outliers": ("epoch", de_df.quality_outliers.values), - # "quality_scattering": ("epoch", de_df.quality_scattering.values), - # "ebin": ("epoch", de_df.ebin.values), - # } - # ) - # # Use constants from the code to ensure consistency with the actual culling code - # spin_bin_size = UltraConstants.SPIN_BIN_SIZE - # spin_tbin_edges = get_binned_spins_edges( - # xspin.spin_number.values, - # xspin.spin_period.values, - # xspin.spin_start_time.values, - # spin_bin_size, - # ) - # intervals, _, _ = build_energy_bins() - # # Get the energy ranges - # energy_ranges = get_binned_energy_ranges(intervals) - # flags, _,_,_ = flag_statistical_outliers( - # de_ds, spin_tbin_edges, energy_ranges, get_energy_range_flags(energy_ranges), - # 6 - # ) - pass + # read test data from csv files + xspin = pd.read_csv(TEST_PATH / "extendedspin_test_data_repoint00047.csv") + expected_qf = pd.read_csv( + TEST_PATH / "validate_stat_culling_results_repoint00047.csv" + ).to_numpy() + de_df = pd.read_csv(TEST_PATH / "de_test_data_repoint00047.csv") + de_ds = xr.Dataset( + { + "de_event_met": ("epoch", de_df.event_times.values), + "energy_spacecraft": ("epoch", de_df.energy_spacecraft.values), + "quality_outliers": ("epoch", de_df.quality_outliers.values), + "quality_scattering": ("epoch", de_df.quality_scattering.values), + "ebin": ("epoch", de_df.ebin.values), + } + ) + # Use constants from the code to ensure consistency with the actual culling code + spin_bin_size = UltraConstants.SPIN_BIN_SIZE + spin_tbin_edges = get_binned_spins_edges( + xspin.spin_number.values, + xspin.spin_period.values, + xspin.spin_start_time.values, + spin_bin_size, + ) + intervals, _, _ = build_energy_bins() + # Use the actual energy ranges that were used for the test data + energy_ranges = np.array([4.2, 9.4425, 21.2116, 47.2388, 105.202, 316.335]) + mask = np.zeros((len(energy_ranges) - 1, len(spin_tbin_edges) - 1), dtype=bool) + flags, _, _, _ = flag_statistical_outliers( + de_ds, spin_tbin_edges, energy_ranges, mask, 90 + ) + + np.testing.assert_array_equal(flags, ~expected_qf.astype(bool)) def test_get_energy_range_flags(): From 65e2ff3849716f323f0b2ead6dfb442a66e0f146 Mon Sep 17 00:00:00 2001 From: Luisa Date: Fri, 27 Feb 2026 15:16:34 -0700 Subject: [PATCH 10/15] check other vars --- .../tests/ultra/unit/test_ultra_l1b_culling.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py b/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py index a7c883abb..f0ddc05b0 100644 --- a/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py +++ b/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py @@ -849,9 +849,9 @@ def test_validate_stat_cull(): """Validate that flag_statistical_outliers are correctly flagged""" # read test data from csv files xspin = pd.read_csv(TEST_PATH / "extendedspin_test_data_repoint00047.csv") - expected_qf = pd.read_csv( + results_df = pd.read_csv( TEST_PATH / "validate_stat_culling_results_repoint00047.csv" - ).to_numpy() + ) de_df = pd.read_csv(TEST_PATH / "de_test_data_repoint00047.csv") de_ds = xr.Dataset( { @@ -874,11 +874,18 @@ def test_validate_stat_cull(): # Use the actual energy ranges that were used for the test data energy_ranges = np.array([4.2, 9.4425, 21.2116, 47.2388, 105.202, 316.335]) mask = np.zeros((len(energy_ranges) - 1, len(spin_tbin_edges) - 1), dtype=bool) - flags, _, _, _ = flag_statistical_outliers( + flags, con, it, std = flag_statistical_outliers( de_ds, spin_tbin_edges, energy_ranges, mask, 90 ) - + expected_qf = results_df.iloc[:, :-3].values.astype(bool) + converge = results_df["converge"].values + iterations = results_df["iterations"].values + std_diff = results_df["std_diff"].values + # check that the flags match the expected results np.testing.assert_array_equal(flags, ~expected_qf.astype(bool)) + np.testing.assert_array_equal(con, converge) + np.testing.assert_array_equal(it, iterations) + np.testing.assert_array_equal(std, std_diff) def test_get_energy_range_flags(): From a621cd21a73174222cac2af53ef922436b145f0b Mon Sep 17 00:00:00 2001 From: Luisa Date: Fri, 27 Feb 2026 15:44:23 -0700 Subject: [PATCH 11/15] use allclose for stddiff --- imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py | 2 +- imap_processing/ultra/l1b/ultra_l1b_culling.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py b/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py index f0ddc05b0..b56d2411e 100644 --- a/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py +++ b/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py @@ -885,7 +885,7 @@ def test_validate_stat_cull(): np.testing.assert_array_equal(flags, ~expected_qf.astype(bool)) np.testing.assert_array_equal(con, converge) np.testing.assert_array_equal(it, iterations) - np.testing.assert_array_equal(std, std_diff) + np.testing.assert_allclose(std, std_diff, rtol=1e-10) def test_get_energy_range_flags(): diff --git a/imap_processing/ultra/l1b/ultra_l1b_culling.py b/imap_processing/ultra/l1b/ultra_l1b_culling.py index 0d13b3c2b..e3203ce91 100644 --- a/imap_processing/ultra/l1b/ultra_l1b_culling.py +++ b/imap_processing/ultra/l1b/ultra_l1b_culling.py @@ -880,7 +880,6 @@ def flag_statistical_outliers( # Select counts that have not been flagged in any channel. counts = count_summary[e_idx, ~combined_mask] std_ratio, _ = get_poisson_stats(counts) - std_diff[e_idx] = std_ratio if std_ratio < std_threshold: convergence[e_idx] = True From 733be9b79f4f02233d43e909e8d426b5c33b51e3 Mon Sep 17 00:00:00 2001 From: Luisa Date: Tue, 3 Mar 2026 08:18:42 -0700 Subject: [PATCH 12/15] duplicate lines --- imap_processing/ultra/l1b/extendedspin.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/imap_processing/ultra/l1b/extendedspin.py b/imap_processing/ultra/l1b/extendedspin.py index 21c965082..41eed8642 100644 --- a/imap_processing/ultra/l1b/extendedspin.py +++ b/imap_processing/ultra/l1b/extendedspin.py @@ -151,14 +151,6 @@ def calculate_extendedspin( # is flagged will have the bitflag of all the energy flags combined. voltage_qf = voltage_qf * np.bitwise_or.reduce(energy_bin_flags) # Expand binned quality flags to individual spins. - # high energy and statistical outlier flags are energy dependent - # Collapse them into a single flag array - high_energy_qf = np.bitwise_or.reduce( - high_energy_qf * energy_bin_flags[:, np.newaxis], axis=1 - ) - stat_outliers_qf = np.bitwise_or.reduce( - stat_outliers_qf * energy_bin_flags[:, np.newaxis], axis=1 - ) high_energy_qf = expand_bin_flags_to_spins(len(spin), high_energy_qf, spin_bin_size) voltage_qf = expand_bin_flags_to_spins(len(spin), voltage_qf, spin_bin_size) stat_outliers_qf = expand_bin_flags_to_spins( From efc7ac741b336f2cdca7121038d6f15f82892ad8 Mon Sep 17 00:00:00 2001 From: Luisa Date: Tue, 3 Mar 2026 08:20:13 -0700 Subject: [PATCH 13/15] use default energy ranges for validation test --- .../tests/ultra/unit/test_ultra_l1b_culling.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py b/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py index b56d2411e..19ce455ab 100644 --- a/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py +++ b/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py @@ -871,8 +871,8 @@ def test_validate_stat_cull(): spin_bin_size, ) intervals, _, _ = build_energy_bins() - # Use the actual energy ranges that were used for the test data - energy_ranges = np.array([4.2, 9.4425, 21.2116, 47.2388, 105.202, 316.335]) + # Get the energy ranges + energy_ranges = get_binned_energy_ranges(intervals) mask = np.zeros((len(energy_ranges) - 1, len(spin_tbin_edges) - 1), dtype=bool) flags, con, it, std = flag_statistical_outliers( de_ds, spin_tbin_edges, energy_ranges, mask, 90 @@ -906,12 +906,3 @@ def test_get_binned_energy_ranges(): expected_energy_ranges = np.array([4.2, 9.4425, 21.2116, 47.2388, 105.202, 316.335]) np.testing.assert_array_equal(energy_ranges, expected_energy_ranges) - - -def test_get_binned_energy_ranges(): - """Tests get_binned_energy_ranges function.""" - intervals, _, _ = build_energy_bins() - energy_ranges = get_binned_energy_ranges(intervals) - - expected_energy_ranges = np.array([4.2, 9.4425, 21.2116, 47.2388, 105.202, 316.335]) - np.testing.assert_array_equal(energy_ranges, expected_energy_ranges) From 8fe1c800a3ddbb66b65152cc4079555ffb68a7a0 Mon Sep 17 00:00:00 2001 From: Luisa Date: Tue, 3 Mar 2026 08:29:46 -0700 Subject: [PATCH 14/15] validation file --- imap_processing/tests/external_test_data_config.py | 1 + 1 file changed, 1 insertion(+) diff --git a/imap_processing/tests/external_test_data_config.py b/imap_processing/tests/external_test_data_config.py index 79c13668b..55d30acf8 100644 --- a/imap_processing/tests/external_test_data_config.py +++ b/imap_processing/tests/external_test_data_config.py @@ -153,6 +153,7 @@ ("status_test_data_repoint00047.csv", "ultra/data/l1/"), ("voltage_culling_results_repoint00047.csv", "ultra/data/l1/"), ("validate_high_energy_culling_results_repoint00047_v2.csv", "ultra/data/l1/"), + ("validate_stat_culling_results_repoint00047.csv", "ultra/data/l1/"), ("de_test_data_repoint00047.csv", "ultra/data/l1/"), ("FM45_UltraFM45Extra_TV_Tests_2024-01-22T0930_20240122T093008.CCSDS", "ultra/data/l0/"), ("ultra45_raw_sc_rawnrgevnt_19840122_00.csv", "ultra/data/l0/"), From c60e360c51dc1627e0320413649541e8df2c3e98 Mon Sep 17 00:00:00 2001 From: Luisa Date: Tue, 3 Mar 2026 08:38:51 -0700 Subject: [PATCH 15/15] test comment --- imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py b/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py index 19ce455ab..eef32b6a6 100644 --- a/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py +++ b/imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py @@ -846,7 +846,7 @@ def test_get_poisson_stats(): @pytest.mark.external_test_data def test_validate_stat_cull(): - """Validate that flag_statistical_outliers are correctly flagged""" + """Validate that statistical-outlier quality flags match expected results.""" # read test data from csv files xspin = pd.read_csv(TEST_PATH / "extendedspin_test_data_repoint00047.csv") results_df = pd.read_csv(