ULTRA l1b High Energy (SEP) culling#2762
Merged
lacoak21 merged 7 commits intoIMAP-Science-Operations-Center:devfrom Feb 25, 2026
Merged
ULTRA l1b High Energy (SEP) culling#2762lacoak21 merged 7 commits intoIMAP-Science-Operations-Center:devfrom
lacoak21 merged 7 commits intoIMAP-Science-Operations-Center:devfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds high energy (SEP) culling functionality to the ULTRA L1B extended spin processing. The implementation identifies spins contaminated by Solar Energetic Particles (SEPs) by monitoring counts in a designated "culling energy channel" and flagging entire spin groups when counts exceed energy-specific thresholds. The quality flags are stored in the L1B CDF files for use in L1C processing.
Changes:
- Added high energy culling constants (thresholds, culling channel) to constants.py
- Implemented flag_high_energy and get_valid_events_per_energy_range functions in ultra_l1b_culling.py
- Integrated high energy flagging into extendedspin.py with voltage-based event filtering
- Added comprehensive unit tests and validation tests
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| imap_processing/ultra/constants.py | Added HIGH_ENERGY_CULL_THRESHOLDS and HIGH_ENERGY_CULL_CHANNEL constants |
| imap_processing/ultra/l1b/ultra_l1b_culling.py | Implemented high energy event flagging logic and valid event filtering; renamed get_binned_energy_range_flags to get_energy_range_flags |
| imap_processing/ultra/l1b/extendedspin.py | Integrated high energy flagging with low voltage filtering |
| imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py | Added unit tests and validation test for high energy culling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
subagonsouth
approved these changes
Feb 25, 2026
Contributor
subagonsouth
left a comment
There was a problem hiding this comment.
I had a hard time finding anything to comment on. This all looks good to me!
e0de4ed
into
IMAP-Science-Operations-Center:dev
14 checks passed
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 #2711
Overview
This PR adds a quality flag array to the ULTRA L1B extended spin and goodtimes CDF. The new quality flag array indicates spins and energy ranges that should be removed due to high energy events.
First, valid events are selected based on other flags and criteria at each energy range. Then, using the selected "culling energy channel" — the channel with the highest energy events, identified by the ULTRA IT team — entire groups of spins are flagged. The culling energy channel is shown to be correlated with SEPs in other channels, so it can be used to cull contaminated spins. Each energy channel has its own threshold, also provided by the ULTRA IT team. The counts at each spin bin for the culling channel are calculated, and then for each energy bin, if the counts exceed the energy threshold, that spin bin is flagged at that energy range.
These flags will be used to cull spins at l1c.
File changes
Testing
Add basic testing and a validation test. The validation files were computed using Bob Demajistre's code.