BUG - GLOWS L2: exclusions of entire L1b histograms#3206
Merged
tech3371 merged 1 commit intoMay 15, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes GLOWS L2 generation to correctly handle “bad times” from the L1B instrument-team exclusions ancillary by skipping entire L1B histograms (epochs) when all bins are marked excluded by the instrument team, aligning with Issue #3203.
Changes:
- Adds logic in GLOWS L2 to drop epochs where every bin is flagged
IS_EXCLUDED_BY_INSTR_TEAM. - Introduces
GLOWSL1bFlagsusage in L2 to reference the correct exclusion flag value.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+392
to
+395
| excl_flag_val = GLOWSL1bFlags.IS_EXCLUDED_BY_INSTR_TEAM.value | ||
| excl_row = good_data["histogram_flag_array"].data[:, 2, :] # (n_epochs, n_bins) | ||
| not_all_excl = ~np.all(excl_row == excl_flag_val, axis=1) | ||
| good_data = good_data.isel(epoch=np.where(not_all_excl)[0]) |
Comment on lines
+389
to
+395
| # Exclude histograms where all bins have is_excluded_by_instr_team set. | ||
| # Per cbk implementation: GLOWS team marks such histograms as entirely bad; | ||
| # they are dropped here and do not contribute to the L2 histogram_flag_array. | ||
| excl_flag_val = GLOWSL1bFlags.IS_EXCLUDED_BY_INSTR_TEAM.value | ||
| excl_row = good_data["histogram_flag_array"].data[:, 2, :] # (n_epochs, n_bins) | ||
| not_all_excl = ~np.all(excl_row == excl_flag_val, axis=1) | ||
| good_data = good_data.isel(epoch=np.where(not_all_excl)[0]) |
5235249
into
IMAP-Science-Operations-Center:dev
18 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
closes #3203
Overview
GLOWS code update sent by GLOWS team. They validated code changes through their internal process.
File changes
Testing