imcombine
sum (or average) a set of FITS images


imcombine is an optional processing step that may be executed after ccdproc to combine frames by addition or averaging. For example, imcombine would be used to combine flat-field frames reduced individually with ccdproc into a single normalized flat field.

imcombine is now being distributed with v1.2 and later of the CCDProc package. Please download and install the latest version of ccdproc rather than installing imcombine separately. As of 1998 Nov 23, imcombine is no longer available as a separate item.

Usage:

   imcombine [-anBslh] outfile infile1 infile2 ...

Options:

outfile
Name of the combined FITS file.

infile1 infile2 ...
the names of the input FITS files to be combined into outfile.

a
Compute the average of the input files instead of the sum.

n
Normalize the output image to have a mean data value of 1.0

Bsc:ec,sr:er
Compute the mean data value for the -n option within the region of interest bounded by sc:ec in columns and sr:er in rows. Default is to average the entire image.

s
output image in short integer (BITPIX=16) format, default is floating point (BITPIX=-32).

l
output image in long integer (BITPIX=32) format, default is floating point (BITPIX=-32).

h
Prints a help message.

Examples:

Example 1: Simple Sum of images

   imcombine -l mb9804.fits mb9804.001 mb9804.002 mb9804.003
Add together FITS format images mb9804.001 thru mb9804.003, creating the FITS file mb9804.fits containing the sum in long-integer (BITPIX=32) format.

An alternative way to do this would have been to type:

   imcombine -l mb9804.fits mb9804.00[1-3]
or
   imcombine -l mb9804.fits mb9804.00*
Using the numerical range and wildcard options of the shell (respectively). In general, use wildcards with caution.

Example 2: Mean of Images

   imcombine -a mzero.fits zero001.fits zero002.fits zero003.fits zero004.fits
Will average together all files named zero001.fits thru zero004.fits in the current working directory and create the output FITS file mzero.fits in floating (BITPIX=-32) format.

Use of numerical range or wildcard arguments are also allowed, as in Example 1.

Example 3: Normalized Mean Flat

   imcombine -a -n -B17:528,1:512 mvflat.fits vflat.00*.fits
Will creates a mean normalized flat image named mvflat.fits from files vflat.00*.fits, normalizing to 1.0 within the region of interest defined by the box bounded by coordinates [17:528,1:512]. If the -B option were omitted, imcombine would have computed the mean of pixels in the entire image.

Example 4: Using imcombine with ccdproc

The typical use of ccdproc is within a shell script to reduce a batch of images. Here is a segment of a shell script to create a mean normalized V-band flat field image from raw data. The raw V-band dome flats are in /data/observer/980810/ in files 980810.001.fits through 980810.006.fits. ccdproc will use the Vflat.pro file, which bias overscan subtracts and trims the flat fields as follows:
       DTYPE LONG
       DATASEC [1:512,1:512]
       BIASSEC [513:544,1:512]
       TRIM [1:512,1:512]
See the ccdproc manual for details.

Within each reduced flat-field image, the region of interest for computing the normalization will be columns 10-500 and along rows 10-500, the idea being to avoid the edges on this device.

The script would look like as follows:

   #!/bin/csh
   ccdproc -PVflat flat001.fits /data/observer/980810/980810.001.fits
   ccdproc -PVflat flat002.fits /data/observer/980810/980810.002.fits
   ccdproc -PVflat flat003.fits /data/observer/980810/980810.003.fits
   ccdproc -PVflat flat004.fits /data/observer/980810/980810.004.fits
   ccdproc -PVflat flat005.fits /data/observer/980810/980810.005.fits
   ccdproc -PVflat flat006.fits /data/observer/980810/980810.006.fits
   imcombine -n -B10:500,10:500 mvflat.fits flat00[1-6].fits
   exit
The final normalized V-band dome flat, mvflat.fits will be stored in the current working directory.

Author:

Richard Pogge (pogge@astronomy.ohio-state.edu)
OSU Astronomy Department
1998 November 23

Return to: [OSU/PLANET Software Homepage]
Updated: 1998 October 1 [rwp]