3274 hi goodtimes filter out gain tests - #3358
Conversation
…tification of gain tests
There was a problem hiding this comment.
Pull request overview
Adds gain-configuration classification and gain-test filtering to IMAP-Hi processing by introducing a gain-configuration ancillary table, using it to classify pointings / flag HV excursions in L1B DE, and propagating the classified configuration into L1C PSET geometric-factor lookup.
Changes:
- Introduces
imap_hi_{sensor}-gain-configuration_*.csvand a loader (load_gain_configuration) plus a new MET→config lookup (GainConfigLookupTable). - Updates Hi L1B DE processing to (a) build
ccsds_qfincrementally and (b) filter/flag packets whose detector HV does not match the pointing’s gain configuration; addsgain_configuration_idglobal attr. - Updates Hi L1C PSET generation to compute
pset_geometric_factorvia the gain-configuration ancillary table; updates CLI plumbing and test suite accordingly.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| imap_processing/cli.py | Wires new gain-configuration ancillary dependency into L1B/L1C processing. |
| imap_processing/hi/hi_l1b.py | Adds gain-config classification + detector-HV-based filtering and new gain_configuration_id attribute. |
| imap_processing/hi/hi_l1c.py | Adds pset_geometric_factor lookup using gain_configuration_id and gain-config ancillary file. |
| imap_processing/hi/hi_goodtimes.py | Renames ESA-voltage culling to generalized HV culling and updates cull code name. |
| imap_processing/hi/utils.py | Adds gain-config constants, CSV loader, and GainConfigLookupTable. |
| imap_processing/quality_flags.py | Extends Hi L1B DE packet flags with BAD_ESA_VOLTAGE and BAD_DETECTOR_VOLTAGE bits. |
| imap_processing/cdf/config/imap_hi_variable_attrs.yaml | Updates ccsds_qf bit documentation and adds PSET geometric-factor variable attrs. |
| imap_processing/tests/test_cli.py | Updates CLI dependency expectations for new ancillary input. |
| imap_processing/tests/hi/conftest.py | Adds session fixture for gain-configuration ancillary path. |
| imap_processing/tests/hi/test_hi_l1b.py | Adds/updates tests for new L1B gain-config logic and ccsds_qf behavior. |
| imap_processing/tests/hi/test_hi_l1c.py | Updates tests for new L1C gain-config dependency and geometric factor lookup. |
| imap_processing/tests/hi/test_hi_goodtimes.py | Updates tests for renamed HV culling and cull code rename. |
| imap_processing/tests/hi/test_utils.py | Adds tests for load_gain_configuration behavior/validation. |
| imap_processing/tests/hi/data/l1/imap_hi_90sensor-gain-configuration_20240101_v001.csv | Adds test ancillary gain-configuration table used by unit tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tech3371
left a comment
There was a problem hiding this comment.
I skimmed mostly and appreciated comments and easy to follow code. I didn't look in details since it seems like you need it soon. No major concerns found.
|
@tmplummer - if you'd like me to take a look too for another pair of eyes, I can do it over the weekend. Sorry I don't know anything about Hi so its all new to me. If that's too late or you already have your approval then go ahead! |
Sorry for the size of this PR. Hi has requested I get these changes in for COSPAR next week 😬.
Closes: #3274
Summary
This branch (3274-hi-goodtimes---filter-out-gain-tests) adds per-pointing gain-configuration classification and detector-voltage-based gain-test filtering to IMAP-Hi processing. Summary of changes:
Details
New capability: gain configuration classification
L1B DE processing
L1C PSET processing
Goodtimes
Plumbing & schema