BUGS · SEE_ALSO
geotran -- geometrically transform a list of images
geotran input output database transform
- List of images to be transformed.
- List of output images. If the output image name is the same as the input image name the input image is overwritten. The output image may be a section of an existing image. The number of output images must equal the number of input images.
- The name of the text file containing the coordinate transformation (generally the database file produced by GEOMAP). If database is the null string then GEOTRAN will perform a linear transformation based the values of xin, yin, xout, yout, xshift, yshift, xmag, ymag, xrotation and yrotation. If all these parameters have their defaults values the transformation is a null transformation. If the geometric transformation is linear xin, yin, xout, yout, xshift, yshift, xmag, ymag, xrotation and yrotation can be used to override the values in the database file.
- The list of record name(s) in the file database containing the desired transformations. This record name is usually the name of the text file input to geomap listing the reference and input coordinates of the control points. The number of records must 1 or equal to the number of input images. The record names may be listed in a text file 1 record per line. The transforms parameter is only requested if database is not equal to the null string.
- geometry = "geometric"
- The type of geometric transformation. The geometry parameter is
only requested if database is not equal to the null string. The options are:
- Perform only the linear part of the geometric transformation.
- Compute both the linear and distortion portions of the geometric correction.
- xmin = INDEF, xmax = INDEF, ymin = INDEF, ymax = INDEF
- The minimum and maximum x and y reference values of the output image. If a database file has been defined xmin, xmax, ymin and ymax ymax default to the minimum and maximum values set by GEOMAP and may be less than but may not exceed those values.
- xscale = 1.0, yscale = 1.0
- The output picture x and y scales in units of x and y reference units per output pixel, e.g arcsec / pixel or Angstroms / pixel if the reference coordinates are arcsec or Angstroms. If the reference coordinates are in pixels then xscale and yscale should be 1.0 to preserve the scale of the reference image. If xscale and yscale are undefined (INDEF), xscale and yscale default to the range of the reference coordinates over the range in pixels. Xscale and yscale overide the values of ncols and nlines.
- ncols = INDEF, nlines = INDEF
- The number of columns and lines in the output image. Ncols and nlines default to the size of the input image. If xscale or yscale are defined ncols or nlines are overidden.
- xsample = 1.0, ysample = 1.0
- The coordinate surface subsampling factor. The coordinate surfaces are evaluated at every xsample-th pixel in x and every ysample-th pixel in y. Transformed coordinates at intermediate pixel values are determined by bilinear interpolation in the coordinate surfaces. If the coordinate surface is of high order setting these numbers to some reasonably high value is strongly recommended.
- interpolant = "linear"
- The interpolant used for rebinning the image.
The choices are the following.
- Nearest neighbour.
- Bilinear interpolation in x and y.
- Third order polynomial in x and y.
- Fifth order polynomial in x and y.
- Bicubic spline.
- 2D sinc interpolation. Users can specify the sinc interpolant width by appending a width value to the interpolant string, e.g. sinc51 specifies a 51 by 51 pixel wide sinc interpolant. The sinc width will be rounded up to the nearest odd number. The default sinc width is 31 by 31.
- Look-up table sinc interpolation. Users can specify the look-up table sinc interpolant width by appending a width value to the interpolant string, e.g. lsinc51 specifies a 51 by 51 pixel wide look-up table sinc interpolant. The user supplied sinc width will be rounded up to the nearest odd number. The default sinc width is 31 by 31 pixels. Users can specify the resolution of the lookup table sinc by appending the look-up table size in square brackets to the interpolant string, e.g. lsinc51 specifies a 20 by 20 element sinc look-up table interpolant with a pixel resolution of 0.05 pixels in x and y. The default look-up table size and resolution are 20 by 20 and 0.05 pixels in x and y respectively.
- 2D drizzle resampling. Users can specify the drizzle pixel fraction in x and y by appending a value between 0.0 and 1.0 in square brackets to the interpolant string, e.g. drizzle[0.5]. The default value is 1.0. The value 0.0 is increased internally to 0.001. Drizzle resampling with a pixel fraction of 1.0 in x and y is equivalent to fractional pixel rotated block summing (fluxconserve = yes) or averaging (flux_conserve = no) if xmag and ymag are > 1.0.
- boundary = "nearest"
- The choices are:
- Use the value of the nearest boundary pixel.
- Use a user supplied constant value.
- Generate a value by reflecting about the boundary of the image.
- Generate a value by wrapping around to the opposite side of the image.
- constant = 0.0
- The value of the constant for boundary extension.
- fluxconserve = yes
- Preserve the total image flux. The output pixel values are multiplied by the Jacobian of the coordinate transformation.
- xin = INDEF, yin = INDEF
- The x and y coodinates in pixel units in the input image which will map to xout, yout in the output image. If the database file is undefined these numbers default to the center of the input image.
- xout = INDEF, yout = INDEF
- The x and y reference coordinates in the output image which correspond to xin, yin in the input image. If the database file is undefined, xout and yout default to the center of the output image reference coordinates.
- xshift = INDEF, yshift = INDEF
- The shift of the input origin in pixels. If the database file is undefined then xshift and yshift determine tha shift of xin, yin.
- xmag = INDEF, ymag = INDEF
- The scale factors of the coordinate transformation in units of input pixels per reference coordinate unit. If database is undefined xmag and ymag default to 1.0; otherwise xmag and ymag default to the values found by GEOMAP. If the database file is not null then xmag and ymag override the values found by GEOMAP.
- xrotation = INDEF, yrotation = INDEF
- The rotation angles in degrees of the coordinate transformation. Positive angles are measured counter-clockwise with respect to the x axis. If database is undefined then xrotation and yrotation default to 0.0; otherwise xrotation and yrotation default to the values found by GEOMAP. If database is not NULL then xrotation and yrotation override the values found by GEOMAP.
- nxblock = 512, nyblock = 512
- If the size of the output image is less than nxblock by nyblock then the entire image is transformed at once. Otherwise the output image is computed in blocks of nxblock by nxblock pixels.
- verbose = yes
- Print messages about the progress of the task ?
GEOTRAN corrects an image for geometric distortion using the coordinate transformation determined by GEOMAP. The transformation is stored as the coefficients of a polynomial surface in record transforms , in the text file database . The coordinate surface is sampled at every xsample and ysample pixel in x and y. The transformed coordinates at intermediate pixel values are determined by bilinear interpolation in the coordinate surface. If xsample and ysample = 1, the coordinate surface is evaluted at every pixel. Use of xsample and ysample are strongly recommended for large images and high order coordinate surfaces in order to reduce the execution time.
Xmin , xmax , ymin and ymax define the range of reference coordinates represented in the output picture. These numbers default to the minimum and maximum x and y reference values used by GEOMAP, and may not exceed those values. The scale and size of the output picture is determined as follows.
ncols = ncols (inimage) if (xscale == INDEF) xscale = (xmax - xmin ) / (ncols - 1) else ncols = (xmax - xmin) / xscale + 1 nlines = nlines (inimage) if (yscale == INDEF) yscale = (ymax - ymin ) / (nlines - 1) else nlines = (ymax - ymin) / yscale + 1
The output image gray levels are determined by interpolating in the input image at the positions of the transformed output pixels. If the fluxconserve switch is set the output pixel values are multiplied by the Jacobian of the transformation. GEOTRAN uses the routines in the 2-D interpolation package.
The linear portion of the transformation may be altered after the fact by setting some or all of the parameters xin , yin , xout , yout , xshift , yshift , xmag , ymag , xrotation , yrotation . Xin, yin, xshift, yshift, xout and yout can be used to redefine the shift. Xmag, and ymag can be used to reset the x and y scale of the transformation. Xrotation and yrotation can be used to reset the orientation of the tranformation.
The output image is computed in nxblock by nyblock pixel sections. If possible users should set these number to values larger than the dimensions of the output image to minimize the number of disk reads and writes required to compute the output image. If this is not feasible and the image rotation is small, users should set nxblock to be greater than the number of columns in the output image, and nyblock to be as large as machine memory will permit.
If the CL environment variable nomwcs is "no" then the world coordinate system of the input image will be modified in the output image to reflect the effects of the linear portion of the geometric transformation operation. Support does not yet exist in the IRAF world coordinate system interface for the higher order distortion corrections that GEOTRAN is capable of performing.
It requires approximately 70 and 290 cpu seconds to correct a 512 by 512 square image for geometric distortion using a low order coordinate surface and bilinear and biquintic interpolation respectively (Vax 11/750 fpa).
1. Register two images by transforming the coordinate system of the input image to the coordinate system of the reference image. The size of the reference image is 512 by 512. The output image scale will be 1.0 and its size will be determined by the xmin, xmax, ymin, ymax parameters set in the task GEOMAP. The file "database" containing the record "m51.coo" was produced by GEOMAP.
cl> geomap m51.coo database 1.0 512.0 1.0 512.0 cl> geotran m51 m51.tran database m51.coo
2. Repeat the above command but set the output image scale to 2.0 reference images pixels per output image pixel.
cl> geomap m51.coo database 1.0 512.0 1.0 512.0 cl> geotran m51 m51.tran database m51.coo xscale=2.0 yscale=2.0
3. Repeat the previous command using an output scale of 2 reference units per pixel and bicubic spline interpolation with no flux correction.
cl> geomap m51.coo database 1.0 512.0 1.0 512.0 cl> geotran m51 m51.tran database m51.coo xscale=2. yscale=2. \ >>> inter=spline3 flux-
4. Register a list of 512 by 512 pixel square images using the set of transforms computed by GEOMAP. The input images, output images, and coordinate lists / transforms are listed in the files inlist, outlist and reclist respectively.
cl> geomap @reclist database 1. 512. 1. 512. cl> geotran @inlist @outlist database @reclist
5. Mosaic 3 512 square images into a larger 512 by 1536 square images after applying a shift to each input image.
cl> geotran image1 outimage[1:512,1:512] "" ncols=512 nlines=1536 \ xshift=5.0 yshift=5.0 cl> geotran image2 outimage[1:512,513:1024] "" xshift=10.0 yshift=10.0 cl> geotran image3 outimage[1:512,1025:1536] "" xshift=15.0 yshift=15.0
Support does not yet exist in the IRAF world coordinate system interface for the higher order distortion corrections that GEOTRAN is capable of performing.