[AstroPy] Curious bug in Pywcs?

Nicolas Gaudin nicolas-gaudin@laposte....
Tue Sep 6 10:33:05 CDT 2011


I think there is a bug in Pywcs (package pywcs-1.10-4.7.tar.gz, 
python2.7.1-0ubuntu5, matplotlib0.99.3-1ubuntu4).  A minimal exemple :

import pyfits
import pywcs
from matplotlib import pyplot

fits = pyfits.open('/home/gaudin/thesis/data/things/DDO154_NA_MOM0_THINGS.FITS')
head = fits[0].header
wcs = pywcs.WCS(head)
print wcs.all_pix2sky([[0., 0., 0., 0.],], 0)

The .FITS can be found here: http://www.mpia.de/THINGS/Data.html, it prints 
(always? the bad result):
[[ 17.74922799 -14.30123514   1.          29.        ]]

If I comment the line pyplot.figure() I have the good result:
[[  1.93759669e+02   2.69403525e+01   1.00000000e+00   1.44255606e+09]]

I don't understand why the call pyplot.figure(), only *before* the call to 
pywcs.WCS(head), produces a bug in pywcs.all_pix2sky.

Could you confirm this strange behaviour?  Is it a bug?

More information about the AstroPy mailing list