Skip to content

Fix bug in identifying Hi esa sweep boundaries - #3530

Open
tmplummer wants to merge 1 commit into
IMAP-Science-Operations-Center:devfrom
tmplummer:3519-bug---hi-l1b-degoodtimes-gain-test-filter-misses-esa-step-1
Open

tmplummer wants to merge 1 commit into
IMAP-Science-Operations-Center:devfrom
tmplummer:3519-bug---hi-l1b-degoodtimes-gain-test-filter-misses-esa-step-1

Conversation

@tmplummer

Copy link
Copy Markdown
Contributor

Change Summary

Overview

File changes

  • hi_goodtimes.py: _get_sweep_indices() now takes esa_step_met and only compares ESA steps where an 8-spin set changes. _add_sweep_indices() passes esa_step_met (DE) or met (goodtimes).
  • test_hi_goodtimes.py: added esa_step_met to the test DE datasets and updated the _get_sweep_indices tests for the new signature.

Testing

  • New tests for cut-off sweeps, 10-step sweeps, and multiple packets per set; all 184 goodtimes tests pass.
  • Regenerated the txt files for repoints 145–155 from the 0777 goodtimes CDFs. Only repoint 152 changes, and every txt now matches its CDF cull flags.

Closes: #3519

@tmplummer
tmplummer requested a balanced review from Copilot October 1, 2026 22:59
@tmplummer tmplummer self-assigned this Oct 1, 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.

Copilot review overview

🟢 Approval recommended

The implementation matches the reported failure mode and includes focused regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes Hi goodtimes sweep boundaries so truncated or repeated ESA steps begin new sweeps without splitting packets from the same 8-spin set.

Changes:

  • Uses esa_step_met to identify 8-spin set transitions.
  • Treats non-increasing ESA steps as sweep boundaries.
  • Adds coverage for truncated, ten-step, and multi-packet sweeps.
File Description
imap_processing/​hi/​hi_goodtimes.py Corrects sweep boundary detection and MET selection.
imap_processing/​tests/​hi/​test_hi_goodtimes.py Updates fixtures and expands sweep-indexing tests.

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

BUG - Hi goodtimes sweep indexing merges truncated sweeps, mis-culling ESA step 1

2 participants