Skip to content

IDEX: l1b / l2b spin phase updates - #3453

Merged
lacoak21 merged 4 commits into
IMAP-Science-Operations-Center:devfrom
lacoak21:idex_l2b_spin_bin_bug
Sep 14, 2026
Merged

lacoak21 merged 4 commits into
IMAP-Science-Operations-Center:devfrom
lacoak21:idex_l2b_spin_bin_bug

Conversation

@lacoak21

Copy link
Copy Markdown
Contributor

Change Summary

closes #3452
closes #3451

Overview

Fixes a binning bug in l2b. I originally had the spin bin edges in "np.digitize" friendly values. E.g. shifted by 45 so cross 0 degree events would bin nicely. The issue was then I forgot to account for that when creating the coords using that array.
This updates the SPIN_PHASE_BIN_EDGES to be more realistic and then the binning function handles the shift itself.

Testing

Adds a small test to assert the center bins are correct.

@lacoak21
lacoak21 requested review from aldo9253 and bryan-harter and a balanced review from Copilot September 11, 2026 20:22
@lacoak21 lacoak21 self-assigned this Sep 11, 2026
@lacoak21 lacoak21 added this to IMAP Sep 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Published metadata remains inconsistent, and the new test does not validate the generated coordinate.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Updates IDEX spin-phase handling to use instrument-frame phases and correct L2B bin-center coordinates.

Changes:

  • Uses IDEX instrument spin phase in L1B.
  • Corrects L2B quadrant edges and binning.
  • Adds a bin-center regression test.
File summaries
File Description
imap_processing/idex/idex_l1b.py Uses instrument-frame spin phase.
imap_processing/idex/idex_l2b.py Corrects spin-phase edges and binning.
imap_processing/tests/idex/test_idex_l2b.py Tests expected bin centers.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 3
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread imap_processing/idex/idex_l1b.py
Comment thread imap_processing/idex/idex_l2b.py Outdated
Comment thread imap_processing/tests/idex/test_idex_l2b.py Outdated

@aldo9253 aldo9253 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM :)

@tech3371 tech3371 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code changes looks good to me and glad to see Alex comment because I didn't know impact of these angle bins changes.

@lacoak21
lacoak21 merged commit edc9340 into IMAP-Science-Operations-Center:dev Sep 14, 2026
22 checks passed
@lacoak21
lacoak21 deleted the idex_l2b_spin_bin_bug branch September 14, 2026 17:16
@github-project-automation github-project-automation Bot moved this to Done in IMAP Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

4 participants