Skip to content

Skip L2 processing if no good times are found#2775

Open
vmartinez-cu wants to merge 5 commits intoIMAP-Science-Operations-Center:devfrom
vmartinez-cu:glows-no-good-times
Open

Skip L2 processing if no good times are found#2775
vmartinez-cu wants to merge 5 commits intoIMAP-Science-Operations-Center:devfrom
vmartinez-cu:glows-no-good-times

Conversation

@vmartinez-cu
Copy link
Collaborator

@vmartinez-cu vmartinez-cu commented Feb 25, 2026

This PR updates L2 processing to exit processing early and return an empty list if no good times are found in the l1b input dataset.

File changes

  • glows_l2_data.py - added a factory class method that checks if good times exist before proceeding with creating the l2 histogram data class. If no good times are found, it returns None

  • glows_l2.py - updated call to the histogram data class to use new class method to create the instance

Testing

  • test_glows_l2.py - updated existing unit tests to include coverage for when there are no good times in the data

Closes #2372

Copy link
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

This PR implements early exit from L2 processing when no good times are found in the L1B input dataset, addressing issue #2372. The solution uses a factory method pattern to validate data before processing and returns an empty list instead of creating invalid output files.

Changes:

  • Added a factory class method HistogramL2.create() that checks for good times before instantiation
  • Refactored HistogramL2.__init__() to accept pre-filtered data, removing validation logic from the constructor
  • Updated glows_l2() to handle None return from factory method and log warnings appropriately

Reviewed changes

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

File Description
imap_processing/glows/l2/glows_l2_data.py Added factory method create() for validation and filtering; refactored constructor to accept only good data; fixed spelling in error message
imap_processing/glows/l2/glows_l2.py Updated to use factory method; added logging for no-good-times case; returns empty list when appropriate
imap_processing/tests/glows/test_glows_l2.py Added test case for HistogramL2.create() returning None when no good times exist

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

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

Labels

enhancement New feature or request

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

ENH - Skip L2 processing when no good times are found

2 participants