ULTRA l1b upstream ion culling algorithm #2931
Merged
lacoak21 merged 6 commits intoIMAP-Science-Operations-Center:devfrom Apr 9, 2026
Merged
ULTRA l1b upstream ion culling algorithm #2931lacoak21 merged 6 commits intoIMAP-Science-Operations-Center:devfrom
lacoak21 merged 6 commits intoIMAP-Science-Operations-Center:devfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an ULTRA L1B “upstream ion” spin-bin culling algorithm and propagates its flags into the existing quality-flag filtering pipeline so L1C can drop affected events.
Changes:
- Implement
flag_upstream_ion()and wire it intocalculate_extendedspin()(two-pass channel selection). - Expose new upstream-ion quality flags as energy-dependent spin filters for downstream rejection.
- Add/adjust unit + validation tests, plus test data plumbing updates.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
imap_processing/ultra/l1b/ultra_l1b_culling.py |
Adds upstream-ion flagging algorithm using summed counts across selected energy channels. |
imap_processing/ultra/l1b/quality_flag_filters.py |
Registers new upstream-ion quality arrays for energy/spin-dependent filtering. |
imap_processing/ultra/l1b/extendedspin.py |
Runs upstream-ion culling in extendedspin generation and outputs quality_upstream_ion_1/2. |
imap_processing/ultra/constants.py |
Adds constants for upstream-ion channel sets and sigma threshold. |
imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py |
Adds upstream-ion validation test + refactors repoint-47 setup. |
imap_processing/tests/ultra/unit/test_spacecraft_pset.py |
Updates test input datasets to include theta/phi fields. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
subagonsouth
approved these changes
Apr 9, 2026
Contributor
subagonsouth
left a comment
There was a problem hiding this comment.
Clean, well organized code! LGTM.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Summary
closes #2914
Overview
Add the upstream ion cull algorithm and remove events at l1c that are flagged with these.
File changes
Testing
Validation test. Check the expected flags against Bobs code.