ULTRA extended spin update variables to be ISTP compliant#2826
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates ULTRA L1B extended spin variables (energy_range_flags and energy_range_edges) to have fixed/stable dimension sizes for ISTP (International Solar-Terrestrial Physics) CDF compliance. Previously, these arrays had variable sizes depending on the number of energy bins used; now they are padded to fixed sizes (16 for flags, 17 for edges) with fill values. Downstream consumers (L1B culling and L1C processing) are updated to filter out the fill values before use.
Changes:
- Pad
energy_range_flagsto a fixed size of 16 (fill=0) andenergy_range_edgesto 17 (fill=-1e31) inextendedspin.py, and update the CDF variable attributes YAML accordingly. - Add fill-value filtering (
> 0) in bothultra_l1b_culling.pyandultra_l1c_pset_bins.pyto strip padding before processing. - Update all test fixtures and test data to use the new padded array sizes.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
imap_processing/ultra/l1b/extendedspin.py |
Pad energy_range_flags (size 16) and energy_range_edges (size 17) with fill values for ISTP compliance. |
imap_processing/ultra/l1b/ultra_l1b_culling.py |
Filter out fill values from padded energy_range_edges and energy_range_flags before energy/spin rejection logic. |
imap_processing/ultra/l1c/ultra_l1c_pset_bins.py |
Filter out fill values from padded arrays before computing spacecraft exposure times. |
imap_processing/ultra/utils/ultra_l1_utils.py |
Change dimension name for energy_range_flags from "energy_ranges" to "energy_range_flags" for clarity. |
imap_processing/cdf/config/imap_ultra_l1b_variable_attrs.yaml |
Update CDF attributes: add DEPEND_0 to quality flags, redefine energy_range_edges and energy_range_flags with proper ISTP metadata. |
imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py |
Update test data to use padded arrays with fill values. |
imap_processing/tests/ultra/unit/test_ultra_l1b.py |
Update test fixture to use padded arrays with fill values. |
imap_processing/tests/ultra/unit/conftest.py |
Update mock_goodtimes_dataset fixture to use padded arrays with fill values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
This is good. There are many many changes that could be made if you were archiving at SPDF, but probably best to keep your efforts on L2 cdf work given the time-crunch. |
ba982dc to
94dc15f
Compare
👍 my thoughts as well. Hopefully in the not too far off future I can revisit. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
f85aa17
into
IMAP-Science-Operations-Center:dev
Change Summary
Overview
Update variables to have stable dimensions for ISTP compliance. Update code at l1c to filter out non padded values.
File changes
Testing
Update tests to use the variables with the new dimensions