Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A critical continuity-check flaw allows a missing ten-frame block to pair counts with the wrong livetime, silently producing incorrect L1B rates.
1 open issue
What changed in this PR
This PR addresses #3578 by aligning HIT L1A sectored counts with their corresponding livetime values, preventing downstream L1B dimension mismatches after dropped frames.
Changes:
- Filters out incomplete mod-10 sets and sets whose preceding block is incomplete.
- Selects livetime values for each retained epoch rather than a continuous range.
- Adds regression tests for gaps, invalid epoch matches, and cases with no usable sets.
| File | Description |
|---|---|
imap_processing/tests/hit/test_hit_l1a.py |
Extends tests for dropped frames and livetime alignment. |
imap_processing/hit/l1a/hit_l1a.py |
Updates set filtering and livetime selection, with alignment checks. |
Review effort: Balanced
| if len(starts) == 0: | ||
| return np.array([], dtype=int) | ||
| # Find where the previous set is complete as well. | ||
| valid = np.isin(starts - 10, starts) |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Change Summary
closes #3578
Overview
When there are incomplete sets for sectored counts, the code correctly drops the full set of counts data yet the livetime never accounts for it.
Since the livetime never drops in complete sets, in l1b this errors out with a dimension issue.
This also exposed another bug, since the livetimes come from the previous 10 frames, this means that the next set needs to be dropped as well since it would have to use incomplete livetime data. Unfortunatley this means we miss 20 minutes of data but a dropped frame should rarely occur.
File changes
Testing
Fix tests