[AstroPy] question on fits header entry on WCS

Masato Onodera masato.onodera at gmail.com
Sat Jun 29 19:40:37 EDT 2013


Hi Peter and Eric,

after following the suggestion from you, it worked perfectly!   Thank you
very much.  Also, thanks for pointing a link on WCS-related header entries.

Cheers,
Masato


On Fri, Jun 28, 2013 at 4:04 PM, Eric L. N. Jensen
<ejensen1 at swarthmore.edu>wrote:

> 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 CD*i_j *formalism is an exclusive alternative to PC*i_j*,
> and the CD*i_j *and PC*i_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.
> -
>
>
> _______________________________________________
> 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/20130630/b2cf86ab/attachment.html>


More information about the AstroPy mailing list