How to process images with SIP
Digital imaging and image processing form the core of modern astronomy.
Much of what we know about the structure and behavior of planets, stars,
interstellar clouds, galaxies, exotic objects, and the universe as a
whole has been learned from the processing and analysis of images.
Your instructor may have specific instructions for how you should
process and analyze images using SIP. This page outlines the basic
things you can do. There are many ways you can use SIP to work with
images. You are not limited to specific tasks since SIP, like a hand
calculator, allows you to combine images mathematically, or manipulate
one image using standard arithmetic procedures (e.g., addition,
subtraction, multiplication, division, raising to a power, mulitplying
by constants, adding constants, etc.). In the end, you are limited
mainly by your imagination.
In addition to discussion of how you can carry out basic image
processing tasks, this page discusses an Example
Image Set for Processing and Analysis that is provided at this
website. Other sources of FITS images for analysis are
- Digitized Sky
Survey --- optical images of any object or any region
of the sky; download a FITS image to your disk, then open it in SIP.
- The Galaxy
Catalog --- research quality images of 113 nearby galaxies; each FITS image can be
loaded directly into SIP.
- Skyview Virtual Telescope --- images
at many wavelengths from radio to gamma-ray of any object or region of the sky;
download a FITS image to your disk, then open it in SIP.
Standard CCD Image Processing Procedures
Digital astronomical images taken in visible light (so-called "optical"
images) are taken using a "charge-coupled device" camera, or CCD camera. These camera's have the same imaging chips as are
present in many camcorders and personal digital cameras.
Raw CCD images of the sky must be corrected for a number of "errors"
produced by the image taking process. Astronomical images downloaded
from the web may already have been subjected to these processing
procedures, and so one can proceed directly to Further
Processing or Image Analysis. This section
describes the procedures done to correct raw CCD images for these
Any pixel value in a raw image taken at the telescope is related to the
number of electrons collected in that pixel during the exposure. In the
ideal the number of electrons is exactly proportional to number of
photons from that portion of sky imaged onto that pixel. In practice the
number of electrons is equal to the number that were freed by photons
from the sky impacting on that pixel and by thermal agitation in the
pixel (the "dark current"). Furthermore, the pixel value is typically
biased upward from zero by some additive amount, even before the
exposure starts. Finally, the number of electrons produced by sky
photons is dependent upon the sensitivity of that particular pixel to
incident photons (due in part to variations in structure across the
chip, and in part to variations in the efficiency of the optical
system's delivery of photons to various locations on the chip). The
standard procedures used to correct raw images for dark current, bias,
and sensitivity variations are described at length in various sources.
What follows is a simplified discussion of the steps necessary to
implement such procedures using SIP.
Dark current correction. Dark current fills each pixel with
electrons at a steady rate dependent upon the temperature of the CCD
chip. The final number of electrons contributed by the dark current
depends upon the temperature of the chip and the length of the exposure.
The standard way to correct for this added error in the pixel values of
a sky image is to subtract an image that contains only the dark current
contribution to the sky image. The image to subtract is made by taking
an exposure of the same length of time as the sky exposure, and with the
chip at the same temperature, but with the shutter closed: a so-called
"dark image." If you are taking images yourself with your own
CCD/telescope system, you will be acquiring a "dark image" image
yourself, along with your sky image. Some CCD systems automatically
subtract a dark image at the time you take your sky image.
How to correct the sky image for dark current contribution? Simply
subtract the dark image from the raw sky image. In SIP this procedure is
done using the "Add or Subtract another Image..." selection under the
Process menu item.
Bias correction. CCD cameras typically add a bias value to
each image they record. If you know that the same specific bias value
has been added to each pixel, you can correct for this by subtracting a
constant from your sky image. This can be done using the "Add or
Subtract another Image..." selection under the Process menu item. These
cameras may add the bias value to every image they produced, even those
produced by their automatic dark correction procedure. So, you may need
to make a bias correction for any image you take with your CCD
Some CCD cameras add a different bias value to each pixel. Correcting
for this sort of bias in SIP can be done by subtracting a separate dark image
(which also has the bias in it) from the sky image.
Flat field correction. This procedure corrects for the
variation in sensitivity across the chip. In addition to raw images of
celestial objects, dark images, and bias images, the astronomer collects
one or more "flat field images" while at the telescope. A flat field
image is taken while, for example, pointing the telescope at the sky at
dusk (or dawn), or while pointing the telescope at a uniformly
illuminated screen. The exposure time is typically quite short. The idea
is that any variation in a flat field image records the pixel-to-pixel
variation in the sensitivity of the imaging system. Once the raw image
of the sky is corrected for any dark current (and bias), a flat field
correction can be done. The flat field image may also need a dark
correction if it was a long exposure (but typically it might not need
such a correction). It may also not need a bias correction, if the pixel
values are much larger than the bias value.
Once again, many additional things can be done. One goal of additional
processing might be to increase the quality of the final result. High
"quality" is equivalent to high "signal-to-noise ratio." A high
signal-to-noise image has very little "snow" (randomly varied noise from
one pixel to the next) compared to actual brightness levels in the
object of interest --- a galaxy for example.
A standard flat field correction procedure might be to (1) obtain the
average pixel value within the (dark/bias corrected) flat field image
(call it a) using SIP's "Compute Statistics in Box" selection
under the Analyze menu item, then (2) divide the flat field image
(multiplied by 1/a) into the sky image using SIP's "Multiply or
Divide by another Image..." selection under the Process menu item.
Averaging (co-adding) images. One way to increase
signal-to-noise is to average a set of images of the same object. You
may need to first shift some of the images so they are accurately
aligned with each other (use the cursor to determine the x,y pixel
location of specific star in each image, then use the "Shift Image..."
selection under the Process menu item). Then, to produce an average of a
set of images, use the "Add..." menu item. For example, if one wants to
average 3 images, "Open...." the first image, and add to it the second
image. Then, using "Add...", add in the third image. Finally, using
"Add..." one last time, set a=0.33333, b=0, and c=0, to mutiply the sum
of images 1, 2, and 3 by 1/3. The final result is the average of the
SIP allows you to determine statistics within user-drawn boxes in an
image: mean (average), rms ("root-mean-square deviation from the mean"),
sum, median, min, max. You can use these statistics to determine signal-
to-noise ratios, compare different regions in the image, etc. You can
also plot a histogram of image values for any user-drawn or specified
box in the image. These analysis results are available under the Analyze
menu item. Of course, the image pixel coordinates and pixel value can be
determined by simply moving the cursor to the desired image location.
Numerous tasks can be attacked using these simple methods (What is the
angular size of an object? What is separation between
The Process menu item enables further possibilities for image analysis.
Let's look at one. If you want to investigate the small scale structure
present in an image of an object, a nebula for example, you might
consider using unsharp masking. Unsharp masking removes the large scale
structure in an image leaving the smaller scale structure. It's a form
of "high-pass filtering."
Unsharp Masking. Here is how to do unsharp masking using SIP.
First, examine the image you want to process. Unsharp masking can
enhance the contrast of smaller features in your image relative to the
larger features. What is the typical size of the features you are
interested in enhancing? Say it's 5 pixels. Smooth the image with a 5 by
5 smoothing box (use the "Smooth..." selection under Process). Save the
smoothed image (either on your disk, or in a storage register). Reload
the original image. Select "Add or Subtract another image..." from the
Process menu and subtract the smoothed image from the original image. If
you want to maintain the same brightness level in the final image as you
had in the original, then set a = 3, b= -2, and c = 0. The resulting
image is the unsharp masking product. Note how fine scale structure, if
present in the original data, is now plainly visible.
Example Image Set for Processing and
Images http://www1.phys.vt.edu/~jhs/SIP/images/m42/m42_1.fit through
m42_6.fit are images of the Orion Nebula (M42) taken with an SBIG ST-7
CCD camera on the 0.4m f/4 reflector at the Martin Observatory, Virginia
Tech. (For experts: 2x2 binning was used, along with a Bessell R
photometric filter.) In each image North is up, East is to the left
(approximately). The field of view is approximately 15 arcminutes
(East-West) and 10 arcminutes (North-South). The images were taken by
students Tripp Cook, Gina Foy, Nathan Smith, and Anubav Vasudevan at
Virginia Tech. The date and time of the observation (in the FITS header)
are the beginning of the exposure in Universal Time (UT). Each image is
a 10 second exposure. These images are supplied so users can try out
some of the processing techniques described on this page. These images
were automatically dark-corrected at the time they were taken. However,
they do need bias correction in SIP (each image has a constant bias of
100 added to each pixel). They will also need flat-field correction,
using the flat-field image flat.fit (which is also dark-corrected but
not bias-corrected). Following correction, the M42 images can be
averaged together (after some shifting) to obtain a final image with a
reasonably high signal-to-noise ratio. With specific display parameters
it is possible to see either faint nebulosity in the nebula or the 4
central Trapezium stars powering the nebula. Finally, trying an unsharp
masking attack on the final image should show some interesting structure
within the nebula.
Back to SIP homepage