|
4 | 4 | import pandas as pd |
5 | 5 | import pytest |
6 | 6 |
|
7 | | -from imap_processing import imap_module_directory |
8 | 7 | from imap_processing.ultra.l0.ultra_utils import ENERGY_RATES_KEYS, ULTRA_ENERGY_RATES |
9 | 8 |
|
10 | 9 |
|
@@ -49,46 +48,3 @@ def test_image_rate_decom(decom_test_data, energy_rates_test_path): |
49 | 48 | for name in ENERGY_RATES_KEYS: |
50 | 49 | arr.append(decom_ultra[name][total_packets - 1]) |
51 | 50 | assert expected_arrn == arr |
52 | | - |
53 | | - |
54 | | -@pytest.mark.parametrize( |
55 | | - "decom_test_data", |
56 | | - [ |
57 | | - pytest.param( |
58 | | - { |
59 | | - "apid": ULTRA_ENERGY_RATES.apid[0], |
60 | | - "filename": "FM45_UltraFM45_Functional_2024-01-22T0105_" |
61 | | - "20240122T010548.CCSDS", |
62 | | - } |
63 | | - ) |
64 | | - ], |
65 | | - indirect=True, |
66 | | -) |
67 | | -def test_image_rate_decom_zero_width(decom_test_data): |
68 | | - """This function tests for cases in which the width is zero within the packet.""" |
69 | | - test_path = ( |
70 | | - imap_module_directory |
71 | | - / "tests" |
72 | | - / "ultra" |
73 | | - / "data" |
74 | | - / "l0" |
75 | | - / "ultra45_raw_sc_ultraimgrates_20220530_00.csv" |
76 | | - ) |
77 | | - |
78 | | - decom_ultra = decom_test_data |
79 | | - |
80 | | - df = pd.read_csv(test_path, index_col="MET") |
81 | | - total_packets = 163 |
82 | | - |
83 | | - np.testing.assert_array_equal(df.SID, decom_ultra["sid"]) |
84 | | - np.testing.assert_array_equal(df.Spin, decom_ultra["spin"]) |
85 | | - np.testing.assert_array_equal(df.AbortFlag, decom_ultra["abortflag"]) |
86 | | - np.testing.assert_array_equal(df.StartDelay, decom_ultra["startdelay"]) |
87 | | - |
88 | | - for i in range(total_packets): |
89 | | - t = int(df["SequenceCount"].iloc[i]) # Ensure we get an integer value |
90 | | - expected_arr = json.loads(df.loc[df["SequenceCount"] == t, "Counts"].values[0]) |
91 | | - arr = [] |
92 | | - for name in ENERGY_RATES_KEYS: |
93 | | - arr.append(decom_ultra[name][i]) |
94 | | - assert expected_arr == arr |
0 commit comments