-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated CoDICE XTCE files from imap_xtce tool #812
Changes from 2 commits
d7eb035
55fc04b
7a83e52
f6f03c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,6 @@ | |
import xarray as xr | ||
|
||
from imap_processing import imap_module_directory | ||
from imap_processing.codice import constants | ||
from imap_processing.utils import packet_file_to_datasets | ||
|
||
|
||
|
@@ -37,9 +36,20 @@ def decom_packets(packet_file: Path) -> dict[int, xr.Dataset]: | |
packets : dict[int, xarray.Dataset] | ||
Mapping from apid to ``xarray`` dataset, one dataset per apid. | ||
""" | ||
# TODO: Currently need to use the 'old' packet definition for housekeeping | ||
# because the test housekeeping packet has LAST_OPCODE=0, and the | ||
# telemetry definition "STATES" tab doesn't allow for a 0 value for | ||
# this. Need to figure out if the test packet is bad, or the telemetry | ||
# definition is wrong. | ||
if "hskp" in str(packet_file): | ||
xtce_filename = "P_COD_NHK.xml" | ||
else: | ||
xtce_filename = "codice_packet_definition.xml" | ||
xtce_packet_definition = Path( | ||
f"{imap_module_directory}/codice/packet_definitions/{constants.PACKET_TO_XTCE_MAPPING[packet_file.name]}" | ||
f"{imap_module_directory}/codice/packet_definitions/{xtce_filename}" | ||
) | ||
packets: dict[int, xr.Dataset] = packet_file_to_datasets( | ||
packet_file, xtce_packet_definition | ||
) | ||
packets = packet_file_to_datasets(packet_file, xtce_packet_definition) | ||
|
||
return packets | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you return the dataset now without assigning since it's not packets anymore? or this file itself might go away like mine did for SWE and SWAPI once your HK issue is fixed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good call, this should really be called |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an interesting case. Does an Enumeration need to exist for every possible value or should
space_packet_parser
just return the raw_value here and not decode anything rather than raising an error? Gavin might have some insight here as well.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I understand from Gavin's comment in the
xtce
slack channel, it sounds like his preference would be to explicitly define what a value of0
means in the packet definition file. I will ask Joey about this in our next tagup.