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
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ checksum:
FIELDNAM: Checksum
UNITS: " "

idx__sci0aid:
aid:
<<: *trigger_base
CATDESC: Accountability identifier for this event
FIELDNAM: Accountability identifier
Expand Down
11 changes: 9 additions & 2 deletions imap_processing/idex/idex_l1a.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,8 +651,15 @@ def process(self) -> Dataset | None:
# Gather the huge amount of metadata info
trigger_vars = {}
for var, value in self.telemetry_items.items():
trigger_vars[var] = xr.DataArray(
name=var,
# SCI0AID is not updated properly. To this end, TXHDRFSWAIDCOPY must be
# used as the proper AID.
if var == "idx__sci0aid":
continue
# rename idx__txhdrfswaidcopy to aid for better readability in the final
# dataset
var_name = "aid" if var == "idx__txhdrfswaidcopy" else var
trigger_vars[var_name] = xr.DataArray(
name=var_name,
data=[value],
dims=("epoch"),
attrs=idex_attrs.get_variable_attributes(var),
Expand Down
2 changes: 1 addition & 1 deletion imap_processing/idex/idex_l1b.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def idex_l1b(l1a_dataset: xr.Dataset) -> xr.Dataset:
l1a_dataset["idx__txhdrtrigid"].data, idex_attrs
)
# Create l1b Dataset
prefixes = ["shcoarse", "shfine", "time_high_sample", "time_low_sample"]
prefixes = ["shcoarse", "shfine", "time_high_sample", "time_low_sample", "aid"]
data_vars = (
processed_vars
| waveforms_converted
Expand Down
2 changes: 1 addition & 1 deletion imap_processing/tests/idex/test_idex_l0.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_idex_decom_length(decom_test_data_sci: xr.Dataset):
decom_test_data_sci : xarray.Dataset
The dataset to test with
"""
assert len(decom_test_data_sci) == 110
assert len(decom_test_data_sci) == 109


def test_idex_decom_event_num(decom_test_data_sci: xr.Dataset):
Expand Down
3 changes: 3 additions & 0 deletions imap_processing/tests/idex/test_idex_l1a.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def test_validate_l1a_idex_data_variables(
"Ion Grid": "Ion_Grid",
"Time (high sampling)": "time_high_sample_rate",
"Time (low sampling)": "time_low_sample_rate",
"idx__txhdrfswaidcopy": "aid",
}
# The Engineering data is converting to UTC, and the SDC is converting to J2000,
# for 'epoch' and 'Timestamp' so this test is using the raw time value 'SCHOARSE' to
Expand All @@ -168,6 +169,8 @@ def test_validate_l1a_idex_data_variables(
"event",
"Time (high sampling)",
"Time (low sampling)",
"IDX__SCI0AID", # This is dropped because it is invalid
"IDX__TXHDRFSWAIDCOPY", # this is renamed to aid
]

# loop through all keys from the l1a example dict
Expand Down
2 changes: 2 additions & 0 deletions imap_processing/tests/idex/test_idex_l1b.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,8 @@ def test_validate_l1b_idex_data_variables(
"FIFODelay_M",
"HSPosttriggerBlocks",
]
# assert that "aid" is in l1b
assert "aid" in l1b_dataset, "The array 'aid' is missing from the l1b dataset."
# select only the first n events
l1b_example_data = l1b_example_data.isel(
event=np.arange(l1b_dataset.sizes["epoch"])
Expand Down
Loading