Repository navigation
3529 bug hi goodtimes statistical filter 0 normalizes sweep counts by per pointing esa step count - #3537
Conversation
…ts. This removes them from corrupting the statistics.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Partial 8-spin sets remain included despite the PR’s stated exclusion behavior.
Review effort: Balanced
Findings: 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_btolerance 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.
| ) | ||
| # 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( |
| 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, |
There was a problem hiding this comment.
Is it always guaranteed to be 8 or do you handle this elsewhere?
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
LGTM! Just had a question I was curious about
3ea3994
into
IMAP-Science-Operations-Center:dev

Change Summary
Overview
Closes: #3529. Hi goodtimes statistical filter 0 now excludes invalid or partial spin sets from its statistics. The
mcp_bgain-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
test_hi_goodtimes.py. The gain-test exclusion test intest_hi_l1b.pynow also covers the +49.4 Vmcp_bstep.mcp_bstep is now culled.Closes: #3529