CoDICE l2 fix intensity calculations for invalid half_spin_per_esa_steps - #2631
Merged
lacoak21 merged 2 commits intoJan 28, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes CoDICE L2 intensity/geometric-factor calculations to properly handle invalid (fill-valued) half_spin_per_esa_step entries, preventing incorrect mode/assignment behavior when the LUT data is padded or masked.
Changes:
- Introduces a shared
HALF_SPIN_FILLVALconstant (63) forhalf_spin_per_esa_stepinvalid values. - Updates L2 geometric factor mode selection and LO angular intensity A/B indexing to ignore fill-valued half-spin steps.
- Updates LO L1A products to pad and mask
half_spin_per_esa_stepusing the fill value instead ofNaN/literal63.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| imap_processing/codice/constants.py | Adds HALF_SPIN_FILLVAL constant used to mark invalid half-spin steps. |
| imap_processing/codice/codice_l2.py | Filters out fill-valued half spins in geometric factor mode selection and LO angular A/B index calculation. |
| imap_processing/codice/codice_l1a_lo_species.py | Pads/masks half_spin_per_esa_step using HALF_SPIN_FILLVAL instead of NaN/63. |
| imap_processing/codice/codice_l1a_lo_priority.py | Pads/masks half_spin_per_esa_step using HALF_SPIN_FILLVAL instead of NaN/63. |
| imap_processing/codice/codice_l1a_lo_counters_singles.py | Pads/masks half_spin_per_esa_step using HALF_SPIN_FILLVAL instead of NaN/63. |
| imap_processing/codice/codice_l1a_lo_counters_aggregated.py | Pads/masks half_spin_per_esa_step using HALF_SPIN_FILLVAL instead of NaN/63. |
| imap_processing/codice/codice_l1a_lo_angular.py | Pads/masks half_spin_per_esa_step using HALF_SPIN_FILLVAL instead of NaN/63. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
laspsandoval
approved these changes
Jan 28, 2026
laspsandoval
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me. Just a couple of things.
greglucas
approved these changes
Jan 28, 2026
lacoak21
merged commit Jan 28, 2026
176a6df
into
IMAP-Science-Operations-Center:dev
14 checks passed
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
I ran a final check on dec 28th data and noticed a bug where we are not checking whether the half_spin_per_esa step is valid in l2 computations that use this variable.
Updated Files