View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

preserving WCS info while using imcopy

rawat wrote on Feb 14, 2007

Hi all,
does anybody know whether the WCS information of the original image is preserved while using imcopy to carve out a section of the original image? Eg. If I have a 2048*2048 image with full WCS solution present in the header of the fits file, and I use imcopy to cut a 300*300 pixel stamp around a particular object. Will the WCS solution remain correct for the newly cut stamp? If I use something like sextractor(for example) to get the RA/DEC of the same object in the 2 images, will it give the same result? I have of course checked this and found the answers to be very similar. I would like to make sure if anyone else knows this to be true.
I would also be very interested in knowing how this is implemented inside imcopy as the documentation of imcopy is silent about this.
thanks,
abhishek.

Mike Fitzpatrick wrote on Feb 14, 2007

Abhiskek,

When you copy out an image section the 'world' WCS remains unchanged, however keywords are added (the LTV and LTM terms, these are IRAF-specific) that provide a mapping from the physical to the logical coordinates of the image (the actual pixels in the raster to their location in the parent image). You can use the WCSRESET task to reset the 'physical' system to remove these. Tasks that don't understand these 'L-term' keywords will normally just ignore them.

All of this happens inside the image i/o interface when a new copy of an image is made so that all tasks will behave the same way. Note I said when a new copy is made, passing in an image section to a task will not have these L-term keywords.

Cheers,
-Mike

Francisco Valdes wrote on Feb 14, 2007

Hi,

Actually the WCS IS updated when you copy out a section. In other words, the WCS is correctly propagated by this operation, as well as operations like block averaging and replicating. The keywords have to be updated because they follow the FITS meanings which are mappings from image pixels (call logical in IRAF) and world coordinates. The LTV/LTM information Mike referred to retains knowledge of the relation between the image pixels in the transformed (i.e. copied) raster and the original raster.

Frank Valdes

Francisco Valdes wrote on Feb 14, 2007

I should have added that, therefore, external applications like SExtractor should work correctly if they understand the particular WCS you start with in the original image before the imcopy.

Frank

Last post on Feb 14, 2007