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

JP-3567: SIP coefficient accuracy and consistency #8529

Merged
merged 6 commits into from
Jun 8, 2024

Conversation

melanieclarke
Copy link
Collaborator

@melanieclarke melanieclarke commented May 31, 2024

Resolves JP-3567

Closes #8341

These changes align the default parameters for WCP SIP approximation in the three places they are used: the assign_wcs step, the tweakreg step, and the underlying update_fits_wcsinfo function defaults. New step parameters are added for tweakreg, matching the ones in assign_wcs, so that the parameters used in both steps can be modified together.

The new defaults for assign_wcs should result in better accuracy in the output FITS WCS.

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

@melanieclarke
Copy link
Collaborator Author

Copy link

codecov bot commented May 31, 2024

Codecov Report

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

Project coverage is 58.13%. Comparing base (b7e0b10) to head (66d3f0c).
Report is 311 commits behind head on master.

Files with missing lines Patch % Lines
jwst/tweakreg/tweakreg_step.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8529      +/-   ##
==========================================
+ Coverage   58.02%   58.13%   +0.10%     
==========================================
  Files         388      388              
  Lines       38977    38972       -5     
==========================================
+ Hits        22617    22655      +38     
+ Misses      16360    16317      -43     

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

@melanieclarke
Copy link
Collaborator Author

Regression tests look mostly as expected. There are some unrelated changes for MIRI LRS; all other changes are to the WCS keywords in the SCI headers for imaging and WFSS modes.

@melanieclarke melanieclarke marked this pull request as ready for review June 3, 2024 15:02
@melanieclarke melanieclarke requested a review from a team as a code owner June 3, 2024 15:02
@melanieclarke melanieclarke requested a review from nden June 3, 2024 20:43
@hbushouse
Copy link
Collaborator

@melanieclarke Is this ready for review?

@melanieclarke
Copy link
Collaborator Author

@hbushouse - Yep, I think it's good to go. Nadia's review would be helpful, if she can, since she worked on this ticket.

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.

Everything looks good to me. Just curious, though, as to why the regtest results show that for most results the order of the fit (and hence the number of SIP coeff keywords in the headers) has increased, but for one MIRI imaging result it appears that the order of the fit has been reduced compared to before. Any thoughts?

@melanieclarke
Copy link
Collaborator Author

melanieclarke commented Jun 5, 2024

@hbushouse - I saw that. I suspect it's because we increased the number of points, so it needed a smaller order to reach the required accuracy, but I haven't checked that assumption. I'll check it out.

EDIT:
My assumption was wrong. It looks like the WCS fit for the MIRI image is failing to converge to the requested accuracy with the larger number of sampling points. MIRI might want to set their parameters for these steps to a lower value for sip_npoints and/or a higher value for sip_max_pix_error.

Copy link
Collaborator

@nden nden left a comment

Choose a reason for hiding this comment

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

LGTM

@melanieclarke
Copy link
Collaborator Author

melanieclarke commented Jun 7, 2024

I'm going to push up one more small change to set the default npoints to 12 instead of 32, per discussion in the JP ticket.

@hbushouse
Copy link
Collaborator

Another regtest run (hopefully final) started at https://plwishmaster.stsci.edu:8081/job/RT/job/JWST-Developers-Pull-Requests/1508

@hbushouse
Copy link
Collaborator

Latest regtest results, while corrupted by lots of unrelated differences in NIRSpec slit data due to updates to wavecorr, show the expected increase in SIP coeff keywords for all relevant modes, such as NRC, NIS, and MIRI imaging, as well as NRC and NIS WFSS. None of them shows a decrease in the fit order anymore. So this looks good.

@hbushouse hbushouse merged commit d6435f1 into spacetelescope:master Jun 8, 2024
28 checks passed
@melanieclarke melanieclarke deleted the jp-3567 branch June 10, 2024 14:17
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.

Update SIP coefficient accuracy
3 participants