Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions imap_processing/cdf/config/imap_hi_variable_attrs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,21 +161,21 @@ hi_de_spin_invalids:
hi_de_esa_step:
<<: *hi_esa_step

hi_de_meta_seconds:
hi_de_esa_step_seconds:
<<: *default_uint32
CATDESC: Coarse mission elapsed time (MET) of last meta-event
CATDESC: Coarse mission elapsed time (MET) of when the ESA was stepped
DISPLAY_TYPE: time_series
FIELDNAM: Coarse Meta-event MET
LABLAXIS: Coarse Meta MET
FIELDNAM: Coarse ESA step MET
LABLAXIS: Coarse ESA step MET
UNITS: seconds
VAR_TYPE: support_data

hi_de_meta_subseconds:
hi_de_esa_step_milliseconds:
<<: *default_uint16
CATDESC: Fine mission elapsed time (MET) of last meta-event
CATDESC: Fine mission elapsed time (MET) of when the ESA was stepped
DISPLAY_TYPE: time_series
FIELDNAM: Fine Meta-event MET
LABLAXIS: Fine Meta MET
FIELDNAM: Fine ESA step MET
LABLAXIS: Fine ESA step MET
UNITS: ms
VAR_TYPE: support_data

Expand Down
8 changes: 4 additions & 4 deletions imap_processing/hi/hi_l1a.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ def finish_de_dataset(packets_data: xr.Dataset) -> xr.Dataset:
"last_spin_num": "last_spin_num",
"spin_invalids": "spin_invalids",
"esa_step_num": "esa_step",
"meta_seconds": "meta_seconds",
"meta_subseconds": "meta_subseconds",
"esa_step_seconds": "esa_step_seconds",
"esa_step_milliseconds": "esa_step_milliseconds",
}.items():
de_data_dict[to_key] = packets_data[from_key].data

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

# Compute the meta-event MET in seconds
meta_event_met = (
np.array(de_data_dict["meta_seconds"]).astype(np.float64)
+ np.array(de_data_dict["meta_subseconds"]) * MILLISECOND_TO_S
np.array(de_data_dict["esa_step_seconds"]).astype(np.float64)
+ np.array(de_data_dict["esa_step_milliseconds"]) * MILLISECOND_TO_S
)
# Compute the MET of each event in seconds
# event MET = meta_event_met + de_clock
Expand Down
4 changes: 2 additions & 2 deletions imap_processing/hi/hi_l1b.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ def annotate_direct_events(l1a_dataset: xr.Dataset) -> xr.Dataset:
"pkt_len",
"last_spin_num",
"spin_invalids",
"meta_seconds",
"meta_subseconds",
"esa_step_seconds",
"esa_step_milliseconds",
"tof_1",
"tof_2",
"tof_3",
Expand Down
256 changes: 218 additions & 38 deletions imap_processing/hi/packet_definitions/TLM_HI_COMBINED_SCI.xml

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions imap_processing/tests/hi/test_hi_l1c.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@

@pytest.fixture(scope="module")
def hi_test_cal_prod_config_path(hi_l1_test_data_path):
return (
hi_l1_test_data_path / "imap_his_pset-calibration-prod-config_20240101_v001.csv"
)
return hi_l1_test_data_path / "imap_hi_90sensor-cal-prod_20240101_v001.csv"


@mock.patch("imap_processing.hi.hi_l1c.generate_pset_dataset")
Expand Down
4 changes: 2 additions & 2 deletions imap_processing/tests/hi/test_l1a.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ def test_create_de_dataset():
"last_spin_num": np.arange(n_packets) + 3,
"spin_invalids": np.zeros(n_packets),
"esa_step": np.full(n_packets, 4),
"meta_seconds": np.arange(n_packets) + 433522960,
"meta_subseconds": np.full(n_packets, 500),
"esa_step_seconds": np.arange(n_packets) + 433522960,
"esa_step_milliseconds": np.full(n_packets, 500),
"trigger_id": [1 + i % 3 for i in range(n_events)],
"tof_1": [450] * n_events,
"tof_2": [450] * n_events,
Expand Down