Skip to content

Commit ec8db51

Browse files
laspsandovalLaura Sandoval
andauthored
Co-authored-by: Laura Sandoval <laurasandoval@Lauras-MacBook-Pro.local>
1 parent 61d71db commit ec8db51

1 file changed

Lines changed: 21 additions & 12 deletions

File tree

imap_processing/ialirt/l0/process_hit.py

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Functions to support HIT processing."""
22

33
import logging
4+
from decimal import Decimal
45

56
import numpy as np
67
import xarray as xr
@@ -196,18 +197,26 @@ def process_hit(xarray_data: xr.Dataset) -> list[dict]:
196197
| {
197198
"instrument": "hit",
198199
"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}"),
211220
}
212221
)
213222

0 commit comments

Comments
 (0)