CoDICE: l1a fix counters single nso masking#3077
Merged
lacoak21 merged 6 commits intoIMAP-Science-Operations-Center:devfrom Apr 30, 2026
Merged
CoDICE: l1a fix counters single nso masking#3077lacoak21 merged 6 commits intoIMAP-Science-Operations-Center:devfrom
lacoak21 merged 6 commits intoIMAP-Science-Operations-Center:devfrom
Conversation
Contributor
There was a problem hiding this comment.
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-singlesusing(nso_half_spin, nso_spin_sector, nso_energy_step)and account for 2-sector aggregation vianso_spin_sector // 2. - Normalize
nso_spin_sectorinlo-prioritywith% 12to 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.
tech3371
reviewed
Apr 27, 2026
8a103b7
into
IMAP-Science-Operations-Center:dev
14 checks passed
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
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
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
Testing
Michael validated this file with his validation script.