-
Notifications
You must be signed in to change notification settings - Fork 22
ULTRA l1b use aux packet to get spins #2522
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
ULTRA l1b use aux packet to get spins #2522
Conversation
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.
Pull request overview
This PR refactors the ULTRA L1b processing to use auxiliary (aux) packet data for spin number and duration calculations instead of relying on the Universal Spin Table with 8-bit spin number matching. The change eliminates complex time-based matching logic and provides more accurate spin information directly from the aux packet, which contains the full spin numbers (not just 8-bit truncated values).
Key Changes:
- Removed the outdated
get_spin_and_durationfunction fromultra_l1b_culling.pythat relied on Universal Spin Table matching - Created a new
get_spin_and_durationfunction inultra_l1b_extended.pythat uses aux packet data directly - Refactored
get_event_timesto return only event times and spin start times (spin numbers now obtained separately viaget_spin_and_duration) - Updated function signatures throughout L1b and L1c to accept
aux_datasetas a required parameter
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| imap_processing/ultra/l1b/ultra_l1b_extended.py | Added new get_spin_start_indices helper function and get_spin_and_duration function using aux packet; refactored get_event_times to remove spin_numbers from return |
| imap_processing/ultra/l1b/ultra_l1b_culling.py | Removed old Universal Spin Table-based get_spin_and_duration; updated get_pulses_per_spin signature to require aux_dataset |
| imap_processing/ultra/l1b/de.py | Updated to call both get_event_times and get_spin_and_duration separately with proper aux_dataset parameter |
| imap_processing/ultra/l1b/extendedspin.py | Updated get_pulses_per_spin call to include aux_dataset parameter |
| imap_processing/ultra/l1b/goodtimes.py | Changed from .dims to .sizes for accessing dimension sizes (best practice) |
| imap_processing/ultra/l1b/badtimes.py | Changed from .dims to .sizes for accessing dimension sizes (best practice) |
| imap_processing/ultra/l1c/ultra_l1c.py | Added aux_dataset as required input for helio_pset and spacecraft_pset calculations |
| imap_processing/ultra/l1c/helio_pset.py | Added aux_dataset parameter and passed it through to background rates calculation |
| imap_processing/ultra/l1c/spacecraft_pset.py | Added aux_dataset parameter and passed it through to background rates calculation |
| imap_processing/ultra/l1c/ultra_l1c_pset_bins.py | Updated get_spacecraft_background_rates to accept and use aux_dataset for spin calculations |
| imap_processing/tests/ultra/unit/test_ultra_l1b_extended.py | Added new test for get_spin_and_duration; updated test_get_eventtimes to match new return signature |
| imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py | Updated tests to create aux_dataset and pass it to modified functions |
| imap_processing/tests/ultra/unit/test_ultra_l1c_pset_bins.py | Created aux_ds fixture data for background rates test |
| imap_processing/tests/ultra/unit/test_ultra_l1c.py | Added aux_dataset and rates_dataset fixtures to spacecraft and helio pset tests |
| imap_processing/tests/ultra/unit/test_spacecraft_pset.py | Added aux_dataset and rates_dataset parameters to test functions |
| imap_processing/tests/ultra/unit/test_ultra_l1b.py | Updated fixture names from faux_aux_dataset to aux_dataset for consistency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
greglucas
left a comment
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.
Looks good, just one question/comment about code re-use.
73b532d to
1961b31
Compare
5774def
into
IMAP-Science-Operations-Center:dev
Change Summary
Overview
I found another place where the code is using the spin number (unit8) and doing gymnastics with the met time to match up to the universal spin table. We should be using the aux packet and coarse time to get the correct spin duration/ event times/ spin number. I missed that the old routine was still being used in l1b.
Updated Files
Testing
Fix tests