[AstroPy] Curious bug in Pywcs?

Erik Bray embray@stsci....
Tue Sep 6 10:54:54 CDT 2011


On 09/06/2011 11:33 AM, Nicolas Gaudin wrote:
> Hi,
>
> 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
> pyplot.figure()
> 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?

I can't offer any answers on this, unfortunately.  But for what it's 
worth I can't reproduce this behavior.  I tried it with PyFITS 2.3.2 and 
PyFITS from trunk, pywcs 1.9 and 1.10, and matplotlib 1.0.

Erik B.


More information about the AstroPy mailing list