-
Notifications
You must be signed in to change notification settings - Fork 22
ULTRA l1b add backup method for getting spin information #2524
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 add backup method for getting spin information #2524
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 pull request adds a backup mechanism to retrieve spin information from the universal spin table when events fall outside the auxiliary dataset's time range. This addresses an edge case where direct event (DE) data may be associated with spins not present in the aux dataset.
Key Changes:
- Refactored
get_spin_and_duration()toget_spin_info()which returns a complete xarray Dataset with spin information - Added fallback logic to query the universal spin table for events outside aux dataset coverage
- Updated
get_event_times()parameter order for consistency (de_event_met before phase_angle)
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| imap_processing/ultra/l1b/ultra_l1b_extended.py | Core implementation: refactored spin info retrieval functions, added universal spin table fallback, and updated get_event_times signature |
| imap_processing/ultra/l1c/ultra_l1c_pset_bins.py | Updated calls to get_spin_info and added aux_dataset parameter to functions requiring spin information |
| imap_processing/ultra/l1c/spacecraft_pset.py | Passed aux_dataset to get_spacecraft_exposure_times |
| imap_processing/ultra/l1c/helio_pset.py | Passed aux_dataset to get_spacecraft_exposure_times |
| imap_processing/ultra/l1b/de.py | Updated to use get_spin_info and pass spin_ds to get_event_times |
| imap_processing/ultra/l1b/ultra_l1b_culling.py | Updated to use get_spin_info instead of get_spin_and_duration |
| imap_processing/ultra/constants.py | Extracted N_RE constant for better maintainability of earth culling radius calculation |
| imap_processing/tests/ultra/unit/test_ultra_l1c_pset_bins.py | Updated test calls to match new function signatures with aux_dataset parameter |
| imap_processing/tests/ultra/unit/test_ultra_l1b_extended.py | Updated tests to use get_spin_info and verify fallback behavior with universal spin table |
| imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py | Updated tests to use get_spin_info instead of get_spin_and_duration |
💡 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.
It seems like we would want to use one or the other, but not switch between two as that could confuse things later on. If we don't have enough aux packet data, do we need to increase the request period on batch_starter to include some earlier packets for Ultra? In the opposite direction, if we always have spin table data, could we always reference that table instead of mixing and matching the two different sources of data?
subagonsouth
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 except for the one concern I have about the units of subseconds in the two different sources for spin info.
87cb551
into
IMAP-Science-Operations-Center:dev
Change Summary
I discovered that sometimes the de data may be associated with spins that are NOT in the aux dataset. I talked to Nick and Larry about this issue and getting the data from the universal spin table is the desired way to deal with this.
Updated Files
Testing
Fix test and test new backup method