[AstroPy] Problem running pywcs example

Peter Erwin erwin at mpe.mpg.de
Thu Aug 19 12:22:05 EDT 2010

Hi Mike,

It probably would be useful to mention the units explicitly in the documentation, yes.

Your note about the RA,Dec order depending on the CTYPE arguments does help
explain some weird, inconsistent results I was getting for SDSS images (some of which
turned out to have CTYPE1="DEC--TAN", while the majority have CTYPE1="RA--TAN").
That explains why WCS.wcs_pix2sky was returning (RA, Dec) for some images and
(Dec, RA) for others.

It might be useful putting a short note about this in the documentation, since I expect
a fair number of people will be like me (i.e., expecting things to be RA,Dec by default
and unaware that this can be mixed up depending on the details of the image header).



On Aug 19, 2010, at 4:11 PM, Michael Droettboom wrote:

> On 08/19/2010 09:23 AM, Michael Droettboom wrote:
>> On 08/18/2010 03:56 PM, Peter Erwin wrote:
>>> Hi Mike,
>>> 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
>>> /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 ,
>>> 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.?).
>> The order is described in the wcs_sky2pix docstring:
>> """
>> Either two or three arguments may be provided.
>> 	• 2 arguments: An N x naxis array of x- and y-coordinates, and an origin.
>> 	• 3 arguments: 2 one-dimensional arrays of x and y coordinates, and an origin.
>> """
>> As for types, it may be any numeric type (and the underlying calculations are performed in doubles).
> And for additional clarification, I should add that the order (whether it's [dec, ra] or [ra, dec]) depends on the CTYPEia arguments in the FITS header.  You can determine that programmatically (if necessary) from the .lat, .lng, .lattype and .lngtype members.
> Mike
> -- 
> Michael Droettboom
> Science Software Branch
> Space Telescope Science Institute
> Baltimore, Maryland, USA
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy

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 mailing list