Skip to content

BUG — GLOWS: instrument team exclusion-handling - #3475

Merged
leowerneck merged 2 commits into
IMAP-Science-Operations-Center:devfrom
leowerneck:3474-bug---glows-l1b--issue-with-handling-exclusions-by-instrument-team
Sep 18, 2026
Merged

leowerneck merged 2 commits into
IMAP-Science-Operations-Center:devfrom
leowerneck:3474-bug---glows-l1b--issue-with-handling-exclusions-by-instrument-team

Conversation

@leowerneck

Copy link
Copy Markdown
Contributor

Change Summary

Closes #3474.

Overview

GLOWS L1b exclusions defined by the instrument team are keyed by a unique block identifier: the UTC start time of an L1b block. The instrument team and the SDC sometimes use different sclk kernel versions when converting this time, which can shift the identifier by a couple of seconds (up to ~1 s observed so far). The current exact string comparison in flag_from_mask_dataset() misses those shifted entries and silently drops the corresponding exclusions.

This PR replaces the exact match with a timestamp comparison using a 5-second tolerance, picking the closest entry when more than one falls within the window. A 5-second tolerance is safe because the shortest L1b block lasts ~15 s. The change matches the suggested implementation by @mstrumik in #3474.

File changes

  • imap_processing/glows/l1b/glows_l1b_data.py: In HistogramL1B.flag_from_mask_dataset(), match block identifiers as datetime64[s] within a ±5 s tolerance instead of by exact string equality, selecting the closest entry on multiple matches.
  • imap_processing/tests/glows/test_glows_l1b_data.py: Add test_flag_from_mask_dataset_tolerance and test_flag_from_mask_dataset_picks_closest_within_tolerance covering exact match, within-tolerance, boundary, beyond-tolerance, and closest-of-several cases.

Testing

Running the GLOWS test suite:

uv run pytest imap_processing/tests/glows

results in 96 out of 96 tests passing.

@leowerneck
leowerneck requested a review from jtniehof September 18, 2026 14:13
@leowerneck leowerneck self-assigned this Sep 18, 2026
@leowerneck leowerneck added bug Something isn't working Ins: GLOWS Related to the GLOWS instrument Release Blocker Needs to be addressed before (next) public release Data Release 2 Deadline: September 1, 2026 labels Sep 18, 2026
@leowerneck leowerneck added this to IMAP Sep 18, 2026
@leowerneck leowerneck moved this to PR Open in IMAP Sep 18, 2026

@lacoak21 lacoak21 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice ! Looks good.

@leowerneck
leowerneck merged commit 689461c into IMAP-Science-Operations-Center:dev Sep 18, 2026
22 checks passed
@github-project-automation github-project-automation Bot moved this from PR Open to Done in IMAP Sep 18, 2026
@leowerneck
leowerneck deleted the 3474-bug---glows-l1b--issue-with-handling-exclusions-by-instrument-team branch September 18, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Data Release 2 Deadline: September 1, 2026 Ins: GLOWS Related to the GLOWS instrument Release Blocker Needs to be addressed before (next) public release

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

BUG - GLOWS L1b: issue with handling exclusions by instrument team

2 participants