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-3129: Fix WCS correction validation #7494

Merged
merged 1 commit into from
Mar 16, 2023

Conversation

mcara
Copy link
Member

@mcara mcara commented Mar 14, 2023

Resolves JP-3129

tweakreg_step has code that "validates" the fit by checking that corrections (as measured by the change of the positions of image boundary vertices before and after WCS corrections) are smaller than 10*tolerance. This is wrong check since valid corrections can be larger than 10*tolerance since usually the magnitude of corrections is dependent on searchrad parameter as well and usually searchrad >> tolerance. Any correction smaller than searchrad but larger than 10*tolerance is a valid correction when use2dhist=True. Alternatively, xoffset and yoffset can determine the magnitude of corrections. The origin of the factor 10 in 10*tolerance is unexplained too.

This PR combines the two quantities - searchrad (or xoffset and yoffset) and tolerance - to make this code work for a larger set of step parameters.

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

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

@mcara mcara added this to the Build 9.2 milestone Mar 14, 2023
@mcara mcara self-assigned this Mar 14, 2023
@mcara mcara requested a review from hbushouse March 14, 2023 05:52
@mcara mcara force-pushed the fix-large-corr-check branch from dae9b09 to 91bbb8a Compare March 14, 2023 05:56
@codecov
Copy link

codecov bot commented Mar 14, 2023

Codecov Report

Patch coverage: 75.00% and project coverage change: -0.01 ⚠️

Comparison is base (08b318e) 77.59% compared to head (1fc7b23) 77.59%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7494      +/-   ##
==========================================
- Coverage   77.59%   77.59%   -0.01%     
==========================================
  Files         452      452              
  Lines       36095    36097       +2     
==========================================
+ Hits        28009    28010       +1     
- Misses       8086     8087       +1     
Flag Coverage Δ *Carryforward flag
nightly 77.60% <ø> (-0.01%) ⬇️ Carriedforward from 08b318e
unit 49.57% <75.00%> (+<0.01%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

Impacted Files Coverage Δ
jwst/tweakreg/tweakreg_step.py 61.31% <75.00%> (-0.09%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mcara mcara changed the title Fix WCS correction validation JP-3129: Fix WCS correction validation Mar 14, 2023
@mcara mcara force-pushed the fix-large-corr-check branch from 91bbb8a to 9b941b5 Compare March 14, 2023 13:53
@mcara mcara force-pushed the fix-large-corr-check branch from 9b941b5 to 1fc7b23 Compare March 14, 2023 17:08
Copy link
Collaborator

@mairanteodoro mairanteodoro left a comment

Choose a reason for hiding this comment

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

Looking good to me.

Comment on lines +395 to 399
# Increase matching tolerance to pass '_is_wcs_correction_small' test.
# This test would detect large corrections and therefore
# would flag the quality of the fit as "bad" and therefore, it will not
# apply computed corrections ('fit_quality_is_good' test was designed by
# apply computed corrections ('_is_wcs_correction_small' test was designed by
# Warren for evaluating "quality of fit" for HAP).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this comment still valid?

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.

LGTM

@hbushouse hbushouse merged commit e54c776 into spacetelescope:master Mar 16, 2023
@mcara mcara deleted the fix-large-corr-check branch April 8, 2023 17:02
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