Skip to content

Lo L1c GoodTime Filter Fix#2758

Open
ahotasu wants to merge 2 commits intoIMAP-Science-Operations-Center:devfrom
ahotasu:Lo-GoodTimes-Fix
Open

Lo L1c GoodTime Filter Fix#2758
ahotasu wants to merge 2 commits intoIMAP-Science-Operations-Center:devfrom
ahotasu:Lo-GoodTimes-Fix

Conversation

@ahotasu
Copy link
Collaborator

@ahotasu ahotasu commented Feb 24, 2026

Updated the L1c GoodTime filter to be like the GoodTime fraction logic at line 684 as a response to bug #2757.

Change Summary

Changed logic to ensure that the GoodTime is within the pointing time.

Also added logic to return an empty dataset if there are no GoodTimes within the pointing. This seems reasonable to me--it prevents later issues with background rate determination, but I appreciate other thoughts on this solution.

Testing

Reprocessed all L1c PSETs since Jan 17 locally and validated that the new logic is working by inspecting CDFs with MATLAB to ensure that the background rates are all non-zero, which must be the case when the GoodTime filtering is working properly.
Re-ran pytest for Lo L1c; all tests pass.

like the GoodTime fraction logic at line 684.
Reprocessed all L1c PSETs since Jan 17 locally and
validated that the new logic is working.
Re-ran pytests; all pass.
@ahotasu ahotasu self-assigned this Feb 24, 2026
@ahotasu ahotasu linked an issue Feb 24, 2026 that may be closed by this pull request
# here, then later background rates determination will fail
if l1b_goodtimes_only["epoch"].size == 0:
logging.warning("No good times found for L1B DE dataset.")
return []
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there handling in place for returning an empty list?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've tested it and it works--no CDF product is created. See reply below for more info.

Copy link
Contributor

@subagonsouth subagonsouth left a comment

Choose a reason for hiding this comment

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

I have a couple of comments.

# here, then later background rates determination will fail
if l1b_goodtimes_only["epoch"].size == 0:
logging.warning("No good times found for L1B DE dataset.")
return []
Copy link
Contributor

Choose a reason for hiding this comment

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

This will cause L1C to succeed but produce no L1C file. Is that the desired behavior? Or should it raise an exception so that we see the job failed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's an excellent question that I was hoping someone would raise--it seems to me to be a philosophy/approach that the SDC needs to adopt for all instruments. I wasn't sure if this scenario had been seen or thought of before, so I was fishing for direction here... For now, this works as you indicate--I've tested with flight data that on certain days has no GoodTimes (so far?).


# Handle case where no good times are found; if we don't bail
# here, then later background rates determination will fail
if l1b_goodtimes_only["epoch"].size == 0:
Copy link
Contributor

Choose a reason for hiding this comment

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

Will you please add test coverage for this if block?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will do.

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 - Lo L1C GoodTime filtering is not working properly

3 participants