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
JP-3566 Move pixel replace before resample/cube build #8409
base: master
Are you sure you want to change the base?
JP-3566 Move pixel replace before resample/cube build #8409
Conversation
@tapastro |
@jemorrison That looks about right to me. Presumably the standard save_results=True approach will make the pix replace step write output files for test/debugging purposes? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8409 +/- ##
==========================================
- Coverage 57.93% 57.91% -0.03%
==========================================
Files 387 387
Lines 38839 38882 +43
==========================================
+ Hits 22502 22518 +16
- Misses 16337 16364 +27 ☔ View full report in Codecov by Sentry. |
@tapastro The pixel replace step assumed the input data was a single input not a model container since it was written for calspec2. Now the pixel_replacement step needs to also work over ModelContainers. In calspec2 the code it works as expected. In the cal file, bad pixels have a science value of nan. If I save the pixel_replace output then the science frame has the nans replaced (so now these files look like the old ca files). The files names are expected. In calpsec3 the code works fine. The output filenames when pixel_replace.save_results=True are not what I was expecting. I need to make the name look more like the output from outlier detection, for example: Not sure what I am doing wrong. |
@emolter @hbushouse I looked at what outlier detection was doing for file names and I can get the correct looking file name and I print it in the step (I left the print statement in the code for now - to show you where it works). But the final resulting output names are the same. Hum ? What I am missing ? Snipet of code: |
It looks like the style checks are failing: The second one of these makes me worried that there is no test coverage for the renaming, because this seems like it should cause failures. Is there a way to write a unit test that ensures the output filenames are as expected given association and non-association inputs? |
200eb35
to
6caec07
Compare
04732a7
to
ea06d9e
Compare
@hbushouse For MIRI IFU , NIRSpec IFU and FS I added new test that ran pixel_replace, since at this time pixel_replace.skip=True in the pipeline for those modes. I think that might change in the future, so I just added another test rather than changing the main test. For these new tests I uploaded all the truth files. I do not have a test for NIRSpec MOS data. I hope having all the other tests is good enough. https://plwishmaster.stsci.edu:8081/job/RT/job/JWST-Developers-Pull-Requests/1417/ There are main failures - several of them are related to Extra keyword 'S_PXREPL' in b: 'SKIPPED'. This is when pixel_replace is not run on the data. If you want me to I can go through the results and okify them. I just need a refresher on how that is done. |
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.
Code changes look fine to me. There's probably some way to refactor pixel_replace_step to avoid the long if...else chain but I don't think that's very important.
Should I be worried about the bigdata error that the regtest run can't find certain files in Artifactory? e.g. this one?
Running new regression tests: 1469 |
@hbushouse I added pixel replace to calspec3 documentation - the table. There is a check mark for what spec3 runs by default. Or that is my understanding of check mark. I just put MIRI FS - is that correct ? |
new regression tests at: I have made so many changes recently that I am going upload new truth files for the nirspec ifu spec3 test. Then I will run another regression test |
@hbushouse @melanieclarke I think all the failures are expected because pixel_replace is not run before the cal file is called. |
eebbf12
to
c465c30
Compare
@hbushouse I have not added pixel_replace to the documentation on tso3. I was not sure what to do here. I can add it to the table of steps and then just not put a check mark next to it. |
Resolves JP-3566
Closes #8340
This PR moves the pixel replace step to right before resample/cube build in both the Spec2 and Spec3 pipelines. The *cal.fits files now do not include the replace pixel values. These replacements are occurring right before resample/cubebuild.
Checklist for maintainers
CHANGES.rst
within the relevant release sectionHow to run regression tests on a PR
as of 5/22/3:30 the latest regression tests are at
https://plwishmaster.stsci.edu:8081/job/RT/job/JWST-Developers-Pull-Requests/1470/