-
Notifications
You must be signed in to change notification settings - Fork 16
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
CoDICE L1 decompression and unpacking data updates #762
CoDICE L1 decompression and unpacking data updates #762
Conversation
… individual integer values
…d "hard coded" into the configuration dictionary; Added spin sector config variable
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 all looks good to me. I like how you have chosen to structure your code. I will hold off on approving since there are some open items from Greg's feedback.
Closes #767 |
…cessing pipeline a bit more readable; added proper numbers for positions/energies/spin_sectors
…arrays by positions, spin_sectors, and energies
CATDESC: Azimuth | ||
FIELDNAM: Azimuth | ||
FORMAT: I2 | ||
LABLAXIS: Azimuth |
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'm planning to provide better labels/descriptions for these in an upcoming PR where I address nomenclature
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 all looks good to me!
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.
LGTM
imap_processing/codice/codice_l1a.py
Outdated
# For CoDICE-lo, data are a 3D arrays with a shape representing | ||
# [<num_positions>,<num_spin_sectors>,<num_energy_steps>] | ||
if self.instrument == "lo": | ||
self.data = np.array(science_values_decompressed, dtype=np.uint).reshape( |
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.
do you mean to add dtype=np.uint32
or 64?
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.
Yes, I think this can be uint32
. This prompted me to read up on what the difference between np.uint
and np.uint32
was, and it sounds like uint32
is a better choice:
np.uint:
This is an alias for the default unsigned integer type in NumPy, which is platform-dependent. On most platforms, np.uint is equivalent to np.uint32, meaning it is a 32-bit unsigned integer. However, this can vary based on the platform and version of NumPy.
np.uint32:
This explicitly defines a 32-bit unsigned integer. It can store values from 0 to 232−1232−1, which is 0 to 4,294,967,295. This is a fixed-size type and is not platform-dependent.
imap_processing/codice/decompress.py
Outdated
""" | ||
Apply 8-bit to 32-bit Lossy B decompression algorithm. | ||
Apply 8-bit to 32-bit Lossy A decompression algorithm. |
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.
Apply 8-bit to 32-bit Lossy A decompression algorithm. | |
Apply 8-bit to 32-bit Lossy B decompression algorithm. |
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.
Thanks for catching that! It was a bad copy/paste
Change Summary
Overview
This PR makes improvements to how CoDICE data is unpacked and structured as data arrays in the CDF data products. Prior to SIT-3, this step of the algorithm was mostly glossed over in order to get CDFs created to support the test, but I am now going back to properly implement how the data arrays get stored. This PR also makes improvements to the decompression algorithm, namely making it so that an entire binary string can be decompressed at once, instead of individual values.
Updated Files
imap_processing/cdf/config/imap_codice_l1a/b_variable_attrs.yaml
spin_sector
coordinateimap_processing/codice/codice_l1a.py
spin_sector
coordinate; splitunpack_science_data
into two functions, one for eachhi
andlo
, since they have slightly differently ways of upacking data.imap_processing/codice/constants.py
spin_sector
; removed Collapse Table lookups, as they are not needed because I am defining configurations via theDATA_PRODUCT_CONFIGURATIONS
dictionaries.imap_processing/codice/decompress.py
imap_processing/tests/codice/test_codice_l1a.py
imap_processing/tests/codice/test_decompress.py