parapredriz -- prepare drizzle scripts for ESO Imaging Survey
parapredriz image outmode
- image = "" [file name template]
- The names of the input image files which are to be used as inputs to the coaddition. This is normally a regular expression (eg, *.fits) or could be a file with a list by using the @ syntax.
- outmode = "bestfit" [tiles|bestfit|single]
- The mode for parapredriz.
In "tiles" mode scripts are produced which include drizzle commands for the full area covered by the inputs and produces a set of (automatically named) output tiles with the reference point as the centre of tile "0,0".
In "bestfit" mode scripts are produced which will drizzle onto the minimum number of output sections necessary to cover all the input images. The naming scheme is similar to in "tiles" mode except that the origin is the central section of the output rather than the reference point.
In "single" mode drizzle commands are produced to coadd all the inputs which overlap a single output image which is specified by its centre position. In single mode the result is written to STDOUT and is normally redirected into a file. In tiles and bestfit modes the results are written to script text files, one for each parallel stream.
- (npara = 1) [int]
- The number of parallel streams (ie, the number of processors on which the resultant scripts will be run). When this is more than one the drizzle commands are divided up so that each stream works on different output tiles to avoid access conflicts. The output files are Iraf cl scripts named "stem"-NNN.cl where "stem" is a user parameter and NNN is a three digit number.
- (stem = "COAD") [string]
- The first part of the name of the output Iraf cl scripts to which the stream number will be appended as described under "npara" above. This stem is also the first part of the names of the output images which will be produced in "tiles" and "bestfit" modes.
- (output = "") [file name]
- Output image name in the case outmode="single". The corresponding weight output image will have ".weight" appended. This parameter is ignored and the name created internally in the outmode="tiles" case.
- (outra = 0.0) [real]
- The right ascension in degrees for the centre of the output image in the case of outmode = "single".
- (outdec = 0.0) [real]
- The declination in degrees for the centre of the output image in the case of outmode = "single".
- (proj = "TAN") [string TAN|COE]
- The projection for the output image which will be produced by the drizzling. For small or modest fields (up to about 0.5 degrees) TAN is best as it is widely supported and understood. COE has advantages for very large fields to minimise distortion.
- (direct = "") [string]
- The name of a directory where the input image files are to be found. This is only needed if they not in the current directory. It may either be in UNIX style (/home/eis3c/data/) or IRAF style (eisdata$). This option may be useful if the coadded output images are to go into a different place from the input data files.
- (raref = 0.0) [real]
- The Right Ascension of reference point of the super-image in degrees.
- (decref = 0.0) [real]
- The Declination of the reference point of the super-image in degrees.
- (outscl = 0.27) [real]
- The scale of the output image(s) in arcseconds per pixel.
- (outnx = 4096) [integer]
- The size in X of the output images.
- (outny = 4096) [integer]
- The size in Y of the output images.
parapredriz is a task to prepare IRAF (cl) scripts which coadd EIS or similar images. It looks at the headers of the input images, decides on suitable drizzle commands and parameter values and writes the result as IRAF cl scripts which can subsequently be executed to perform the coaddition using the EIS version of drizzle.There are three modes: "tiles","bestfit" and "single":
In the "tiles" case the output script(s) includes drizzle commands which will coadd all the inputs onto ALL the output sections which they overlap. In the "tiles" case the "reference output section" is centred on the reference point. The "bestfit" mode is similar except that the output sections are positioned so that they are best filled by the input images and are numbered relative to the centre of this area.
The output tiles are automatically named corresponding to their offsets within the super-image. The names are created from the 4 characters of "stem" parameter followed by "-CA" and then the offset in the super-image (eg, +02-04 for the tile two along and four down relative to the centre of the super-image).
In "tiles" and "bestfit" modes the output is always written to text files named by combining the "stem" supplied by the user with the number of the stream.
In "single" mode there is just one output image which is given a name and a centre position by the user who sets the "output","outra" and "outdec" parameters. In this case the drizzle commands will coadd all the inputs which overlap this output image. This mode is convenient for tests. The cl commands in this case are written to STDOUT (ie, the terminal) rather than directly to a file but they can be redirected if necessary.
This version also allows the output to be divided up in a way suitable for parallel processing. This is controlled by setting the "npara" parameter to a value greater than 1. In this case "npara" script files are created with the output image sections divided between then. In this way it is guaranteed that the same output is not simultaneously written to be different processing streams. Reading the same input in parallel may occur but is harmless.
Note than if multiple output sections have been produced, in parallel or not, then they will not have matched context tables - the contexts will be only appropriate for a given image and not globally. In this case the task "dcon" can be used to build a master context table and update all the headers so that contexts are globally unique. The help for the "mcon" task should be consulted for more information.
This will search all the images matching the specified wild-card image template and work out where to put output sections to be best filled by the input images. The result, in the file test-001.cl, will be an IRAF script which contains the full details of the drizzle commands, and their parameters, needed to do all the coadditions. It is assumed that all the fits files in the current directory are to be coadded onto 4096x4096 output tiles.parapredriz image="*_??.fits" outmode="bestfit" \ raref=340.725 decref=-39.4667 nx=4096 ny=4096 stem="test" npara=1
This file may then be executed by typing:
The standard naming convention for EIS Wide has input images with names like: A_I_02_17.fits for data images - patch A, band I, row 2 frame 17 - and assumes that the weighting images are named A_I_02_17.weight.fits.cl <test-001.cl
The naming for the output images in the "tiles" case assumes that the reference pixel will be at the centre of a frame called <stem>-CA+00+00 and the surrounding tiles will have names like: <stem>-CA+02-03 for the one 2 along to the right and 3 lower. The corresponding output weight image would be named <stem>CA+02-03.weight. In the "bestfit" case the centre is determined by where the images fall, not the reference point.
Because many input images will fall on the boundaries of output sections it is necessary for the same input image to be drizzled several times during the course of coaddition.
It would be nice if the single mode could also write to a file rather than STDOUT.
It takes practically no time at all.
drizzle,mcon