ISPI data should be flat fielded and sky (and/or "dark") subtracted. These steps can be accomplished with may standard IRAF or IDL routines. One way is to use the basic reduction tool "osiris" provided in the cirred [1] set of IRAF scripts. A basic set of initial reduction steps would include:
cl> osiris n1 n2 pre=r suf=n mask=mask.fits div=yes, dome=flat.fits
n1 and n2 are command line params, the others can be set in the param file. Here pre is a "prefix" or image base name, suf will be the output image suffix and the images to be reduced have numbers n1 thru n2, inclusive. Suppose the prefix for input images is "r" for raw. If n1=1, and n2=3, then images r001.fits, r002.fits, r003.fits will be processed and images r001n.fits, r002n.fits, and r003n.fits will be output. Look over the cirred pages, the osiris param file, and the osiris.cl script itself for more information.
cl> sky_sub 10 25 sky=kskyimage make+ sub+
Where the image numbers work as in the osiris example. Prefixes and suffixes are set in the param file or on the command line. The two flags "make" and "sub" control how sky_sub behaves. Make will combine the indicated images into a sky frame, and sub will subtract that sky frame from the images. A set of independent skys could be combined with make+ ans sub- (to suppress subtraction) and applied to a separate set of object frames with make- (to suppress making of the sky frame) and sub+.
One of the most important tasks for ISPI data reduction is the assignment of a proper coordinate system and correction of image distortions. These tasks are conceptually straightforward, but often difficult to accomplish in practice (especially the latter). A preliminary set of tasks and scripts has been set up to allow for the determination of the world coordinate system keywords to be included in the image headers. A solution to higher order distortions is also available, which will allow for the registration and combination of dithered images.
The processing of ISPI images described here requires that one download and install several external packages.
> imwcs -c tmc -d t150s.dao -h 200 -n 6 -vw -p 0.303 t150s.fits
In this example, -c tmc calls for the 2MASS catalog. The location of the catalog is specified during the build process of WCSTOOLS. -h 200 calls for 200 stars to be used in the matching between the image and catalog, and -n 6 refers to the order of the fit between image and catalog positions (6 parameters in each axis). -p 0.303 gives the initial image scale in arcseconds per pixel for ISPI; this is required since this information is not in the header. Alternately, one could add SECPIX (with a value of 0.3) to the ISPI image headers. -d t150s.dao specifies that the file "t150s.dao" be used for the input x,y positions of the stars to be matched by the catalog. This file should be sorted on brightness so the brightest stars are used. The file should be one star per line, x, y, and mag. "#'s" indicate comments and are ignored in this file, as are any fields after the first three of each line. See the IMWCS Command Line Arguments [8] for more information. -vw sets the "verbose" flag along with a call (w flag) to write a new image (in this case t150sw.fits) which has the updated WCS. See the imwcs command line argument -o for more output options, including updating the input image header.
In this image, the residuals to a linear fit are shown. The peak errors in position would be about three pixels if the distortion were not accounted for. In the next image, the residuals for a 4th order fit are shown. The RMS is less than 0.1'' which is about 1/3 of an ISPI pixel.
> swarp -c swarp.gc t150sw.fits t151sw.fits t152sw.fits t153sw.fits t154sw.fits
In this example, the swarp config file is "swarp.gc" and five images are reinterpolated. Each image can have its own TNX solution, which in our example would be the combination of WCS and TNX keyword values produced by imwcs and ccmap. Unless the fit to each image is very good, it is advisable to use an average solution for the higher order terms (and rotation and scale in this case). This can easily be done in swarp by specifying an auxillary header file with the FITS keywords and values. Cutting and pasting from the above solution from the FITS header, a file of the form t15?sw.head was made for each image. The file has the following form and is identical for each image:
WAT0_001= 'system=image'
WAT1_001= 'wtype=tnx axtype=ra lngcor = "3. 4. 4. 1. -0.09223848232288634 0.095'
WAT2_001= 'wtype=tnx axtype=dec latcor = "3. 4. 4. 1. -0.09223848232288634 0.09'
CD1_1 = -8.4729762794223E-5
CD1_2 = 7.23448951262463E-7
CD2_1 = 7.40672424953437E-7
CD2_2 = 8.47678406227307E-5
WAT1_002= '30461739012073 -0.08294874238596413 0.086260218248302 -3.81821493608'
WAT1_003= '0989E-6 0.004201053595244364 0.004530606959289172 -0.722711400721411'
WAT1_004= '9 -5.887103279160741E-4 0.006853642315098468 0.0766861807819218 0. -'
WAT1_005= '0.005316483436707363 -0.4617939442868234 0. 0. 0.1156522538399243 0.'
WAT2_002= '530461739012073 -0.08294874238596413 0.086260218248302 4.34379162931'
WAT2_003= '0940E-6 -5.007423412969465E-4 6.003889063455503E-5 0.084985861670387'
WAT2_004= '73 0.003355387441743075 0.003754664665905738 -0.3911461579926636 0. '
WAT2_005= '0.001750656256554302 0.04350355226749533 0. 0. -0.5986827241716564 0'
WAT1_006= ' 0. 0. "'
WAT2_006= '. 0. 0. "'
END
These lines were copied directly from the fits header of the image used in our example to find the higher order solution. A tab follows the keyword "END."
Bad pixels may be rejected in the combine process by using the "pixel weighting" capability in SWARP. A simple weighting which rejects bad pixels can be accomplished by using the "mask2.fits" file produced by maskbad.cl (see the cirred package). This file has a 1 for each good pixel and 0 for each bad one. The file is called in the swarp configuration file by specifying its name in the WEIGHT_IMAGE keyword and using WEIGHT_MAP as the weighting method (it appears that one must specify this file name for each input image. I.e, make a coma separated list for the value of WEIGHT_IMAGE with the same file name repeated to match the number of input images). See the swarp documentation for more information. A slightly more sophisticated weight map can be made by multiplying the normalized flatfield image by mask2. Finally, one can specify a unique weight mask for each image through the file "imagename.suffix.fits" where "suffix" is given in the swarp config file, and the default is "imagename.weight.fits."
The following is an example of how ISPI images may be fully processed using the tools discussed on this page (cirred, WCSTOOLS, SWARP, IRAF).
Acknoledgements: We would like to acknowledge the useful comments and input of Silas Laycock regarding ISPI data reduction and astrometry. It is also a pleasure to acknowledge the very useful software and documentation of the Mink WCSTOOLS, the Bertin SWARP program, and the IRAF suite.
Please mail questions or comments to:
rblumATctio.noao.edu
nvdbliekATctio.noao.edu
bgregoryATctio.noao.edu
Links
[1] http://www.ctio.noao.edu/instruments/ir_instruments/datared.html
[2] http://tdc-www.harvard.edu/software/wcstools/
[3] http://tdc-www.harvard.edu/software/wcstools/imwcs/
[4] http://tdc-www.harvard.edu/software/catalogs/tmc.convert.html
[5] http://terapix.iap.fr/rubrique.php?id_rubrique=91/
[6] http://terapix.iap.fr/rubrique.php?id_rubrique=49
[7] http://tdc-www.harvard.edu/software/wcstools/wcstools.wcs.html
[8] http://tdc-www.harvard.edu/software/wcstools/imwcs/imwcs.com.html
[9] http://iraf.noao.edu/projects/ccdmosaic/tnx.html