Skip to content
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

WIP: JP-3622 Update refpix step for NIR detectors to use convolution kernel #8726

Open
wants to merge 45 commits into
base: main
Choose a base branch
from

Conversation

penaguerrero
Copy link
Contributor

@penaguerrero penaguerrero commented Aug 26, 2024

Resolves JP-3622

Closes #

This PR addresses the addition of an optimized convolution kernel to the REFPIX step

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

  • added entry in CHANGES.rst within the relevant release section
  • updated or added relevant tests
  • updated relevant documentation
  • added relevant milestone
  • added relevant label(s)
  • ran regression tests, post a link to the Jenkins job below.
    How to run regression tests on a PR
  • All comments are resolved
  • Make sure the JIRA ticket is resolved properly

@penaguerrero penaguerrero requested a review from a team as a code owner August 26, 2024 17:30
Copy link

codecov bot commented Aug 26, 2024

Codecov Report

Attention: Patch coverage is 30.50847% with 82 lines in your changes missing coverage. Please review.

Project coverage is 61.15%. Comparing base (19f7809) to head (9e8f04a).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
jwst/refpix/optimized_convolution.py 10.00% 63 Missing ⚠️
jwst/refpix/refpix_step.py 44.44% 10 Missing ⚠️
jwst/refpix/reference_pixels.py 70.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8726      +/-   ##
==========================================
- Coverage   61.85%   61.15%   -0.70%     
==========================================
  Files         377      378       +1     
  Lines       38877    38984     +107     
==========================================
- Hits        24046    23842     -204     
- Misses      14831    15142     +311     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@penaguerrero
Copy link
Contributor Author

This PR should be coordinated with spacetelescope/stdatamodels#321

@melanieclarke
Copy link
Collaborator

@penaguerrero - This implementation looks pretty faithful to the example notebook we were given, but I think with a little more effort, we can integrate it more smoothly into the existing code base.

This correction is intended to replace the rolling median in the side reference pixel correction, if desired. I think it was probably implemented as a totally separate correction just to make it possible to call it as a post-hook for the step. What would be more natural for our code is to keep the existing side pixel identification and signal subtraction structure, and just add an alternate method that does the convolution, to sub in for the median_filter function as needed.

That is, modify the calculate_side_ref_signal function here:

def calculate_side_ref_signal(self, group, colstart, colstop):

to check for a "use convolution" option. If desired, then an optimized convolution filter is called. If not, the median_filter function is called as usual.

That is, we are not turning off side pixel correction and adding in a whole new correction, we're just replacing the low-level median filter for the side pixels with the convolution filter instead. Does that make sense?

@penaguerrero
Copy link
Contributor Author

@melanieclarke thank you, I had done something like that but then I took it back. I think this new version is better.

CHANGES.rst Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants