First, we want to subtract the overscan bias and then trim away the overscan region pixels from each image. We need to get a list of the (raw) image filenames and a list of output (debiased and trimmed) image filenames. There will be an equal number of filenames in our two lists and the names in the two lists will correspond line by line.
ls Image11.fits Image12?.fits > CygX1.raw cat CygX1.raw | sed s/I/i/ > CygX1.dbwould produce two lists of filenames. The raw images Image116.fits through Image129.fits would be found in CygX1.raw. The file CygX1.db would list the corresponding imagenames, but starting with lowercase 'i' rather than uppercase 'I'. The names of the output images should generally not match existing filenames because the scripts will not overwrite existing files (but they could have the same names if written to another directory).
setredYou will see a list of parameters to fill out. Type 'e' to edit the parameters. Type '2' to fill out the name of the list of input images (CygX1.raw). Next type '4' and fill out the name of the list of output images (CygX1.db). If the images lie outside the current working directory, change parameters 1 and/or 3. Change the other parameters to suit your needs. Parameter 13 defaults to 'y'; change it to 'n' since you don't want to divide by a (not yet existing) flat field. Type '0' when you have set the parameters.
If you type 'c' now, the script will check your parameters for possible problems and print out any warnings.
If you are sure the parameters are correct, type 'r' to run the process. Each image created will be listed as the script runs.
Now, if you haven't already done so, you can create a list of the raw flatfield images and process them the same way (debias and trim them).
The next step is to combined your overscan bias subtracted and trimmed flats. You should put their filenames in a list. Run setcom:
setcomAs in setred, you are given a list of parameters. To edit them, type 'e'. Set parameter 2, the filename for the list of flats to combine. Set parameter 4, the name for a combined flat to produce. Set the other parameters the way you would like. You will probably want to change at least 2 parameters from their default values: parameter 5 (to scale input images to the same mean or something) and parameter 12 (to normalize the final flatfield to a mean of 1.0).
Type 'r' to run the script and produce the combined flatfield image.
Now run setred again. This time supply it with the list of debiased object images (CygX1.db) and the name of the flat field to use. Also, create a new list of filenames for the final, reduced images. This time the only processing step you'll want to set is parameter 13 = 'y' to divide each image by the flat.