Skip to content

Commit a1a8f60

Browse files
authored
I-ALiRT - Hit data access (#2909)
1 parent 36b3859 commit a1a8f60

2 files changed

Lines changed: 9 additions & 17 deletions

File tree

imap_processing/ialirt/l0/process_hit.py

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
find_groups,
1212
)
1313
from imap_processing.ialirt.utils.time import calculate_time
14-
from imap_processing.spice.time import met_to_ttj2000ns, met_to_utc
14+
from imap_processing.spice.time import met_to_ttj2000ns
1515

1616
logger = logging.getLogger(__name__)
1717

@@ -132,6 +132,7 @@ def process_hit(xarray_data: xr.Dataset) -> list[dict]:
132132
"""
133133
hit_data = []
134134
incomplete_groups = []
135+
status_groups = []
135136

136137
# Subsecond time conversion specified in 7516-9054 GSW-FSW ICD.
137138
# Value of SCLK subseconds, unsigned, (LSB = 1/256 sec)
@@ -151,12 +152,7 @@ def process_hit(xarray_data: xr.Dataset) -> list[dict]:
151152
]
152153

153154
if np.any(status_values == 0):
154-
logger.info(
155-
f"Off-nominal value detected at "
156-
f"missing or duplicate pkt_counter values: "
157-
f"{group}"
158-
)
159-
continue
155+
status_groups.append(group)
160156

161157
# Subcom values for the group should be 0-59 with no duplicates.
162158
subcom_values = grouped_data["hit_subcom"][
@@ -172,14 +168,6 @@ def process_hit(xarray_data: xr.Dataset) -> list[dict]:
172168
grouped_data["hit_met"][(grouped_data["group"] == group).values].values[0]
173169
)
174170

175-
status_values = grouped_data["hit_status"][
176-
(grouped_data["group"] == group).values
177-
]
178-
179-
if np.any(status_values == 0):
180-
logger.info(f"Off-nominal value detected at {met_to_utc(hit_met)}")
181-
continue
182-
183171
fast_rate_1 = grouped_data["hit_fast_rate_1"][
184172
(grouped_data["group"] == group).values
185173
]
@@ -227,5 +215,9 @@ def process_hit(xarray_data: xr.Dataset) -> list[dict]:
227215
f"missing or duplicate pkt_counter values: "
228216
f"{incomplete_groups}"
229217
)
218+
if status_groups:
219+
logger.warning(
220+
f"The following hit groups have zero status values: {status_groups}"
221+
)
230222

231223
return hit_data

imap_processing/tests/ialirt/unit/test_process_hit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,13 @@ def test_process_hit(xarray_data, caplog):
172172

173173
# Tests that it functions normally
174174
hit_product = process_hit(xarray_data)
175-
assert len(hit_product) == 1
175+
assert len(hit_product) == 15
176176

177177
assert hit_product[0]["hit_e_a_side_low_en"] == 0
178178
assert hit_product[0]["hit_e_a_side_med_en"] == 0
179179
assert hit_product[0]["hit_e_b_side_low_en"] == 0
180180
assert hit_product[0]["hit_e_b_side_high_en"] == 0
181-
assert hit_product[0]["hit_e_b_side_med_en"] == 1
181+
assert hit_product[0]["hit_e_b_side_med_en"] == 0
182182
assert hit_product[0]["hit_he_omni_high_en"] == 0
183183

184184

0 commit comments

Comments
 (0)