loop_blot -- Runs blot for a given list of input and output images
loop_blot input output shiftfile
- input = "" [Single filename or @list]
- Single input filename, or @list containing input filenames corresponding to each of the output image filenames.
- output = "" [Filename @list]
- Filelist containing the output filenames.
- shiftfile = "" [filename]
- File containing the x,y shift output from one of the two shift-related tasks (either shiftfind or avshift).
- (group = "") [integer]
- The group number of the images (only used in the case of WFPC2 4-group data, otherwise ignored).
- (shifttask = "") [string]
- The name of the task that was used to create the shiftfile (either shiftfind or avshift).
- (blot_suffix = "_bl") [string]
- Suffix that will be appended to the output blotted images.
- (tempdir = "tmp$") [file]
- Directory for temporary files.
- (verbose = "yes" ) [boolean]
- Specifies the detail of the output to the screen.
This script is designed to loop over a list of output images, specified using an @list, and run blot to create each output image. The task reads in the xshift and yshift values for each image from "shiftfile", which is expected to be in the output format of either the "shiftfind" or "avshift" tasks (one of which must be specified in the parameter "shifttask"). For WFPC2 4-group data, both "shiftfind" and "avshift" will usually have already been run and therefore the output from "avshift" should preferably be used. For non-WFPC2 data, "shiftfind" is the only task that would have been run and therefore its output would be used instead, in such cases. Once the xshift and yshift parameters have been read from "shiftfile", these are passed automatically to "blot".
The input files can be specified as either single filenames or as an @list of files. If a single input image file is specified, then this image will be "blotted" onto a variety of output images corresponding to the different shifts in "shiftfile". Alternatively, if the input is specified as an @list then it must have the same number of entries as the output image @list, and each output image will be created from a different input image with a name as specified in the input @list.
The names of the output blotted files are constructed from a root name, which is specified in the "output" filelist, together with a suffix appended to it which is determined by the value of "blot_suffix", set to "_bl" be default (consistent with the naming schemes used in the Dither Handbook examples) However, cases can occur where it is desirable to change these suffixes. This can typically happen when blot is being re-run a number of times for the same dataset, perhaps using different blotting parameters, in which case the "blot_suffix" could be set to "_bl1", "_bl2", "_bl3" etc for consecutive attempts.
The shiftfile is expected to be a plain ASCII text file, as produced by either the "shiftfind" or "avshift" files. The first column contains the filenames and the second column contains the group number (which is only used by this task if the input files are 4-group WFPC2 images). This task reads in the shiftfile and identifies the first row corresponding to the input image (and group number, if appropriate). It then reads the xshift and yshift values from columns 3 and 5 if the file has been produced by "shiftfind", and columns 5 and 6 if the file has been produced by "avshift". Intermediate columns are read in but ignored. The xshift and yshift values are then passed to "blot".
Here are a number of examples showing how to use this script, drawn from cases covered in the Dither Handbook.
1. Blot an input WFPC2 image (dr_med.hhh) onto separate output images for different shifts (img??_bl.hhh). In this case, "avshift" was run prior to this task, and created an output file called "average_shifts". For the purposes of book-keeping, the files corresponding to each WFPC2 group are put into separate subdirectories.
cl> cl> cd pc cl> !\ls -1 ../img??.hhh > ../img.list cl> loop_blot dr_med.hhh @../img.list average_shifts group=1 shifttask="avshift" cl> cd ../wf2 cl> loop_blot dr_med.hhh @../img.list average_shifts group=2 shifttask="avshift" cl> cd ../wf3 cl> loop_blot dr_med.hhh @../img.list average_shifts group=3 shifttask="avshift" cl> cd ../wf4 cl> loop_blot dr_med.hhh @../img.list average_shifts group=4 shifttask="avshift"
2. Blot a set of STIS images input images (img??.hhh), creating a separate output blotted file for each input image (to be called img??_bl.hhh). The shifts in this case were only generated using "shiftfind", which produced an output file called "shifts.txt".
cl> !\ls -1 img??.hhh > img.list cl> loop_blot @img.list @img.list shifts.txt shifttask="shiftfind"