wlandsman / IDLAstro

Astronomy related procedures in the commercial IDL language
https://asd.gsfc.nasa.gov/archive/idlastro/
BSD 2-Clause "Simplified" License
144 stars 64 forks source link

WCS_ROTATE fails (again) for 180 degree rotations #34

Open PaddyLeahy opened 1 year ago

PaddyLeahy commented 1 year ago

Just discovered that WCS_ROTATE is still not working properly for 180 degree rotations; specifically, it fails at longitude 180 degrees:

HIDL> wcs_rotate, 180d0+[1,0,-1], 7d0+[0,0,0], phi, theta, [180d0,0d0], theta0=0d0 HIDL> print, phi
1.0000000 180.00000 -1.0000000 HIDL> print, theta 7.0000000 7.0000000 7.0000000

PaddyLeahy commented 1 year ago

Actually it doesn't matter what CRVAL is: it always fails for longitude 180, due to the trap you put in when last modified, since it replaces cases of longitude=180 with 0. Did you mean to put in 180+/-eps ?