View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

imshift rotates wcs….

christian wrote on Jun 21, 2010

Hi,

I encountered a problem while using the task imshift, that I couldnt find described in the forum so far. Atm it seems that imshift has problems if there is a PC matrix supplied in the header for WCS information instead of a CD matrix.
When I try to shift an image with a PC matrix the image is not only shifted, but the WCS is rotated by 90 degrees in regard to the image coordinate system leading to rubbish WCS information.
When I use imshift with CD matrix containing images everything works fine.
Is there something that I am missing here or that I am doing wrong, or is this some kind of known bug ?
I am using IRAF 2.14.1 ....

Any help on the matter would be highly appreciated.

Cheers
Christian

Francisco Valdes wrote on Jun 21, 2010

If you could send a header listing and an example command line I will check it out. You can either post it or provide this as a private message.

Yours,
Frank Valdes

christian wrote on Jun 21, 2010

hm not sure what exactly you need, but here are the problematic parts I think:

commandline:
imshift infile.fits outfile_2.fits 40 40


WCS header snipet of infile:

CRPIX1  =                512.0          / Ref pixel in X                        
CRPIX2  =                512.0          / Ref pixel in Y                        
CDELT1  =          -0.00008000          / SS arcsec per pixel in RA             
CDELT2  =           0.00008000          / SS arcsec per pixel in DEC            
CTYPE1  = 'RA---TAN'                    / pixel coordinate system               
CTYPE2  = 'DEC--TAN'                    / pixel coordinate system               
PC1_1   =             0.000000          / Translation matrix element            
PC1_2   =             1.000000          / Translation matrix element            
PC2_1   =            -1.000000          / Translation matrix element            
PC2_2   =             0.000000          / Translation matrix element   


and here the outfile:

CRPIX1  =                 552. / Ref pixel in X                                 
CRPIX2  =                 552. / Ref pixel in Y                                 
CDELT1  =          -0.00008000          / SS arcsec per pixel in RA             
CDELT2  =           0.00008000          / SS arcsec per pixel in DEC            
CTYPE1  = 'RA---TAN'                    / pixel coordinate system               
CTYPE2  = 'DEC--TAN'                    / pixel coordinate system               
PC1_1   =             0.000000          / Translation matrix element            
PC1_2   =             1.000000          / Translation matrix element            
PC2_1   =            -1.000000          / Translation matrix element            
PC2_2   =             0.000000          / Translation matrix element 


...

and here what imshift added to the outfile header:


WCSDIM  =                    2                                                  
CD1_1   =  -8.0000000000000E-5                                                  
CD2_2   =  8.00000000000000E-5                                                  
LTV1    =                  40.                                                  
LTV2    =                  40.                                                  
LTM1_1  =                   1.                                                  
LTM2_2  =                   1.                                                  
WAT0_001= 'system=image'                                                        
WAT1_001= 'wtype=tan axtype=ra'                                                 
WAT2_001= 'wtype=tan axtype=dec'  


Thanks for your help.

Cheers
Christian

Francisco Valdes wrote on Jun 21, 2010

Hello Christian,

Since it was some time since I had studied the IRAF WCS capabilities I did not remember. IRAF does not currently support the CDELT/PC formulation. It supports the CD formulation. For various reasons the WCS standard ended up with both allowed. IRAF does recognized CDELTn only based on an earlier FITS convention where there is no rotation was allowed.

So to use your data with IRAF you will need to convert your header to IRAF format. A general way to do this is:

hedit <images> cd1_1 "(cdelt1*pc1_1)" add+
hedit <images> cd1_2 "(cdelt1*pc1_2)" add+
hedit <images> cd2_1 "(cdelt2*pc2_1)" add+
hedit <images> cd2_2 "(cdelt2*pc2_2)" add+


Frank

Last post on Jun 21, 2010