GLOWS L2 night flags#2930
Open
laspsandoval wants to merge 2 commits intoIMAP-Science-Operations-Center:devfrom
Open
GLOWS L2 night flags#2930laspsandoval wants to merge 2 commits intoIMAP-Science-Operations-Center:devfrom
laspsandoval wants to merge 2 commits intoIMAP-Science-Operations-Center:devfrom
Conversation
medley56
approved these changes
Apr 14, 2026
| Algorithm doc v4.4.7, Sec. 3.9.1, item 2 | ||
| is_night: 1 = daytime (good), 0 = night (bad) | ||
| """ | ||
| flags_with_offsets = flags.copy() |
There was a problem hiding this comment.
I'm not sure how big this array is but copy will have memory implications. If you can avoid it without creating ugly side effects to the parent data set, consider modifying it in place.
737b248 to
6508b63
Compare
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.
This pull request introduces logic to adjust the "is_night" flag in the GLows L2 processing pipeline, allowing sunrise and sunset offsets to be applied when determining valid (good) data blocks. This change ensures that the night region can be flexibly extended or shortened around sunrise and sunset transitions, as specified in the algorithm documentation. Comprehensive tests are also added to validate the new offset functionality.
Night flag offset logic:
apply_is_night_offsetstoHistogramL2that adjusts theis_nightflag in the flags array based on configurablesunrise_offsetandsunset_offsetparameters, allowing for flexible extension or shortening of the night region at both transitions.Testing enhancements:
test_apply_is_night_offsetsthat verifies the offset logic for various combinations of sunrise and sunset offsets, ensuring theis_nightflag is correctly adjusted in all cases.l1b_dataset_fulland related comments to clarify that all flags are good and both epochs are daytime, aligning with the new logic and improving test clarity. [1] [2] [3]