View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

WCS support with AIPS.

Octavi Fors Aldrich wrote on Jan 05, 1999

Hi all!

We have been adding WCS support to a set of images with immatchx.ccsetwcs
task in IRAF 2.11. The resulting images seem to work with SAOimage and Skycat,
but not with AIPS. Here I attach part of the FITS header created by IRAF: 

RADECSYS= 'FK5     '                                                            
EQUINOX =                2000.                                                  
WCSDIM  =                    2                                                  
CTYPE1  = 'RA---TAN'                                                            
CTYPE2  = 'DEC--TAN'                                                            
CRVAL1  =     15.8028232142857                                                  
CRVAL2  =     62.3328343915344                                                  
CRPIX1  =      597.68161016791                                                  
CRPIX2  =     443.244410338209                                                  
CD1_1   =  -1.1259141406074E-4                                                  
CD1_2   =  3.73442780962290E-7                                                  
CD2_1   =  4.23897271224069E-7                                                  
CD2_2   =  1.12683930664224E-4                                                  
LTM1_1  =                   1.                                                  
LTM2_2  =                   1.                                                  
WAT0_001= 'system=image'                                                        
WAT1_001= 'wtype=tan axtype=ra'                                                 
WAT2_001= 'wtype=tan axtype=dec'                                                

We suspect that AIPS is not able to understand CD matrix notation, and is
waiting for the older CDELT,CROTA format. Does IRAF have some task to
transform CD to CDELT,CROTA notation?

Thanks in advance,

Octavi.


=================================================================

Octavi Fors Aldrich

Astronomy Department
Physics Faculty
Avgda. Diagonal 647
08028 Barcelona
SPAIN


octavi@fajnm1.am.ub.es

=================================================================

Lindsey Davis wrote on Jan 05, 1999


Octavi,

Other users have asked how to convert from CDELT/CROTA2 notation to CD
notation and vice versa, so I have taken the liberty of copying a recent
question and response on this subject from our sitemail archives. As you
can see below the latter conversion is not always possible.

						     Regards,
						     Lindsey Davis

PS. Make sure you check that I have the sign conventions correct in the CD to
CDELT/CROTA2 conversion, especially in the case of axis flips ... The
CDELT/CROTA2 to CD conversion follows the AIPS convention.

>
>I have several images which use the (what I believe to be normal) WCS keywords
>for the coordinate matrix:
>
>       CD1_1, CD1_2, CD2_1, CD2_2
>
>I would now like to plot them using a program called WIP, but it appears to
>require the keywords:
>
>       CDELT1, CDELT2, CROTA, ...
>
>Can you remind me how to convert the CD matrix values to these keywords?  I
>seem to recall that CDELTi = CDi_i, but I'm not sure about the rotation bit
>of it, i.e., I don't remember the coordinate transformation expression for
>the CDELT form.
>

The transformation from CDELT/CROTA2 to CD is the following.

CD1_1 =  CDELT1 * cos (CROTA2)
CD1_2 = -CDELT2 * sin (CROTA2)
CD2_1 =  CDELT1 * sin (CROTA2)
CD2_2 =  CDELT2 * cos (CROTA2)

Unfortunately there is no general transformation in the other direction
as the the CDELT/CROTA2 notation does not support skew and no generally
accepted way of representing skew was ever adopted in that notation.

On the assumption that that there is in fact no skew the reverse
transformation is the following

abs (CDELT1) = sqrt (CD1_1 ** 2 + CD2_1 ** 2)
abs (CDELT2) = sqrt (CD1_2 ** 2 + CD2_2 ** 2)
sign (CDELT1 * CDELT2) = sign (CD1_1 * CD2_2 - CD1_2 * CD2_1)

As a matter of convention for astronomical images CDELT1 should be assigned
to be negative if the above expression, actually the determinant of the CD
matrix, is negative.

The rotation angle is given as

CROTA2 = arctan (-CD1_2 / CD2_2)

or

CROTA2 = arctan ( CD2_1 / CD1_1)

If there is no skew the two expressions for rotation should be the same.
If they aren't and the skew is small you can take an average.

Last post on Jan 05, 1999