Skip to content

3529 bug hi goodtimes statistical filter 0 normalizes sweep counts by per pointing esa step count - #3537

Merged
tmplummer merged 2 commits into
IMAP-Science-Operations-Center:devfrom
tmplummer:3529-bug---hi-goodtimes-statistical-filter-0-normalizes-sweep-counts-by-per-pointing-esa-step-count
Oct 7, 2026
Merged

tmplummer merged 2 commits into
IMAP-Science-Operations-Center:devfrom
tmplummer:3529-bug---hi-goodtimes-statistical-filter-0-normalizes-sweep-counts-by-per-pointing-esa-step-count

Conversation

@tmplummer

@tmplummer tmplummer commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Change Summary

Overview

Closes: #3529. Hi goodtimes statistical filter 0 now excludes invalid or partial spin sets from its statistics. The mcp_b gain-test tolerance is tightened so the +50 V MCP back gain-test step is no longer missed.

File changes

  • hi/hi_goodtimes.py: statistical filter 0 skips invalid or partial spin sets when computing its statistics.
  • hi/utils.py: GAIN_TEST_HV_DELTA_V["mcp_b"] lowered from 50 V to 25 V.

Testing

  • New statistical filter 0 tests in test_hi_goodtimes.py. The gain-test exclusion test in test_hi_l1b.py now also covers the +49.4 V mcp_b step.
  • Reprocessed repoint 152 (2026-02-09 gain test): the missed mcp_b step is now culled.

Closes: #3529

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

🟡 Changes recommended

Partial 8-spin sets remain included despite the PR’s stated exclusion behavior.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Fixes Hi Statistical Filter 0 normalization and tightens MCP back gain-test detection.

Changes:

  • Normalizes each sweep using its valid 8-spin sets.
  • Excludes calibration and voltage-invalid sets from statistics.
  • Lowers the mcp_b tolerance and expands tests.
File Description
imap_processing/​hi/​hi_goodtimes.py Implements per-sweep normalization and invalid-set exclusion.
imap_processing/​hi/​utils.py Tightens the MCP back tolerance.
imap_processing/​tests/​hi/​test_hi_goodtimes.py Tests normalization and invalid-set behavior.
imap_processing/​tests/​hi/​test_hi_l1b.py Tests detection of the measured MCP back step.

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

Comment thread imap_processing/hi/hi_goodtimes.py
)
# set_mets holds one esa_step_met per 8-spin set; return_inverse gives,
# for each packet, the index of its set in set_mets.
set_mets, packet_set_idx = np.unique(

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.

cool!

is_invalid_packet = (esa_energy_step.values == 0) | (
esa_energy_step.values == fillval
)
# set_mets holds one esa_step_met per 8-spin set; return_inverse gives,

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.

Is it always guaranteed to be 8 or do you handle this elsewhere?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think it will always be 8. It would take a change of FSW to change it, so we would be made aware of this type of change. I believe the code is mostly generic and just comments reference the 8-spin sets.

@lacoak21 lacoak21 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.

LGTM! Just had a question I was curious about

@tmplummer
tmplummer merged commit 3ea3994 into IMAP-Science-Operations-Center:dev Oct 7, 2026
22 checks passed
@tmplummer
tmplummer deleted the 3529-bug---hi-goodtimes-statistical-filter-0-normalizes-sweep-counts-by-per-pointing-esa-step-count branch October 7, 2026 21:36
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.

BUG - Hi goodtimes Statistical Filter 0 normalizes sweep counts by per-Pointing ESA step count

3 participants