[AstroPy] [Pywcs] pywcs.WCS.cd array

Michael Droettboom mdroe at stsci.edu
Thu Apr 14 12:04:30 EDT 2011


Yep.  That's a bug.  Fixed in SVN r1981.  Are you able to check out from 
SVN and confirm it works for you?

Mike

On 04/14/2011 07:35 AM, Ole Streicher wrote:
> Dear list,
>
> when I try top access the individual coefficients of a pywcs.WCS object:
>
> ----------------8<---------------------------------------------------
> import pyfits, pywcs
>
> d = {'NAXIS':3,
>       'CD1_1':-4.12e-5, 'CD1_2':-3.72e-5, 'CD1_3':0,
>       'CD2_1':-3.72e-5, 'CD2_2': 4.12e-5, 'CD2_3':0,
>       'CD3_1': 0,       'CD3_2': 0,       'CD3_3':0.2,
>       'CUNIT1':'deg', 'CUNIT2':'deg', 'CUNIT3':'nm',
>       'CTYPE1':'RA---TAN', 'CTYPE2':'DEC--TAN','CTYPE3':'AWAV' }
>
> wcs = pywcs.WCS( pyfits.Header(pyfits.Card(k,v) for k,v in d.items()))
> print wcs.wcs.cd
>
> ----------------8<---------------------------------------------------
>
> results in an only 2x2 matrix with wrong coefficients:
>
> [[ -4.12000000e-05  -3.72000000e-05]
>   [  0.00000000e+00  -3.72000000e-05]]
>
> Is this on purpose, and how can I acess the CDi_j coefficient matrix
> from the WCS object? When I do a
>
> print wcs.wcs
>
> I get the correct values
>
> cd[0][]:  -4.12e-05    -3.72e-05     0
> cd[1][]:  -3.72e-05     4.12e-05     0
> cd[2][]:   0            0            2e-10
>
> Pywcs versions are 1.9 and 1.10.
>
> Regards
>
> Ole
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
>    


-- 
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA




More information about the AstroPy mailing list