Skip to content

BUG - GLOWS L2: exclusions of entire L1b histograms#3206

Merged
tech3371 merged 1 commit into
IMAP-Science-Operations-Center:devfrom
tech3371:glows_bad_data_filter
May 15, 2026
Merged

BUG - GLOWS L2: exclusions of entire L1b histograms#3206
tech3371 merged 1 commit into
IMAP-Science-Operations-Center:devfrom
tech3371:glows_bad_data_filter

Conversation

@tech3371
Copy link
Copy Markdown
Contributor

@tech3371 tech3371 commented May 15, 2026

Change Summary

closes #3203

Overview

GLOWS code update sent by GLOWS team. They validated code changes through their internal process.

File changes

Testing

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

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 GLOWSL1bFlags usage 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])
Copy link
Copy Markdown
Contributor

@tmplummer tmplummer left a comment

Choose a reason for hiding this comment

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

LGTM

@tech3371 tech3371 merged commit 5235249 into IMAP-Science-Operations-Center:dev May 15, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG - GLOWS L2: exclusions of entire L1b histograms

3 participants