Lo L1c GoodTime Filter Fix#2758
Lo L1c GoodTime Filter Fix#2758ahotasu wants to merge 2 commits intoIMAP-Science-Operations-Center:devfrom
Conversation
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.
| # 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 [] |
There was a problem hiding this comment.
Is there handling in place for returning an empty list?
There was a problem hiding this comment.
I've tested it and it works--no CDF product is created. See reply below for more info.
subagonsouth
left a comment
There was a problem hiding this comment.
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 [] |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
Will you please add test coverage for this if block?
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.