-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
…ture CDK development too.
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.
I think we should try and clarify how we want this to work in practice. Because I see this is actually 2 separate items in the PR?
- The packet parsing example for SWE
- The Docker setup
For (1) I think we should make this a pip installable package, and start adding the dependencies rather than requiring the dockerfile (i.e. I don't like developing in a docker container locally if I don't have to)
For (2) I don't think this repository should be dependent on CDK, but it looks like there is a lot of AWS extras in there. I think we should look at slimming that image down or starting from a different base layer image. Possibly creating our own base image with a few requirements that we will then deploy later.
All that being said, I think (1) making it a pip installable package will solve a lot of the development issues.
@@ -0,0 +1,20 @@ | |||
from pathlib import Path | |||
from space_packet_parser import xtcedef, parser | |||
import bitstring |
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.
import bitstring |
packet_file = Path('science_block_20221116_163611Z_idle.bin') | ||
with packet_file.open(mode='rb') as fh: | ||
binary_data = bitstring.ConstBitStream(fh) |
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.
I think you can ignore bitstring details according to the space_packet_parser docs: https://space-packet-parser.readthedocs.io/en/latest/users.html#examples
packet_file = Path('science_block_20221116_163611Z_idle.bin') | |
with packet_file.open(mode='rb') as fh: | |
binary_data = bitstring.ConstBitStream(fh) | |
packet_file = Path('science_block_20221116_163611Z_idle.bin') | |
with packet_file.open(mode='rb') as binary_data: | |
packet_generator = my_parser.generator(binary_data) |
with packet_file.open() as binary_data:
packet_generator = my_parser.generator(binary_data)
for packet in packet_generator:
# Do something with the packet data
print(packet.header['PKT_APID'])
print(packet.data)
|
||
for packet in packet_generator: | ||
# Do something with the packet data | ||
print(packet.header) |
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.
Just for my understanding, would the next step here be to put each field into a CDF?
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.
Sorry @sdhoyt . This PR has moved to IMAP-Science-Operations-Center/imap_processing#1.
But to answer your questions. That's my understanding too. I envision we unpack data using packet parser. In that step we don't do any modification to data. We just unpack data.
Then we perform additional changes as needed for each instrument. Some like to leave data as it is, some like to decompress data and format it to their requirements, and some may just dump data based on flags. And write it into a CDF.
This PR has moved to IMAP-Science-Operations-Center/imap_processing#1 |
Change Summary
Overview
Creating an example of how to unpacket CCSDS packet( aka L0 data) using Space Packet Parser and XTCE. Used SWE sample data and packet definition to demonstrate it.
New Dependencies
None
New Files
Deleted Files
Updated Files
None
Testing
None