[AstroPy] question on fits header entry on WCS

Eric L. N. Jensen ejensen1 at swarthmore.edu
Fri Jun 28 10:04:14 EDT 2013


Hi Masato,

I agree that the problem is the one Peter points out, which is that the header seems to specify the WCS in two different ways.  I"ll just add that the FITS standard specifically says 

"Note that the CDi_j formalism is an exclusive alternative to PCi_j, and the CDi_j and PCi_j keywords must not appear together within an HDU."  (http://www.aanda.org/articles/aa/full_html/2010/16/aa15362-10/aa15362-10.html#S196, Section 8.2). 

But the header you link to has both of those kinds of keywords (PC and CD)  in it.  The PCi_j keywords would appear to define a rotation of the coordinate axes, but it doesn't have any CDELTi keywords to go along with it.  So as a first cut I'd try deleting all of the PCij and PROJPi keywords, and changing the RADECSYS to RADESYS, and then see if that gives you the result you expect.

Eric


On Jun 28, 2013, at 7:11 AM, Peter Weilbacher wrote:

> On Thu, 27 Jun 2013, Masato Onodera wrote:
> 
>> I have a fits image with 1225x1326 pixels and header section seen in the
>> following URL: https://gist.github.com/monodera/e3d95d2bcdc8afcf860a
> [... snip ...]
>> WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' / Equatorial coordinate system
>> RADECSYS is non-standard, use RADESYSa. [astropy.wcs.wcs]
>> WARNING: FITSFixedWarning: PROJP1 = 0.0 / Projection Type of the first axis
>> Defunct PROJPn keyword rejected. [astropy.wcs.wcs]
>> WARNING: FITSFixedWarning: PROJP2 = 0.0 / Projection Type of the second
>> axis Defunct PROJPn keyword rejected. [astropy.wcs.wcs]
>> WARNING: FITSFixedWarning: PC001001= -0.939693 / Coordinate translation
>> matrix Defunct form of PCi_ja keyword. [astropy.wcs.wcs]
>> WARNING: FITSFixedWarning: PC001002= 0.342020 / Coordinate translation
>> matrix Defunct form of PCi_ja keyword. [astropy.wcs.wcs]
>> WARNING: FITSFixedWarning: PC002001= 0.342020 / Coordinate translation
>> matrix Defunct form of PCi_ja keyword. [astropy.wcs.wcs]
>> WARNING: FITSFixedWarning: PC002002= 0.939693 / Coordinate translation
>> matrix Defunct form of PCi_ja keyword. [astropy.wcs.wcs]
> [... snip ...]
>> Then I found that "w = wcs.WCS(hdu[0].header, relax=False)" gives the
>> expected result.  Since I want to make a figure with APLpy and it
>> apparently does not accept "relax=False", I would like to know which header
>> entries cause the wrong result when I put "relax=True" and how to fix it.
>> I guess they would be the entries mentioned in the warning messages, but
>> I'm not sure exactly...
> 
> That's my guess, too. Look at
> <http://docs.astropy.org/en/v0.2/wcs/relax.html> for all those obsolete
> keywords...
> In your case the PC00i00j keywords seem to contain a totally different
> WCS than CDi_j which would explain the unlikely output your script gives
> you.
> 
> Cheers,
>   Peter.
> -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20130628/7c4ba711/attachment.html>


More information about the AstroPy mailing list