8000 JP-2075: fixed flux scaling issues in wfss_contam by emolter · Pull Request #8416 · spacetelescope/jwst · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

JP-2075: fixed flux scaling issues in wfss_contam #8416

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

Merged
merged 3 commits into from
May 7, 2024

Conversation

emolter
Copy link
Collaborator
@emolter emolter commented Apr 10, 2024

Resolves JP-2075

Closes #6016

This PR fixes a difference in the overall signal level of simulated contamination spectra generated by the step relative to the spectra in the grism image being corrected. The flux scaling issues were found to be caused by a combination of two problems: First, background fluxes were being propagated into the grism image when the input direct image was not background subtracted, leading to unphysical broadening in the cross-dispersion direction for the model dispersed sources. Second, flux oversampling in the dispersed_pixel() function was leading to double-counting of flux; dividing the result by the oversampling factor resolved this.

Checklist for maintainers

  • 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
  • Make sure the JIRA ticket is resolved properly

@emolter emolter marked this pull request as ready for review May 6, 2024 13:47
@emolter emolter requested a review from a team as a code owner May 6, 2024 13:47
Copy link
codecov bot commented May 6, 2024

Codecov Report

Attention: Patch coverage is 77.77778% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 56.47%. Comparing base (6580914) to head (08f80b6).
Report is 2 commits behind head on master.

Files Patch % Lines
jwst/wfss_contam/disperse.py 62.50% 3 Missing ⚠️
jwst/wfss_contam/observations.py 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8416      +/-   ##
==========================================
+ Coverage   56.38%   56.47%   +0.09%     
==========================================
  Files         387      387              
  Lines       38716    38730      +14     
==========================================
+ Hits        21830    21874      +44     
+ Misses      16886    16856      -30     

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

Copy link
Collaborator
@hbushouse hbushouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Just a couple minor questions.

@hbushouse
Copy link
Collaborator

Have you run a regression test? I believe we have 1 or 2 tests of wfss_contam in the regtest suite. Of course we'll expect differences/failures due to these updates.

@emolter
Copy link
Collaborator Author
emolter commented May 6, 2024

Didn't realize there were any wfss_contam regtests; run started here

@hbushouse
Copy link
Collaborator

Didn't realize there were any wfss_contam regtests; run started here

Test results show zero failures, which normally is a good thing, but I expected differences, because we do have 1 regtest for this: test_nircam_wfss_contam.py. However, I see that that test module is set to be skipped, because of the ridiculously long run time. Can you try running that one test locally in your PR branch environment?

@emolter
Copy link
Collaborator Author
emolter commented May 7, 2024

Sure, I started that just now

edit: see JIRA ticket for results

Copy link
Collaborator
@hbushouse hbushouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@hbushouse hbushouse merged commit 53b1714 into spacetelescope:master May 7, 2024
27 of 28 checks passed
@emolter emolter deleted the JP-2075 branch May 7, 2024 19:56
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.

Investigate scaling issues of simulated spectra in wfss_contam step
2 participants
0