|
1 | 1 | """Functions to support HIT processing.""" |
2 | 2 |
|
3 | 3 | import logging |
| 4 | +from decimal import Decimal |
4 | 5 |
|
5 | 6 | import numpy as np |
6 | 7 | import xarray as xr |
@@ -196,18 +197,26 @@ def process_hit(xarray_data: xr.Dataset) -> list[dict]: |
196 | 197 | | { |
197 | 198 | "instrument": "hit", |
198 | 199 | "hit_epoch": int(met_to_ttj2000ns(mid_measurement)), |
199 | | - "hit_e_a_side_low_en": int(l1["IALRT_RATE_1"] + l1["IALRT_RATE_2"]), |
200 | | - "hit_e_a_side_med_en": int(l1["IALRT_RATE_5"] + l1["IALRT_RATE_6"]), |
201 | | - "hit_e_a_side_high_en": int(l1["IALRT_RATE_7"]), |
202 | | - "hit_e_b_side_low_en": int(l1["IALRT_RATE_11"] + l1["IALRT_RATE_12"]), |
203 | | - "hit_e_b_side_med_en": int(l1["IALRT_RATE_15"] + l1["IALRT_RATE_16"]), |
204 | | - "hit_e_b_side_high_en": int(l1["IALRT_RATE_17"]), |
205 | | - "hit_h_omni_low_en": int(l1["H_06_08"]), |
206 | | - "hit_h_omni_med_en": int(l1["H_12_15"]), |
207 | | - "hit_h_a_side_high_en": int(l1["IALRT_RATE_8"]), |
208 | | - "hit_h_b_side_high_en": int(l1["IALRT_RATE_18"]), |
209 | | - "hit_he_omni_low_en": int(l1["HE4_06_08"]), |
210 | | - "hit_he_omni_high_en": int(l1["HE4_15_70"]), |
| 200 | + "hit_e_a_side_low_en": Decimal( |
| 201 | + f"{l1['IALRT_RATE_1'] + l1['IALRT_RATE_2']:.3f}" |
| 202 | + ), |
| 203 | + "hit_e_a_side_med_en": Decimal( |
| 204 | + f"{l1['IALRT_RATE_5'] + l1['IALRT_RATE_6']:.3f}" |
| 205 | + ), |
| 206 | + "hit_e_a_side_high_en": Decimal(f"{l1['IALRT_RATE_7']:.3f}"), |
| 207 | + "hit_e_b_side_low_en": Decimal( |
| 208 | + f"{l1['IALRT_RATE_11'] + l1['IALRT_RATE_12']:.3f}" |
| 209 | + ), |
| 210 | + "hit_e_b_side_med_en": Decimal( |
| 211 | + f"{l1['IALRT_RATE_15'] + l1['IALRT_RATE_16']:.3f}" |
| 212 | + ), |
| 213 | + "hit_e_b_side_high_en": Decimal(f"{l1['IALRT_RATE_17']:.3f}"), |
| 214 | + "hit_h_omni_low_en": Decimal(f"{l1['H_06_08']:.3f}"), |
| 215 | + "hit_h_omni_med_en": Decimal(f"{l1['H_12_15']:.3f}"), |
| 216 | + "hit_h_a_side_high_en": Decimal(f"{l1['IALRT_RATE_8']:.3f}"), |
| 217 | + "hit_h_b_side_high_en": Decimal(f"{l1['IALRT_RATE_18']:.3f}"), |
| 218 | + "hit_he_omni_low_en": Decimal(f"{l1['HE4_06_08']:.3f}"), |
| 219 | + "hit_he_omni_high_en": Decimal(f"{l1['HE4_15_70']:.3f}"), |
211 | 220 | } |
212 | 221 | ) |
213 | 222 |
|
|
0 commit comments