transform_wcs - Modifies WCS keywords according to a transform


transform_wcs infile=<string> transform=<string> outfile=<string>


Modify a set of WCS keywords to account for a transform applied to the underlying image. This tool can be used to adjust a set of WCS keywords to account for a transform applied by the imagetrans tool, or it may be used to apply windowing and binning to a set of WCS keywords extracted by the getwcs tool.

A set of WCS keywords specify a transform and a reference pixel. This tool applies the given transform to the reference pixel and then combines the inverse of the transform and the WCS transform in that order to get a new WCS transform.

Note that WCS keywords are linear, so it is not possible to apply a non-linear transform to them.


infile [string]

The file containing the WCS keywords to be transformed.

outfile [string]

The file into which this tool will write the transformed keywords. Any existing WCS keywords are overwritten. If the file does not exist, the tool will create a new one with an empty image. The outfile can be the same as the infile.

transform [string]

The FITS file containing the transform to be applied to the pixels which the WCS keywords refer to. This file may be generated by the getxform or combinexform tools.

(chatter = 1) [integer]

Output verbosity

(history = yes) [boolean]

Write HISTORY keywords to output?


Suppose you have a DET coordinate image called "det.img" for which you want to have WCS keywords describing RA and Dec. Note this is meaningful only if the spacecraft was stationary during the exposure. First you would write the sky WCS keywords to det.img with getwcs outfile=det.img coord=SKY Next you get the transform from SKY to DET coordinates with getxform from=SKY to=DET image=yes outfile=sky2det.trans Finally, you transform the sky WCS keywords to the DET image with transform_wcs infile=det.img transform=sky2det.trans outfile=det.img

Suppose you have an image "full.img", from which you have cropped the first 100 pixels in X and Y to get "cropped.img". Suppose also that you want the cropped.img to have the same world coordinates as full.img. First, You get the transform describing the crop with: combinexform outfile=crop.trans command="trans(-100,-100)" Then you transform the WCS keywords with transform_wcs infile=full.img transform=crop.trans outfile=cropped.img


getwcs, imagetrans,


April 2004