Skip to content

Commit 0c755e1

Browse files
authored
Add new xtce file for Hi packet definitions that includes new MEMDMP packets for HI90 and HI45 (#1866)
Update L1A DE field name to match change in xtce packet definition Rename Hi L1C calibration file to match expected
1 parent b4b02d0 commit 0c755e1

7 files changed

Lines changed: 235 additions & 57 deletions

File tree

imap_processing/cdf/config/imap_hi_variable_attrs.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,21 +161,21 @@ hi_de_spin_invalids:
161161
hi_de_esa_step:
162162
<<: *hi_esa_step
163163

164-
hi_de_meta_seconds:
164+
hi_de_esa_step_seconds:
165165
<<: *default_uint32
166-
CATDESC: Coarse mission elapsed time (MET) of last meta-event
166+
CATDESC: Coarse mission elapsed time (MET) of when the ESA was stepped
167167
DISPLAY_TYPE: time_series
168-
FIELDNAM: Coarse Meta-event MET
169-
LABLAXIS: Coarse Meta MET
168+
FIELDNAM: Coarse ESA step MET
169+
LABLAXIS: Coarse ESA step MET
170170
UNITS: seconds
171171
VAR_TYPE: support_data
172172

173-
hi_de_meta_subseconds:
173+
hi_de_esa_step_milliseconds:
174174
<<: *default_uint16
175-
CATDESC: Fine mission elapsed time (MET) of last meta-event
175+
CATDESC: Fine mission elapsed time (MET) of when the ESA was stepped
176176
DISPLAY_TYPE: time_series
177-
FIELDNAM: Fine Meta-event MET
178-
LABLAXIS: Fine Meta MET
177+
FIELDNAM: Fine ESA step MET
178+
LABLAXIS: Fine ESA step MET
179179
UNITS: ms
180180
VAR_TYPE: support_data
181181

imap_processing/hi/hi_l1a.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ def finish_de_dataset(packets_data: xr.Dataset) -> xr.Dataset:
170170
"last_spin_num": "last_spin_num",
171171
"spin_invalids": "spin_invalids",
172172
"esa_step_num": "esa_step",
173-
"meta_seconds": "meta_seconds",
174-
"meta_subseconds": "meta_subseconds",
173+
"esa_step_seconds": "esa_step_seconds",
174+
"esa_step_milliseconds": "esa_step_milliseconds",
175175
}.items():
176176
de_data_dict[to_key] = packets_data[from_key].data
177177

@@ -228,8 +228,8 @@ def create_de_dataset(de_data_dict: dict[str, npt.ArrayLike]) -> xr.Dataset:
228228

229229
# Compute the meta-event MET in seconds
230230
meta_event_met = (
231-
np.array(de_data_dict["meta_seconds"]).astype(np.float64)
232-
+ np.array(de_data_dict["meta_subseconds"]) * MILLISECOND_TO_S
231+
np.array(de_data_dict["esa_step_seconds"]).astype(np.float64)
232+
+ np.array(de_data_dict["esa_step_milliseconds"]) * MILLISECOND_TO_S
233233
)
234234
# Compute the MET of each event in seconds
235235
# event MET = meta_event_met + de_clock

imap_processing/hi/hi_l1b.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ def annotate_direct_events(l1a_dataset: xr.Dataset) -> xr.Dataset:
169169
"pkt_len",
170170
"last_spin_num",
171171
"spin_invalids",
172-
"meta_seconds",
173-
"meta_subseconds",
172+
"esa_step_seconds",
173+
"esa_step_milliseconds",
174174
"tof_1",
175175
"tof_2",
176176
"tof_3",

imap_processing/hi/packet_definitions/TLM_HI_COMBINED_SCI.xml

Lines changed: 218 additions & 38 deletions
Large diffs are not rendered by default.

imap_processing/tests/hi/data/l1/imap_his_pset-calibration-prod-config_20240101_v001.csv renamed to imap_processing/tests/hi/data/l1/imap_hi_90sensor-cal-prod_20240101_v001.csv

File renamed without changes.

imap_processing/tests/hi/test_hi_l1c.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919

2020
@pytest.fixture(scope="module")
2121
def hi_test_cal_prod_config_path(hi_l1_test_data_path):
22-
return (
23-
hi_l1_test_data_path / "imap_his_pset-calibration-prod-config_20240101_v001.csv"
24-
)
22+
return hi_l1_test_data_path / "imap_hi_90sensor-cal-prod_20240101_v001.csv"
2523

2624

2725
@mock.patch("imap_processing.hi.hi_l1c.generate_pset_dataset")

imap_processing/tests/hi/test_l1a.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ def test_create_de_dataset():
157157
"last_spin_num": np.arange(n_packets) + 3,
158158
"spin_invalids": np.zeros(n_packets),
159159
"esa_step": np.full(n_packets, 4),
160-
"meta_seconds": np.arange(n_packets) + 433522960,
161-
"meta_subseconds": np.full(n_packets, 500),
160+
"esa_step_seconds": np.arange(n_packets) + 433522960,
161+
"esa_step_milliseconds": np.full(n_packets, 500),
162162
"trigger_id": [1 + i % 3 for i in range(n_events)],
163163
"tof_1": [450] * n_events,
164164
"tof_2": [450] * n_events,

0 commit comments

Comments
 (0)