[AstroPy] Question about WCS and coordinate system

Slavin, Jonathan jslavin at cfa.harvard.edu
Thu Nov 14 10:50:12 EST 2013


Yannick,

Judging from the E(B-V) image at
http://lambda.gsfc.nasa.gov/product/foreground/fg_images/med_ebv_image.png
I'd say your image is upside down.  Try imshow with origin='lower' as an
argument.

Jon


On Thu, Nov 14, 2013 at 10:13 AM, <astropy-request at scipy.org> wrote:
>
> Message: 1
> Date: Thu, 14 Nov 2013 16:19:20 +0100
> From: Yannick Roehlly <yannick.roehlly at lam.fr>
> Subject: [AstroPy] Question about WCS and coordinate system
> To: astropy mailing list <astropy at scipy.org>
> Message-ID: <20131114161920.597ca59a at lam.fr>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi all,
>
> I'm struggling with making an all sky plot using the
> lambda_mollweide_sfd_ebv.fits reddening map available there
> http://lambda.gsfc.nasa.gov/product/foreground/fg_sfd_get.cfm
>
> When using aplpy, the coordinates are reversed so I'm trying to
> understand what's going wrong using only astropy.
>
> import numpy as np
> from matplotlib import pyplot as plt
> from astropy.wcs import wcs
> from astropy.io import fits
> hdulist = fits.open("lambda_mollweide_sfd_ebv.fits")
> imshow(np.log(hdulist[1].data), cmap="cubehelix")
>
> I'm trying to find the position of the Large Magelanic Cloud which
> should be around the pixel 2862, 562 (figure attached).
>
> wcs1 = wcs.WCS(hdulist[1].header)
> print(wcs1.wcs_pix2world([[2862, 562]], 1))
>
> -> [[ 80.13878056  33.70194417]]
>
> But the LMC should be around 280, -32
>
> Do I do something wrong?
>
> A secondary question would be: when using WCS pix2world and world2pix,
> what is the coordinate system used? The one declared in the fits header?
>
> Cheers,
>
> Yannick
>
> --
> How many weeks are there in a light year?
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: figure.jpg
> Type: image/jpeg
> Size: 58825 bytes
> Desc: not available
> Url :
> http://mail.scipy.org/pipermail/astropy/attachments/20131114/a0a5169c/attachment.jpg
>
> ------------------------------
>
-- 
________________________________________________________
Jonathan D. Slavin                 Harvard-Smithsonian CfA
jslavin at cfa.harvard.edu       60 Garden Street, MS 83
phone: (617) 496-7981       Cambridge, MA 02138-1516
fax: (617) 496-7577            USA
________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20131114/8e527628/attachment.html>


More information about the AstroPy mailing list