Skip to content

CoDICE: l1a fix counters single nso masking#3077

Merged
lacoak21 merged 6 commits intoIMAP-Science-Operations-Center:devfrom
lacoak21:codice_l1a_counters_single_nso
Apr 30, 2026
Merged

CoDICE: l1a fix counters single nso masking#3077
lacoak21 merged 6 commits intoIMAP-Science-Operations-Center:devfrom
lacoak21:codice_l1a_counters_single_nso

Conversation

@lacoak21
Copy link
Copy Markdown
Contributor

Change Summary

closes #3066

Overview

SDC is currently filling all data acquired during the half spin corresponding to nso_half_spin with fill values. However, the counters data array, 'apd_singles', has dimensions [epoch, 128 energy, 6 spin sector, 24 APD]. The spin sectors are summed over every 2 of the native 12 spin sectors onboard. Thus, a similar algorithm to how NSO and RGFO is handled for the angular product should be implemented. Here the nso_half_spin, nso_spin_sector, and nso_esa_step variable should be used to identify which part of the data array to assign fill values. Note, since the apd_singles is aggregated over every two spin sectors (6 spin sector bins total), the nso_spin_sector variable should be divided by 2.

File changes

imap_processing/codice/codice_l1a_lo_counters_singles.py

  • update nso logic

Testing

Michael validated this file with his validation script.

@lacoak21 lacoak21 requested review from Copilot and tech3371 April 24, 2026 16:51
@lacoak21 lacoak21 self-assigned this Apr 24, 2026
@lacoak21 lacoak21 added this to IMAP Apr 24, 2026
@lacoak21 lacoak21 added the Ins: CoDICE Related to the CoDICE instrument label Apr 24, 2026
Copy link
Copy Markdown
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

Updates CoDICE Lo L1A NSO masking to avoid incorrectly masking entire half-spins for the counters-singles product, and normalizes nso_spin_sector in Lo priority to match the spin-sector domain used by the data arrays.

Changes:

  • Implement NSO boundary masking in lo-counters-singles using (nso_half_spin, nso_spin_sector, nso_energy_step) and account for 2-sector aggregation via nso_spin_sector // 2.
  • Normalize nso_spin_sector in lo-priority with % 12 to align packet-reported sector values with 0–11 data-sector indices.
  • Minor comment fix (“species” → “counters”) in counters-singles output section.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
imap_processing/codice/codice_l1a_lo_priority.py Normalizes nso_spin_sector to match 0–11 spin-sector indexing used in masking logic.
imap_processing/codice/codice_l1a_lo_counters_singles.py Reworks NSO masking so only the appropriate portion of apd_singles is masked, including sector-pair binning.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread imap_processing/codice/codice_l1a_lo_counters_singles.py
Comment thread imap_processing/codice/codice_l1a_lo_counters_singles.py
Comment thread imap_processing/codice/codice_l1a_lo_counters_singles.py
Comment thread imap_processing/codice/codice_l1a_lo_counters_singles.py
Comment thread imap_processing/codice/codice_l1a_lo_priority.py Outdated
Comment thread imap_processing/codice/codice_l1a_lo_counters_singles.py Outdated
@lacoak21 lacoak21 requested a review from tech3371 April 28, 2026 16:06
Copy link
Copy Markdown
Contributor

@tech3371 tech3371 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!

@lacoak21 lacoak21 merged commit 8a103b7 into IMAP-Science-Operations-Center:dev Apr 30, 2026
14 checks passed
@lacoak21 lacoak21 deleted the codice_l1a_counters_single_nso branch April 30, 2026 15:14
@github-project-automation github-project-automation Bot moved this to Done in IMAP Apr 30, 2026
maxinelasp pushed a commit to maxinelasp/imap_processing that referenced this pull request May 1, 2026
…Center#3077)

* mod nso_esa_step

* fix version one half_spin_mask

* update comment

* pr comments
lacoak21 added a commit to lacoak21/imap_processing that referenced this pull request May 4, 2026
…Center#3077)

* mod nso_esa_step

* fix version one half_spin_mask

* update comment

* pr comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ins: CoDICE Related to the CoDICE instrument

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

CoDICE: lo_l1a-counters-singles: NSO implementaion bug

3 participants