Skip to content

Conversation

@lacoak21
Copy link
Contributor

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

  • imap_processing/codice/codice_l2.py
    • Check where half_spin_per_esa_step is valid

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_FILLVAL constant (63) for half_spin_per_esa_step invalid 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_step using the fill value instead of NaN/literal 63.

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.

Copy link
Contributor

@laspsandoval laspsandoval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Just a couple of things.

@lacoak21 lacoak21 merged commit 176a6df into IMAP-Science-Operations-Center:dev Jan 28, 2026
14 checks passed
@lacoak21 lacoak21 deleted the codice_l2_valid_half_spins branch January 28, 2026 22:39
@github-project-automation github-project-automation bot moved this to Done in IMAP Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants