-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pickle dark_date always and use it if existing for selecting dark map #312
Conversation
Regarding a possible unit test, when reviewing the 2019_206 products, I confirmed that setting the supplied date to get_aca_catalog back in time so (so that the most recent dark current before the input date matched the one we happened to have) worked to give me exactly the catalogs that I expected. So I could fiddle with something like that (manipulating input date and verifying catalogs or some pixels in the dark map or some such) for a unit test for this PR if we care. Do we care? |
This would be nice to have in ska3-matlab proseco, but now that I understand the issue I think we can work around (not seeing a huge push for this week but at the same time ...) |
TestingIn actually testing this I realized the implementation was not as useful as we'd like. Here is the new behavior and functional test:
|
I think this is ready and we should include it. Most important for review is that it retains the original behavior for the case of generating a fresh catalog. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me, this fails proseco.tests.test_catalog.test_dark_property()
|
||
# Warn if the pickled dark_date is not the same as we would have gotten based | ||
# on the observation date. | ||
dark_id_for_date = get_dark_cal_id(date=self.date, select='before') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With regard to testing, I was trying to just move around self.date, pickle, and re-load. The only confusion there I have is that we do have a lot of dates (aca.acqs.date, aca.guides.date, aca.fids.date, aca.date). I don't recall if these only exist as an artifact of using this class for everything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well that dates
thing is a feature of using a class structure where acq, guide, and fid selection are viewed as separate processes so each one needs to know its date. So in theory you can change them all independently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was trying to remember if we had a real use case for being able to independently set date or if it was just due to feature (aka artifact) of the class . Fine either way, just harder to define a test that fiddles with it if we wanted to do so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I defined a test that fiddles with the date and it seems to work fine. Each class just cares about its date. The new test is (I think) a whittled down version of the worst-case scenario you gave about a dark cal mismatch from prelim. With any luck if/when that happens there will be a visible UserWarning.
I'm in that annoying place where I have already spent way too long on a silly little PR that will probably never get exercised again, and I realize that I failed to run unit tests earlier to see that something weird is happening with how the So, waste some more time digging into that or just punt on the whole thing?? |
Always hard to know. I still considered this not worth the push, but it is likely that we'll be bit by this a few more times (which I think will generally require a prelim schedule, bad luck, and promotion of an acdc dark cal just after the pickle was made?). |
d3c4db2
to
168cc36
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent. Looks great and works for me.
I note that we'd probably need something in sparkle to handle warnings (put out to a visible log in the html report?) if we wanted to see the warnings this throws in standard usage. But as I understand it, with this PR, the plots with pixels and the reporting and such should all use the dark current used during selection, so we shouldn't need to be that aware of the warning.
Sparkles should spit out a warning to the console when generating the HTML. In our current process I think that would generally be visible. But yes, this should realize the goal of always using the same dark cal in sparkles review as was used in product generation. |
Should this drive a new release? Seems like a relatively high-value thing to get into the 2019_210 release? |
I did not see any sparkles warnings when I ran on the test products that started this |
And I expected new release and was calling it 4.7 in the 2019_210 ska3-matlab PR |
My guess is because that existing pickle does not have |
My guess seems to be wrong, and this led into the rabbit hole of all the warnings that are actually happening when running sparkles. Try |
So contrary to my expectation, sparkles does not actually use the |
Though did you try with report-level set to something? |
That might do it. I did confirm that "dark" doesn't appear in the sparkles core code, so until sparkles reaches out to proseco that code will never get triggered. If this is important we just need to have direct code in sparkles, i.e. when reading in the pickle file then either just do |
Trying to avoid this: