[AstroPy] Problem running pywcs example
erwin at mpe.mpg.de
Wed Aug 18 15:56:03 EDT 2010
Thanks for the quick reply!
It looks like what happened is that *was* an earlier version of pywcs hiding
in /Users/erwin/lib/python [as opposed to
which is where pywcs 1.9 got installed]. Possibly it got installed as part of
an earlier installation of stsci_python ...
Anyway, I nuked the earlier installation, and now pywcs seems to work.
Am I missing something, or does the documentation for pywcs mention anywhere what
"sky coordinates" actually means (i.e., allowed formats, types, order, etc.?).
(From my experiments so far, I'm guessing that the output of WCS.wcs_pix2sky()
for a single pair of pixel coordinates is [[Dec, RA]], with both in decimal degrees...?)
On Aug 18, 2010, at 9:04 PM, Michael Droettboom wrote:
> This problem occurs due to a version incompatibility between pyfits and
> Recent versions of pyfits (2.3 and later) were refactored to no longer
> support numarray. pywcs required a change to be compatible with this
> (this change first appeared in pywcs 1.8).
> Given the versions you list, you should be ok -- however it seems that
> you are not running the version of pywcs you think you are. Perhaps you
> need to blitz the installation directory (in your case,
> /Users/erwin/lib/python/pywcs) and reinstall.
> On 08/18/2010 02:40 PM, Peter Erwin wrote:
>> I decided to check out pywcs (in part because using Pyraf to get pixel values from
>> RA,Dec pairs seemed to be overkill, and wcwcstran was failing to work for SDSS
>> images with declinations close to zero).
>> The installation ("python setup.py install") seemd to go fine, but I ran into the following when I tried
>> running the example from http://stsdas.stsci.edu/astrolib/pywcs/examples.html
>> <<begin quote>>
>> In : hdulist = pyfits.open("pgc1905g_94-220.fits") # this is an SDSS g-band image
>> In : wcs = pywcs.WCS(hdulist.header)
>> AttributeError Traceback (most recent call last)
>> /Users/erwin/Documents/Working/ESO_observing/WFI/targets/pgc1905_808/<ipython console> in<module>()
>> /Users/erwin/lib/python/pywcs/pywcs.py in __init__(self, header, fobj, key, minerr, relax, naxis)
>> 176 self.naxis = wcsprm.naxis
>> --> 178 det2im = self._read_det2im_kw(header, fobj)
>> 179 cpdis = self._read_distortion_kw(
>> 180 header, fobj, key=key,dist='CPDIS', err=minerr)
>> /Users/erwin/lib/python/pywcs/pywcs.py in _read_det2im_kw(self, header, fobj)
>> 278 cdelt = [1.,1.]
>> --> 280 if not isinstance(fobj, pyfits.NP_pyfits.HDUList):
>> 281 return (None, None)
>> AttributeError: 'module' object has no attribute 'NP_pyfits'
>> <<end quote>>
>> My system is: MacBook Pro (2009) running Mac OS 10.6.4, Python 2.6.5 (standard framework install
>> from python.org) via ipython 0.10
>> numpy 1.4.1
>> pyfits 2.3.1 [same problem occurred for pyfits 2.2.2; I
>> pywcs v1.9-4.4.4
>> (All packages are installed inside the framework directory, *except* for pyfits, which installed in
>> ~/lib/python )
>> Any suggestions?
>> -- Peter
>> Peter Erwin Max-Planck-Insitute for Extraterrestrial
>> erwin at mpe.mpg.de Physics, Giessenbachstrasse
>> tel. +49 (0)89 30000 3695 85748 Garching, Germany
>> fax +49 (0)89 30000 3495 http://www.mpe.mpg.de/~erwin
>> AstroPy mailing list
>> AstroPy at scipy.org
> Michael Droettboom
> Science Software Branch
> Space Telescope Science Institute
> Baltimore, Maryland, USA
> AstroPy mailing list
> AstroPy at scipy.org
Peter Erwin Max-Planck-Insitute for Extraterrestrial
erwin at mpe.mpg.de Physics, Giessenbachstrasse
tel. +49 (0)89 30000 3695 85748 Garching, Germany
fax +49 (0)89 30000 3495 http://www.mpe.mpg.de/~erwin
More information about the AstroPy