CTIO Infrared Reduction Package for IRAF

(updated 2010 August 14)

This is the CTIO IR reduction package, a collection of scripts and programs for basic IR image reduction. Look in the script files (".cl") for more detailed information. See the file install.txt for installation instructions. If you have questions that your local IRAF expert can't answer, check out IRAF.NET. If you have a question about cirred, contact Bob Blum.

In the following, im1 and im2 are integers referring to IRAF  image indices. Consider image.001n and image.005n. Here, im1=1 and im2=5. Typically, the scripts will treat all images between im1 and im2 (inclusively) as a list to operate on. Some of the scripts treat "image." as a base name, or prefix (pre=), and "n" as a suffix (suf=). [ ]'s indicate optional parameters which may typically be called out on the command line. Any option can also be set in the param file.

osiris: Basic reduction. Has options for bias subtraction, flat fielding, bad pixel interpolation, and linearity correction. Will trim images to useful region.

Valid instruments are IRS, CIRIM, OSIRIS, and ISPI. CIRIM can be selected for a generic instrument. The image header keyword "BPM" is added if the input images are "fixed" with a bad pixel mask. This mask may be used to reject pixels when using imcombine (the option is explicitly available in the script "shift_comb.cl"; see below).
                        usage: osiris im1 im2 [options]

Can use irlincor coefficients for ISPI. Use lin=yes and inst=ISPI.

maskbad: Create a bad pixel mask using the histogram of pixel intensities. An option exists to normalize the input images by their response function which results in nearly uniform images to use in the histogram and determination of the ranges for bad pixels. Dark images, or unilluminated images with low flux should not be normalized. Uses "imsurfit" from IRAF package "images." One can individually fit the response function of the two images.

                        usage: maskbad image1 image2 [options]

med: Median combine images.
                        usage: med im1 im2 [options]

sky_sub: Construct a combined sky image and subtract it from object images. The sky may be made from separate images or from the object images themselves.

                        usage: sky_sub im1 im2 [sky="sky_image"] [options]

shift_comb: Shift and combine images using FFT cross-correlation. Option available to reject pixels in final image combination based on the bad pixel mask specified in the image header keyword "BPM." BPM is added to all images processed for bad pixels by the script "osiris.cl" (see above) but can also be added manually to the image header using "hedit."

                        usage: shift_comb im1 im2 outputimage [image_temp="template name for xcor"]

Shift_comb should not be used with images which have significant distortion and which have large inter-frame offsets. The resulting image will have a poor and variable PSF.

clearim: Delete images or other files.

                        usage: clearim filename

where the file to be deleted is one of: filename, filename.imh, filename.fits.

fixbad: Interpolate over bad pixels using a mask created by maskbad. For ".imh" files (you should be using fits; see fixfits). Fortran. Called by osiris. Can be used as a stand alone program. Needs to be compiled with fc. See the installation guide.

                       usage: fixbad mask input output method

Method = 0 interpolates in x, method=1 interpolates in x and y

Updated 2006 October 30: image size expanded to 2048 for ISPI (you can make the image size bigger by editiing the source file).

fixfits: Interpolate over bad pixels using mask created by maskbad. for ".fits" files. Fortran. Called by osiris. Can be used as a stand alone program. Needs to be compiled with "fc." See the installation guide. Defualt image size is 2048x2048. This can be adjusted in the source file "fixfits.f."       

usage: fixfits mask.fits input.fits output.fits method

Method = 0 interpolates in x, method=1 interpolates inx and y

calc_off : Used by shift_comb. Fortran. Needs to be compiled with fc. See installation guide.

extra: Extract oned spectra from 2d images. Uses apall in the IRAF twod.apextract package.

usage: extra im1 im2 [options]

spec_comb: Combine spectra with median or average. See spec_comb.cl file for various combine options.

usage: spec_comb im1 im2 spec [options]

where spec is the output spectrum.

atmo_cor: Correct an object by ratioing it to a telluric standard. Can use xcor to find a pixel shift between object and standard before ratioing.

usage: atmo_cor obj std [options]

do_osiris: meta script to reduce data using osiris.cl, sky_sub.cl, extra.cl (extract oned spectra), etc.

usage: do_osiris im1 im2 [options]

This script can be used to go from raw data to reduced spectra in "one shot." It is particularly useful for sets of flats+telluric or flats+object. Basically, it just uses the above scripts.

Last update: 14 August, 2010. RDB.