spacetelescope / jwst

Python library for science observations from the James Webb Space Telescope
https://jwst-pipeline.readthedocs.io/en/latest/
Other
561 stars 167 forks source link

JP-3639: Implement 1/f noise correction for ramp data #8669

Closed melanieclarke closed 2 weeks ago

melanieclarke commented 2 months ago

Resolves JP-3639

Closes #8517

Add a flicker noise correction step to the detector1 pipeline.

Implements both a median-based correction, based on Chris Willott's image1overf, and an fft-based algorithm, based on Bernard Rauscher's NSClean. The nsclean step in spec2 is now aliased to the clean_flicker_noise step, which can support either rate-like input or ramp-like input.

Various scene masking options are provided for either correction option. When run from detector1, the ramp_fit step is run to generate a temporary rate image, used to generate the scene mask. For NIRSpec spectral data, if mask_science_regions is True, the assign_wcs and msaflagopen steps are additionally run to allow masking of the entire science area. For MIRI imaging data, if mask_science_regions is True, the flat_field step is run to retrieve NON_SCIENCE flags, used to block light from the metering structure.

Checklist for PR authors (skip items if you don't have permissions or they are not applicable)

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 93.78531% with 33 lines in your changes missing coverage. Please review.

Project coverage is 61.74%. Comparing base (9f82b52) to head (0396186). Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
jwst/clean_flicker_noise/clean_flicker_noise.py 96.65% 16 Missing :warning:
jwst/nsclean/nsclean_step.py 5.88% 16 Missing :warning:
jwst/pipeline/calwebb_detector1.py 50.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #8669 +/- ## ========================================== + Coverage 60.75% 61.74% +0.99% ========================================== Files 375 377 +2 Lines 38367 38716 +349 ========================================== + Hits 23308 23904 +596 + Misses 15059 14812 -247 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

melanieclarke commented 3 weeks ago

This is ready for initial reviews. There is one change outstanding for the NSClean implementation (#8745), which needs to merge first, but I'd like to get the rest of the code reviewed for software issues. I'll run regression tests after the NSClean change is done, unless it would be helpful to see them now.

melanieclarke commented 2 weeks ago

Regression tests started here: https://plwishmaster.stsci.edu:8081/job/RT/job/JWST-Developers-Pull-Requests/1707/

melanieclarke commented 2 weeks ago

In the regression test results: