Skip to content
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

IMAP-Hi XTCE and initial Decom work #282

Merged
merged 1 commit into from
Nov 20, 2023
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
Empty file added imap_processing/hi/__init__.py
Empty file.
456 changes: 456 additions & 0 deletions imap_processing/hi/packet_definitions/H45_APP_NHK.xml

Large diffs are not rendered by default.

112 changes: 112 additions & 0 deletions imap_processing/hi/packet_definitions/H45_SCI_CNT.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?xml version='1.0' encoding='utf-8'?>
<xtce:SpaceSystem xmlns:xtce="http://www.omg.org/space/xtce" name="H45_SCI_CNT">
<xtce:Header date="2023-11" version="1.0" author="IMAP SDC" />
<xtce:TelemetryMetaData>
<xtce:ParameterTypeSet>
<xtce:IntegerParameterType name="UINT1" signed="false">
<xtce:IntegerDataEncoding sizeInBits="1" encoding="unsigned" />
</xtce:IntegerParameterType>
<xtce:IntegerParameterType name="UINT2" signed="false">
<xtce:IntegerDataEncoding sizeInBits="2" encoding="unsigned" />
</xtce:IntegerParameterType>
<xtce:IntegerParameterType name="UINT3" signed="false">
<xtce:IntegerDataEncoding sizeInBits="3" encoding="unsigned" />
</xtce:IntegerParameterType>
<xtce:IntegerParameterType name="UINT11" signed="false">
<xtce:IntegerDataEncoding sizeInBits="11" encoding="unsigned" />
</xtce:IntegerParameterType>
<xtce:IntegerParameterType name="UINT14" signed="false">
<xtce:IntegerDataEncoding sizeInBits="14" encoding="unsigned" />
</xtce:IntegerParameterType>
<xtce:IntegerParameterType name="UINT16" signed="false">
<xtce:IntegerDataEncoding sizeInBits="16" encoding="unsigned" />
</xtce:IntegerParameterType>
<xtce:IntegerParameterType name="UINT32" signed="false">
<xtce:IntegerDataEncoding sizeInBits="32" encoding="unsigned" />
</xtce:IntegerParameterType>
<xtce:BinaryParameterType name="BYTE25920">
<xtce:UnitSet />
<xtce:BinaryDataEncoding bitOrder="mostSignificantBitFirst">
<xtce:SizeInBits>
<xtce:FixedValue>25920</xtce:FixedValue>
</xtce:SizeInBits>
</xtce:BinaryDataEncoding>
</xtce:BinaryParameterType>
</xtce:ParameterTypeSet>
<xtce:ParameterSet>
<xtce:Parameter name="VERSION" parameterTypeRef="UINT3">
<xtce:LongDescription>CCSDS Packet Version Number (always 0)</xtce:LongDescription>
</xtce:Parameter>
<xtce:Parameter name="TYPE" parameterTypeRef="UINT1">
<xtce:LongDescription>CCSDS Packet Type Indicator (0=telemetry)</xtce:LongDescription>
</xtce:Parameter>
<xtce:Parameter name="SEC_HDR_FLG" parameterTypeRef="UINT1">
<xtce:LongDescription>CCSDS Packet Secondary Header Flag (always 1)</xtce:LongDescription>
</xtce:Parameter>
<xtce:Parameter name="PKT_APID" parameterTypeRef="UINT11">
<xtce:LongDescription>CCSDS Packet Application Process ID</xtce:LongDescription>
</xtce:Parameter>
<xtce:Parameter name="SEQ_FLGS" parameterTypeRef="UINT2">
<xtce:LongDescription>CCSDS Packet Grouping Flags (3=not part of group)</xtce:LongDescription>
</xtce:Parameter>
<xtce:Parameter name="SRC_SEQ_CTR" parameterTypeRef="UINT14">
<xtce:LongDescription>CCSDS Packet Sequence Count (increments with each new packet)</xtce:LongDescription>
</xtce:Parameter>
<xtce:Parameter name="PKT_LEN" parameterTypeRef="UINT16">
<xtce:LongDescription>CCSDS Packet Length (number of bytes after Packet length minus 1)</xtce:LongDescription>
</xtce:Parameter>
<xtce:Parameter name="CCSDS_MET" parameterTypeRef="UINT32">
<xtce:ShortDescription>Mission elapsed time</xtce:ShortDescription>
<xtce:LongDescription>Mission elapsed time</xtce:LongDescription>
</xtce:Parameter>
<xtce:Parameter name="ESA_STEP" parameterTypeRef="UINT16">
<xtce:ShortDescription>Lower 4-bits represent the ESA Step Number:
4-bit ESA Step Enumeration
12-bit Start of Acquisition Time</xtce:ShortDescription>
<xtce:LongDescription>Lower 4-bits represent the ESA Step Number:
4-bit ESA Step Enumeration
12-bit Start of Acquisition Time</xtce:LongDescription>
</xtce:Parameter>
<xtce:Parameter name="COUNTERS" parameterTypeRef="BYTE25920">
<xtce:ShortDescription>An array of 90 counters, each counter being 12-bits:
8 12-bit qualified counters (AB, C1C2, AC1, BC1, ABC1, AC1C2, BC1C2, ABC1C2);
11 12-bit long counters (A, B, C, AB, C1C2, AC1, BC1, ABC1, AC1C2, BC1C2, ABC1C2);
5 12-bit counters (totalA, totalB, totalC, FEE_DE_SENT, FEE_DE_RECD)</xtce:ShortDescription>
<xtce:LongDescription>An array of 90 counters, each counter being 12-bits:
8 12-bit qualified counters (AB, C1C2, AC1, BC1, ABC1, AC1C2, BC1C2, ABC1C2);
11 12-bit long counters (A, B, C, AB, C1C2, AC1, BC1, ABC1, AC1C2, BC1C2, ABC1C2);
5 12-bit counters (totalA, totalB, totalC, FEE_DE_SENT, FEE_DE_RECD)</xtce:LongDescription>
</xtce:Parameter>
<xtce:Parameter name="CKSUM" parameterTypeRef="UINT16">
<xtce:ShortDescription>Packet Checksum</xtce:ShortDescription>
<xtce:LongDescription>Packet Checksum</xtce:LongDescription>
</xtce:Parameter>
</xtce:ParameterSet>
<xtce:ContainerSet>
<xtce:SequenceContainer name="CCSDSPacket">
<xtce:EntryList>
<xtce:ParameterRefEntry parameterRef="VERSION" />
<xtce:ParameterRefEntry parameterRef="TYPE" />
<xtce:ParameterRefEntry parameterRef="SEC_HDR_FLG" />
<xtce:ParameterRefEntry parameterRef="PKT_APID" />
<xtce:ParameterRefEntry parameterRef="SEQ_FLGS" />
<xtce:ParameterRefEntry parameterRef="SRC_SEQ_CTR" />
<xtce:ParameterRefEntry parameterRef="PKT_LEN" />
</xtce:EntryList>
</xtce:SequenceContainer>
<xtce:SequenceContainer name="H45_SCI_CNT">
<xtce:BaseContainer containerRef="CCSDSPacket">
<xtce:RestrictionCriteria>
<xtce:Comparison parameterRef="PKT_APID" value="769" useCalibratedValue="false" />
</xtce:RestrictionCriteria>
</xtce:BaseContainer>
<xtce:EntryList>
<xtce:ParameterRefEntry parameterRef="CCSDS_MET" />
<xtce:ParameterRefEntry parameterRef="ESA_STEP" />
<xtce:ParameterRefEntry parameterRef="COUNTERS" />
<xtce:ParameterRefEntry parameterRef="CKSUM" />
</xtce:EntryList>
</xtce:SequenceContainer>
</xtce:ContainerSet>
</xtce:TelemetryMetaData>
</xtce:SpaceSystem>
108 changes: 108 additions & 0 deletions imap_processing/hi/packet_definitions/H45_SCI_DE.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?xml version='1.0' encoding='utf-8'?>
<xtce:SpaceSystem xmlns:xtce="http://www.omg.org/space/xtce" name="H45_SCI_DE">
<xtce:Header date="2023-11" version="1.0" author="IMAP SDC" />
<xtce:TelemetryMetaData>
<xtce:ParameterTypeSet>
<xtce:IntegerParameterType name="UINT1" signed="false">
<xtce:IntegerDataEncoding sizeInBits="1" encoding="unsigned" />
</xtce:IntegerParameterType>
<xtce:IntegerParameterType name="UINT2" signed="false">
<xtce:IntegerDataEncoding sizeInBits="2" encoding="unsigned" />
</xtce:IntegerParameterType>
<xtce:IntegerParameterType name="UINT3" signed="false">
<xtce:IntegerDataEncoding sizeInBits="3" encoding="unsigned" />
</xtce:IntegerParameterType>
<xtce:IntegerParameterType name="UINT11" signed="false">
<xtce:IntegerDataEncoding sizeInBits="11" encoding="unsigned" />
</xtce:IntegerParameterType>
<xtce:IntegerParameterType name="UINT14" signed="false">
<xtce:IntegerDataEncoding sizeInBits="14" encoding="unsigned" />
</xtce:IntegerParameterType>
<xtce:IntegerParameterType name="UINT16" signed="false">
<xtce:IntegerDataEncoding sizeInBits="16" encoding="unsigned" />
</xtce:IntegerParameterType>
<xtce:IntegerParameterType name="UINT32" signed="false">
<xtce:IntegerDataEncoding sizeInBits="32" encoding="unsigned" />
</xtce:IntegerParameterType>
<xtce:BinaryParameterType name="BYTE31920">
<xtce:UnitSet />
<xtce:BinaryDataEncoding bitOrder="mostSignificantBitFirst">
<xtce:SizeInBits>
<xtce:FixedValue>31920</xtce:FixedValue>
</xtce:SizeInBits>
</xtce:BinaryDataEncoding>
</xtce:BinaryParameterType>
</xtce:ParameterTypeSet>
<xtce:ParameterSet>
<xtce:Parameter name="VERSION" parameterTypeRef="UINT3">
<xtce:LongDescription>CCSDS Packet Version Number (always 0)</xtce:LongDescription>
</xtce:Parameter>
<xtce:Parameter name="TYPE" parameterTypeRef="UINT1">
<xtce:LongDescription>CCSDS Packet Type Indicator (0=telemetry)</xtce:LongDescription>
</xtce:Parameter>
<xtce:Parameter name="SEC_HDR_FLG" parameterTypeRef="UINT1">
<xtce:LongDescription>CCSDS Packet Secondary Header Flag (always 1)</xtce:LongDescription>
</xtce:Parameter>
<xtce:Parameter name="PKT_APID" parameterTypeRef="UINT11">
<xtce:LongDescription>CCSDS Packet Application Process ID</xtce:LongDescription>
</xtce:Parameter>
<xtce:Parameter name="SEQ_FLGS" parameterTypeRef="UINT2">
<xtce:LongDescription>CCSDS Packet Grouping Flags (3=not part of group)</xtce:LongDescription>
</xtce:Parameter>
<xtce:Parameter name="SRC_SEQ_CTR" parameterTypeRef="UINT14">
<xtce:LongDescription>CCSDS Packet Sequence Count (increments with each new packet)</xtce:LongDescription>
</xtce:Parameter>
<xtce:Parameter name="PKT_LEN" parameterTypeRef="UINT16">
<xtce:LongDescription>CCSDS Packet Length (number of bytes after Packet length minus 1)</xtce:LongDescription>
</xtce:Parameter>
<xtce:Parameter name="CCSDS_MET" parameterTypeRef="UINT32">
<xtce:ShortDescription>Mission elapsed time</xtce:ShortDescription>
<xtce:LongDescription>Mission elapsed time</xtce:LongDescription>
</xtce:Parameter>
<xtce:Parameter name="SPARE" parameterTypeRef="UINT32">
<xtce:ShortDescription>Spare</xtce:ShortDescription>
<xtce:LongDescription>Spare Field
4-bits allocated for META_DE</xtce:LongDescription>
</xtce:Parameter>
<xtce:Parameter name="DE_TOF" parameterTypeRef="BYTE31920">
<xtce:ShortDescription>Direct Event TOF Data</xtce:ShortDescription>
<xtce:LongDescription>Direct Event TOF Data (665 x 48 bit array)
de_tag - 16 bits
start_bitmask_data - 2 bits (tA=1, tB=2, tC1=3, META=4)
tof_1 - 10 bit counter
tof_2 - 10 bit counter
tof_3 - 10 bit counter</xtce:LongDescription>
</xtce:Parameter>
<xtce:Parameter name="CKSUM" parameterTypeRef="UINT16">
<xtce:ShortDescription>Packet Checksum</xtce:ShortDescription>
<xtce:LongDescription>Packet Checksum</xtce:LongDescription>
</xtce:Parameter>
</xtce:ParameterSet>
<xtce:ContainerSet>
<xtce:SequenceContainer name="CCSDSPacket">
<xtce:EntryList>
<xtce:ParameterRefEntry parameterRef="VERSION" />
<xtce:ParameterRefEntry parameterRef="TYPE" />
<xtce:ParameterRefEntry parameterRef="SEC_HDR_FLG" />
<xtce:ParameterRefEntry parameterRef="PKT_APID" />
<xtce:ParameterRefEntry parameterRef="SEQ_FLGS" />
<xtce:ParameterRefEntry parameterRef="SRC_SEQ_CTR" />
<xtce:ParameterRefEntry parameterRef="PKT_LEN" />
</xtce:EntryList>
</xtce:SequenceContainer>
<xtce:SequenceContainer name="H45_SCI_DE">
<xtce:BaseContainer containerRef="CCSDSPacket">
<xtce:RestrictionCriteria>
<xtce:Comparison parameterRef="PKT_APID" value="770" useCalibratedValue="false" />
</xtce:RestrictionCriteria>
</xtce:BaseContainer>
<xtce:EntryList>
<xtce:ParameterRefEntry parameterRef="CCSDS_MET" />
<xtce:ParameterRefEntry parameterRef="SPARE" />
<xtce:ParameterRefEntry parameterRef="DE_TOF" />
<xtce:ParameterRefEntry parameterRef="CKSUM" />
</xtce:EntryList>
</xtce:SequenceContainer>
</xtce:ContainerSet>
</xtce:TelemetryMetaData>
</xtce:SpaceSystem>
Empty file.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
54 changes: 54 additions & 0 deletions imap_processing/hi/tests/l0_test_data/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#README

This folder contains the following files:

1) H45_APP_NHK.bin, H45_SCI_DE.bin, H45_SCI_CNT.bin
2) 20231026_H45_APP_NHK.csv
3) 20231026_H45_SCI_DE.csv
4) 20231026_H45_SCI_CNT.csv


1) Three Binary files that the following Packets are contained inside of H45_CCSDS_PACKETS.zip:

a) 20231026_H45_APP_NHK.bin -> 100 H45_APP_NHK CCSDS packets in a binary file

b) 20231026_H45_SCI_DE.bin -> 100 H45_SCI_DE CCSDS packets in a binary file

c) 20231026_H45_SCI_CNT.bin -> 100 H45_SCI_DE_CCSDS packets in a binary file

Each packet contains the 6-byte CCSDS Primary Header. The primary header
contains the following fields:
CCSDS_VER -> 3 bits
CCSDS_PKT_TYP -> 1 bits
CCSDS_SEC_HDR_FLAG -> 1 bits
CCSDS_APID -> 11 bits
CCSDS_GRP_FLAGS -> 2 bits
CCSDS_SSC -> 14 bits
CCSDS_PKT_DATA_LN -> 16 bits*

*The CCSDS_PKT_DATA_LN field is defined to be as:
"Data size, number of bytes following the 'Packet Length'
(SCLK Size + Data Size) minus 1"

2) 20231026_H45_APP_NHK.csv

This CSV file contains all the fields and values of the NHK packet. There are 100 entries
which represent 100 NHK packets. All of the column headers are the name of the fields in the H45_APP_NHK packet which is defined in the 28650.02_TLMDEF.xlsx spreadsheet.

3) 20231026_H45_SCI_DE.csv
This CSV file contains the pertinent DE_TOF data (not all fields of the packets). The column headers are as follows:
- DE Time Tag: A randomly sampled 16-bit integer.
- Start Bit Mask: A randomly sampled 2-bit integer.
- TOF1: A 10-bit value that is randomly sampled from a normal distribution.
- TOF2: A 10-bit value that is randomly sampled from a normal distribution.
- TOF3: A 10-bit value that is randomly sampled from a normal distribution.

4) 20231026_H45_SCI_CNT.csv
This CSV file contains the pertinent 12-bit counter data (not all the fields in the packets). The column headers are as follows:
- 8 12-bit counters prefixed with "SH_": These are 12-bit values randomly sampled from a normal distribution.
- 11 12-bit counters prefixed with "LSH_": These are 12-bit values randomly sampled from a normal distribution.
- totalA: 12-bit value randomly sampled from normal distribution
- totalB: 12-bit value randomly sampled from normal distribution
- totalC: 12-bit value randomly sampled from normal distribution
- FEE_DE_SENT: 12-bit value randomly sampled from normal distribution
- FEE_DE_RECD: 12-bit value randomly sampled from normal distribution
Loading
Loading