8000 JP-3738: Subtract pedestal dark for MIRI MRS when constructing selfcal minimum by drlaw1558 · Pull Request #8771 · spacetelescope/jwst · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

JP-3738: Subtract pedestal dark for MIRI MRS when constructing selfcal minimum #8771

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 5 commits into from
Sep 11, 2024

Conversation

drlaw1558
Copy link
Collaborator
@drlaw1558 drlaw1558 commented Sep 10, 2024

This PR addresses JP-3738 by subtracting off the MRS median pedestal dark when performing bad pixel self calibration combine of multiple input exposures.

Tasks

  • request a review from someone specific, to avoid making the maintainers review every PR
  • add a build milestone, i.e. Build 11.3 (use the latest build if not sure)
  • Does this PR change user-facing code / API?
    • add an entry to CHANGES.rst within the relevant release section (otherwise add the no-changelog-entry-needed label to this PR)
    • update or add relevant tests
    • update relevant docstrings and / or docs/ page
    • start a regression test and include a link to the running job (click here for instructions)
      • Do truth files need to be updated ("okified")?
        • after the reviewer has approved these changes, run okify_regtests to update the truth files
  • if a JIRA ticket exists, make sure it is resolved properly

@drlaw1558 drlaw1558 requested a review from a team as a code owner September 10, 2024 18:14
Copy link
Collaborator
@emolter emolter 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, it should do what is expected. Just one style nitpick.

Regression tests need to be run too. I will start those when Jenkins is free

Comment on lines 108 to 113
if (input_sci.meta.instrument.detector.upper() == 'MIRIFUSHORT'):
selfcal_3d.append(selfcal_model.data - np.nanmedian(selfcal_model.data[50:1024-50, 503:516]))
elif (input_sci.meta.instrument.detector.upper() == 'MIRIFULONG'):
selfcal_3d.append(selfcal_model.data - np.nanmedian(selfcal_model.data[50:1024-50, 474:507]))
else:
selfcal_3d.append(selfcal_model.data)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Style nit-pick incoming: Oftentimes in the pipeline when we want to hard-code numbers like this, we create an all-caps variable at the top of the file (just below imports) like this example. I think it would be good to do this with the pedestal indices, e.g. PEDESTAL_IDX_LONG=(50,974,474,507) and then call that variable where needed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done!

Copy link
codecov bot commented Sep 10, 2024

Codecov Report

Attention: Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.

Project coverage is 60.79%. Comparing base (12f5d3e) to head (2ab2da9).

Files with missing lines Patch % Lines
jwst/badpix_selfcal/badpix_selfcal_step.py 71.42% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8771   +/-   ##
=======================================
  Coverage   60.79%   60.79%           
=======================================
  Files         373      373           
  Lines       38690    38696    +6     
=======================================
+ Hits        23523    23527    +4     
- Misses      15167    15169    +2     

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

@emolter
Copy link
Collaborator
emolter commented Sep 10, 2024

@emolter
Copy link
Collaborator
emolter commented Sep 11, 2024

Regression test failures appear to match the ones from last night's nightly run, except that the two badpix_selfcal tests are now showing 1% different pixels. If those differences look ok to you @drlaw1558 then this should be good to go, and we will ok-ify those tests once this is merged.

@emolter
Copy link
Collaborator
emolter commented Sep 11, 2024

One more thing, and sorry, I probably should have been less trigger-happy with the "approve" button. It would probably be good to add a bullet point to the Description section of the badpix selfcal docs saying that the pedestal average is subtracted from each frame for MIRI data.

@drlaw1558
Copy link
Collaborator Author

One more thing, and sorry, I probably should have been less trigger-happy with the "approve" button. It would probably be good to add a bullet point to the Description section of the badpix selfcal docs saying that the pedestal average is subtracted from each frame for MIRI data.

Good call, added.

@drlaw1558
Copy link
Collaborator Author

Regression test failures appear to match the ones from last night's nightly run, except that the two badpix_selfcal tests are now showing 1% different pixels. If those differences look ok to you @drlaw1558 then this should be good to go, and we will ok-ify those tests once this is merged.

Some small difference in the flagged pixels sounds reasonable and should be ok.

@emolter
Copy link
Collaborator
emolter commented Sep 11, 2024

everything looks good to me now

Copy link
Collaborator
@melanieclarke melanieclarke left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for reviewing, Ned, and for the fix, David!

@melanieclarke melanieclarke merged commit bd7d269 into spacetelescope:master Sep 11, 2024
31 checks passed
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
0