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

Fix CelestialWCS._local computation of local jacobian when position is near ra=0 #1282

Merged
merged 2 commits into from
Apr 5, 2024

Conversation

rmjarvis
Copy link
Member

@rmjarvis rmjarvis commented Apr 5, 2024

@esheldon ran into a bug in the computation of the local Jacobian near ra=0 when using a CelestialWCS. It's the normal thing about 0 and 2pi not being close to each other, so the finite difference estimate of the jacobian ends up badly wrong.

This bug doesn't affect GSFitsWCS, which has its own implementation of this function. So that's probably why it hasn't surfaced earlier, but Erin's use case involve a wrapper of the LSST DM wcs class, where this finite difference estimate is used. The fix is (as usual) to wrap the values to be near one particular value, so the finite differences do what they are intended to do.

@rmjarvis rmjarvis added bug report Bug report lsst Relevant to LSST specifically wcs Related to WCS coordinate transformations labels Apr 5, 2024
@rmjarvis rmjarvis added this to the v2.5 milestone Apr 5, 2024
Copy link
Contributor

@esheldon esheldon left a comment

Choose a reason for hiding this comment

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

This fixes an issue I was seeing in lsst psf tests

@rmjarvis rmjarvis merged commit ded0eb7 into releases/2.5 Apr 5, 2024
10 checks passed
@rmjarvis rmjarvis deleted the local_wcs_near_ra0 branch April 5, 2024 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Bug report lsst Relevant to LSST specifically wcs Related to WCS coordinate transformations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants