[AstroPy] Confusion about WCS origin

David Shupe shupe at ipac.caltech.edu
Wed Mar 18 10:43:19 EDT 2015


Dear Rahul,

The origin parameter corresponds to the convention for numbering the pixels. The convention used in FORTRAN and FITS files is that the center of the first pixel has pixel coordinates [1.0, 1.0]. In the convention used by C and Numpy, the center of the first pixel is [0.0, 0.0].  

Even though you are giving a Numpy array to the function, you must specify which pixel numbering convention you are using with the origin argument. 

If you view an image with ds9, you can see that it uses the FORTRAN/FITS convention for numbering pixels.

Regards,
David

> On Mar 17, 2015, at 6:36 PM, Rahul Patel <rahul.patel.1 at stonybrook.edu> wrote:
> 
> Dear all,
> 
>    I am using the WCS package in astropy and ran into some confusion on what to set the origin. For instance, when transforming from pixel to wcs
> 
> world = w.wcs_pix2world(pixcrd, 1)
> 
> the doc says to use 0 for origin assuming C and numpy and 1 for fits and fortran. The above example uses "1" but everything loaded into python is a numpy array. Any clarification would be useful. Thank you.
> 
>  
> 
> 
> Rahul I. Patel 
> -----------------------------------------------------------------
> Rahul.Patel.1 at StonyBrook.edu <mailto:Rahul.Patel.1 at stonybrook.edu>
> Department of Physics and Astronomy
> State University of New York at Stony Brook
> WEB: http://www.astro.sunysb.edu/rpatel <http://www.astro.sunysb.edu/rpatel>
> ----------------------------------------------------------------- 
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20150318/73497247/attachment.html>


More information about the AstroPy mailing list