Repository navigation
Hi L1C: record matched gain_config_id in PSET - #3624
Open
tmplummer wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A critical mismatch between the narrowed product configuration and gain-independent background rows can raise ValueError and prevent affected pointings from producing L1C.
1 open issue
What changed in this PR
This pull request updates Hi L1C PSET generation to record the matched gain configuration and restrict calibration products to that configuration, while representing unmatched pointings with fill values.
Changes:
- Records
gain_config_id, usingNaNwhen no configuration matches. - Restricts calibration products and related processing to the matched gain configuration.
- Updates
calibration_prodfill metadata and adds matched/unmatched test coverage.
This pull request requires changes.
| File | Summary | Review status |
|---|---|---|
imap_processing/tests/hi/test_hi_l1c.py |
Adds matched, unmatched, fill-value, and CDF round-trip coverage. | Reviewed |
imap_processing/hi/hi_l1c.py |
Matches gain configurations, records the global ID, and handles matched and unmatched PSETs. | Requires changes: filter the background configuration to the matched products before calling pset_backgrounds() to avoid coordinate mismatches. |
imap_processing/cdf/config/imap_hi_variable_attrs.yaml |
Corrects the calibration_prod uint8 fill value and format. |
Reviewed |
Review effort: Lite
When no gain config matches, leave backgrounds as FILLVAL
Backgrounds are gain-independent, so the background config lists every calibration product while a PSET holds only its matched gain config's. pset_backgrounds now requires the PSET's cal prods to be a subset of the config's and selects those rows, instead of requiring an exact match.
tmplummer
force-pushed
the
3617-hi-l1c---record-matched-gain_config_id-in-pset-for-l2-gain-config-combination
branch
from
November 4, 2026 21:48
05423b7 to
36265dd
Compare
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
Overview
Closes #3617. L1C now records the pointing's matched gain config in the PSET so L2 can combine gain configs (#3619).
gain_config_idglobal attribute set to the matched ID, or NaN if no config matches.calibration_prodholds only the matched config's products. If no config matches, it is a single FILLVAL entry, and backgrounds are left at FILLVAL.File changes
hi_l1c.py: sets the global attribute, buildscalibration_prodfrom the matched config, and returns early frompset_backgroundson the fill entry.imap_hi_variable_attrs.yaml: fixescalibration_prodFILLVAL (65535 → 255, since it is a uint8) and FORMAT (I1 → I3).Testing
test_hi_l1c.pypass, including new matched/unmatched cases. The real-data test writes a CDF and reads it back for both cases.