Description
WCS.all_world2pix(world, origin, tolerance=...) is documented to iterate until the residual is within tolerance, or raise NoConvergence otherwise.
Expected behavior
Either the result should be within the requested tolerance=1e-4, or NoConvergence should be raised.
How to Reproduce
import numpy as np
from astropy.wcs import WCS
wcs = WCS(naxis=2)
wcs.wcs.crpix = [1.0, 1.0]
wcs.wcs.cdelt = [1e-10, 1e-10]
wcs.wcs.crval = [15.0, -20.0]
wcs.wcs.ctype = ["RA---TAN", "DEC--TAN"]
pixel = np.array([[1e14, 2e14]])
world = wcs.all_pix2world(pixel, 0)
recon = wcs.all_world2pix(world, 0, tolerance=1e-4)
print(np.linalg.norm(recon - pixel)) # 4.311622419765557
Versions
0.1.dev41760+g95c20c73b
Description
WCS.all_world2pix(world, origin, tolerance=...)is documented to iterate until the residual is withintolerance, or raiseNoConvergenceotherwise.Expected behavior
Either the result should be within the requested
tolerance=1e-4, orNoConvergenceshould be raised.How to Reproduce
Versions
0.1.dev41760+g95c20c73b