Skip to content
Open
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
1 change: 1 addition & 0 deletions imap_processing/ialirt/l0/process_codice.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ def process_codice(
"met_in_utc": met_to_utc(met[0]).split(".")[0],
"ttj2000ns": int(met_to_ttj2000ns(met[0])),
"instrument": f"{sensor}",
"codice_lo_epoch": int(l1a_lo["epoch"]),
f"{sensor}_c_over_o_abundance": l2_lo.c_over_o_abundance,
f"{sensor}_mg_over_o_abundance": l2_lo.mg_over_o_abundance,
f"{sensor}_fe_over_o_abundance": l2_lo.fe_over_o_abundance,
Expand Down
4 changes: 4 additions & 0 deletions imap_processing/ialirt/l0/process_hit.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ def process_hit(xarray_data: xr.Dataset) -> list[dict]:
(grouped_data["group"] == group).values
]
met = int(grouped_data["met"][(grouped_data["group"] == group).values][0])
mid_measurement = (
grouped_data["hit_met"][0] + grouped_data["hit_met"][-1]
) // 2

l1 = create_l1(fast_rate_1, fast_rate_2, slow_rate)

Expand All @@ -172,6 +175,7 @@ def process_hit(xarray_data: xr.Dataset) -> list[dict]:
"met_in_utc": met_to_utc(met).split(".")[0],
"ttj2000ns": int(met_to_ttj2000ns(met)),
"instrument": "hit",
"hit_epoch": int(met_to_ttj2000ns(mid_measurement)),
"hit_e_a_side_low_en": int(l1["IALRT_RATE_1"] + l1["IALRT_RATE_2"]),
"hit_e_a_side_med_en": int(l1["IALRT_RATE_5"] + l1["IALRT_RATE_6"]),
"hit_e_a_side_high_en": int(l1["IALRT_RATE_7"]),
Expand Down
5 changes: 5 additions & 0 deletions imap_processing/ialirt/l0/process_swapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ def process_swapi_ialirt(
grouped_dataset["met"][(grouped_dataset["group"] == group).values][0]
)

mid_measurement = (
grouped_dataset["swapi_acq"][0] + grouped_dataset["swapi_acq"][-1]
) // 2

# Ensure no duplicates and all values from 0 to 11 are present
if not np.array_equal(seq_values.values.astype(int), np.arange(12)):
incomplete_groups.append(group)
Expand Down Expand Up @@ -212,6 +216,7 @@ def process_swapi_ialirt(
"met_in_utc": met_to_utc(met_values).split(".")[0],
"ttj2000ns": int(met_to_ttj2000ns(met_values)),
"instrument": "swapi",
"swapi_epoch": int(met_to_ttj2000ns(mid_measurement)),
"swapi_pseudo_proton_speed": Decimal(f"{pseudo_speed:.3f}"),
"swapi_pseudo_proton_density": Decimal(f"{pseudo_density:.3f}"),
"swapi_pseudo_proton_temperature": Decimal(f"{pseudo_temperature:.3f}"),
Expand Down
2 changes: 1 addition & 1 deletion imap_processing/tests/ialirt/unit/test_process_hit.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_process_spacecraft_packet(sc_packet_path):
)[478]
hit_product = process_hit(sc_xarray_data)

assert len(hit_product[0].keys()) == 17
assert len(hit_product[0].keys()) == 18


def generate_prefixes(prefixes):
Expand Down