Skip to content

ULTRA l1b upstream ion culling algorithm #2931

Merged
lacoak21 merged 6 commits into
IMAP-Science-Operations-Center:devfrom
lacoak21:ultra_l1b_upstream_ion_cull
Apr 9, 2026
Merged

ULTRA l1b upstream ion culling algorithm #2931
lacoak21 merged 6 commits into
IMAP-Science-Operations-Center:devfrom
lacoak21:ultra_l1b_upstream_ion_cull

Conversation

@lacoak21
Copy link
Copy Markdown
Contributor

@lacoak21 lacoak21 commented Apr 7, 2026

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.

@lacoak21 lacoak21 requested review from Copilot and tmplummer April 7, 2026 20:46
@lacoak21 lacoak21 self-assigned this Apr 7, 2026
@lacoak21 lacoak21 added this to IMAP Apr 7, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 into calculate_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.

Comment thread imap_processing/ultra/l1b/ultra_l1b_culling.py Outdated
Comment thread imap_processing/ultra/l1b/ultra_l1b_culling.py Outdated
Comment thread imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py Outdated
Comment thread imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py Outdated
Comment thread imap_processing/ultra/l1b/quality_flag_filters.py
Comment thread imap_processing/ultra/l1b/extendedspin.py
Copy link
Copy Markdown
Contributor

@tmplummer tmplummer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, well organized code! LGTM.

@lacoak21 lacoak21 merged commit 7d48939 into IMAP-Science-Operations-Center:dev Apr 9, 2026
14 checks passed
@lacoak21 lacoak21 deleted the ultra_l1b_upstream_ion_cull branch April 9, 2026 15:54
@github-project-automation github-project-automation Bot moved this to Done in IMAP Apr 9, 2026
sapols pushed a commit to sapols/imap_processing that referenced this pull request Apr 15, 2026
…ter#2931)

* code and validation tests for upstream ion cull

* add new arrays to mock goodtimes datasets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Upstream ion cull

3 participants