[SIP Image]

How To Use Sky Image Processor (SIP 2.20)

SIP allows the user to load, display, process, analyze, and save digital astronomical images. Images can be combined in a variety of ways. Standard CCD image processing procedures can be performed to convert raw CCD images taken at the telescope into final products.

SIP works with image files in FITS format. FITS stands for Flexible Image Transport System --- the astronomical data standard. Professional images are stored in FITS format; some amateur CCD systems will save images in FITS format (e.g., Santa Barbara Instrument Group cameras). FITS is the most universal format for astronomical images.

Hopefully, many of the basic things a user can do with SIP will be clear from looking at SIP's display and menu items. The following information elaborates on what can be done, and how. The first few sections explain the requirements for running SIP, how to start the program, and the basic layout of the SIP window (menus, display, message area, etc.). The subsequent sections explain the effects of each menu item. Lastly, there is a section explaining how to use SIP to perform some basic CCD reduction procedures.

In the discussion of the operation of SIP this manual assumes you are using a browser that runs signed applets, and that you have granted SIP full permissions. Smaller font text is used to clarify what happens in a browser that only runs unsigned applets.

Contents


Basics

Requirements for Running SIP

To run SIP all you need is a Java-compatible browser which has Java 1.1, or higher, capabilities (refered to as JDK 1.1). However, to exploit SIP's full capabilities, you should run SIP in a browser that will run "signed applets."

Why "signed applets"? So-called "unsigned" Java applets (typical applets) have no access to the user's disk, and files can only be loaded into the applet from the server where the applet originated. These security features are built into the Java language. In a browser that can't run signed applets SIP cannot read images from or write images to the user's disk. However, SIP has been constructed as a "signed" applet. (The digital "signature" is "John H. Simonetti" and the certificate was produced by the "Virginia Tech Certificate Authority," which assures the user that the applet has not been tampered with by anyone --- it's as if the software came in a shrink wrapped box. For more information on signed objects, and digital IDs see Netscape Object Signing: Establishing Trust for Downloaded Software.) Signed Applets have greater potential priviledges than unsigned applets. In a browser that can run signed applets, the user may grant SIP permission (via "security dialog boxes") to load and save images on the user's disk, and to load images from anywhere on the Web. In other words, SIP can run as a fully operable image processing tool (actually, since SIP can potentially read images from anywhere on the Web, SIP is more versatile than a typical image processing program which is restricted to reading from and writing to only the user's machine).

The particular browser/machines that run signed applets are discussed at Will SIP run on my machine?

Security Dialog Boxes

Netscape Communicator, Mozilla Firefox, and Microsoft Internet Explorer (MSIE) handle the running of signed applets in slightly different ways. Both provide "security dialog boxes" allowing the user to decide if they want to grant the applet permission to read/write on the user's disk, or read images from anywhere on the internet. The difference is in the implementation of these dialog boxes.

In MSIE and Firefox, as the SIP web page is downloaded, a dialog box appears asking if user want's to install and run the "SIP Applet" distributed by "John H. Simonetti." If the user clicks on the "Yes" button, the SIP applet will run without any further hassle (once the user clicks on the "Start SIP" button on the webpage to open a SIP window). If the user clicks on the "No" button, the SIP applet will not be loaded and no "Start SIP" button will appear on the SIP webpage.

In Netscape, the user will only get a security dialog box when actually running the SIP applet. When in the SIP window, the first time the user click's on the menu selection which opens an image file from the user's machine a dialog box appears stating that the Java applet is requesting additional privileges. Clicking on the "Grant" button will enable the applet to carry through on the "open file" request. All further requests to open files from the user's machine will simply be granted without another security dialog. If the user clicks on the "Deny" button, then the open file request will be canceled (and all other disk file procedures will be disallowed). A similar dialog box (and procedure) ensues when the user first attempts to open an image file from the internet. However, if the user clicks on "Deny" then in this case the user will be allowed to open an internet file, but the file must be on the SIP server (i.e., the file must have a URL such as http://www1.phys.vt.edu/~jhs/images/m51dss.fit, where "m51dss.fit" can be the name of any image at the SIP site).

In discussing how SIP works this manual assumes you grant full permissions to SIP.

Memory

As with any program, it is possible to run out of memory if you attempt to process images that are too large for your machine. If you can read an image into the program, it will not typically be a problem to process it. However, if you zoom an image to "4x" its original size (that's 4x in both dimensions!), your machine may run out of memory, depending upon the original size of the image. Each pixel is represented in memory by a 4-byte number (in image display, or for use in precise calculations). Therefore, an image with dimensions of 64 by 64 (= 4096 pixels) is a little over 16 KB in size (in memory). Zooming this image to 4x its size would require more than 262 KB of memory. A 512 x 512 image (= 262,144 pixels) is just over 1 MB in size in memory; zoomed by 4x, this image would occupy more than 16 MB of memory. If you find that a zoomed image does not display (the Image Display Area --- see below --- is totally blue), going back to a display zoom of "1x" should get you back to where you started without any problems. If you really need to greatly zoom an image (4x) to get a close look at some small part of it, try cropping the image first to yield only the part you are interesting in zooming in on.

Starting Up SIP

To run SIP go to the SIP homepage. Wait until the page and its associated data have fully loaded, then click on the the "Start SIP" button.

SIP starts up by displaying its own window with various pull-down menus, an image display area (which starts out displaying the SIP logo), and a message area (which welcomes the user to SIP).

SIP's Basic Layout and Operation

[SIP's Intitial Window]

SIP provides its own window (see the figure above for what that window initially looks like in the Windows operating system). Each time you click on the SIP Applet button you create another, separate SIP window. The SIP window has

A title above the Image Display Area identifies the file (if any) that contains the Current Image's actual data values.

The Image Display Area shows one particular view of the Current Image's data values --- the view determined by the Image Display Parameters. Changing the Image Display Parameters (using any one of the menu items under the View menu) does not alter the Current Image's data values in any way, only how the image is viewed. The Image Display Parameters remain in effect until you change them; each image you open is displayed according to the same Image Display Parameters in effect at the time of the open.

Selecting one of the operations in the Process menu will alter the current image's data values; this is the only way that the current image's data can be changed. The resulting image becomes the new "current image"; as a consequence the image display is also changed and its title becomes "untitled" to inform the user that the new image's data are not saved on disk. Further processing can be done on the (new) current image; at any point the user can save the current image's data to disk, using one of the File menu selections.

At any time the user may click and hold down the mouse button in the image then drag the cursor to draw a box in the image. This box can be used in a number of operations (e.g., computing statistics in the box, or cropping the image down so all that remains is the contents of the box).

The user may also right-click and drag the mouse to draw a line on the image (holding down the Control key, then clicking and dragging the mouse will accomplish the same thing --- Mac users take note). Statistics for image values along the line may then be computed, or a plot of the image values along the line may be displayed.

Almost anytime the user does something, information about the process, or its results, is output in the Message Area on the right side of the SIP window.


Menus

1) File Menu

Open Image File from the Internet.../Open Image File from User's Machine

SIP's File menu is similar to the File menu on many programs. But, since SIP can open files on the user's machine, or from the Internet, there are two "Open" menu items.

If "Open Image File from the Internet" is selected SIP will present a dialog box in which the user can enter the full URL of the image file to load (e.g., http://www1.phys.vt.edu/~jhs/SIP/images/m51dss.fit). Depending on your browser you may have to deal with a Security Dialog Box.

If "Open Image File from User's Machine" is selected, SIP will present a standard File Dialog box for selecting a file from the local disk for loading into SIP. Depending on your browser you may have to deal with a Security Dialog Box.

SIP expects an image file to be in FITS format and to have an extension of .fit, .fits, .fts, .FIT, .FITS, or .FTS. If the file extension is not one of these possibilities SIP will complain by printing "Not a FITS image file!" in the message area, and no data will be loaded.

For those who know something about the FITS format: SIP expects the file to contain an image of at least 2 dimensions; if the image has more than 2 dimensions, SIP will load the image stored the "first plane." SIP will not load data from a FITS file containing a one-dimensional data array (i.e., not an image). Finally, SIP expects the image data to be stored in the primary header unit (not some extension). Typical FITS images files from CCD cameras will be OK. If any of these expectations are not met SIP will complain by printing "Not a FITS image file!" in the message area, and no data will be loaded.

Once the image data are loaded, the image is displayed. The title above the image display area is set to the name of the FITS file that was loaded. The image display is constructed using the parameters shown at the bottom of the SIP window. If the "Display Min" and "Display Max" are both set to zero, the Display Min will be set to the minimum data value in the image and the Display Max will be set to the maximum data value in the image. Image pixels where the data values are less than Display Min are set to pure black in the display; image pixels with data values greater than Display Max are set to pure white in the Grayscale display mode (pure red in the False Color display mode).

In a browser which cannot run signed applets these menu selections do not exist. Instead there is one selection entitled "Open Image from SIP's Server." Choosing this selection will cause SIP to present a simple dialog box in which the user can enter the name of a FITS file stored on SIP's server. The user needs to know the name; a list of files is not presented. Example images in this directory are listed on the SIP homepage.

Save As...

This operation saves the current image data in a FITS format file with a name chosen by the user. The .fit filename extension is conventional for a FITS file. The title above the image display area becomes the filename the user chose for the output FITS file, signifying that the data values for the current image are saved on disk. Depending on your browser you may have to deal with a Security Dialog Box.

In a browser which can't run signed applets this menu selection does not exist.

Save BMP...

This selection will save a BMP (bitmap) version of the image display to the user's disk. Depending on your browser you may have to deal with a Security Dialog Box.

The BMP file will be a copy of the image display, as determined by the display parameters (except for the zoom parameter). Thus, a user can load an image, change how it looks in the image display area until satisfied, then save a BMP copy of that display.

The saved BMP file can subsequently be printed out by whatever software the user has which prints BMP files (a common image format). BMP format files can also be converted to GIF or JPEG format using commonly available software. (Such software is probably the best tool for enlarging or shrinking the BMP image, if desired.)

In a browser which can't run signed applets this menu selection does not exist.

Show FITS Header for File on the Internet.../Show FITS Header for File on User's Machine...

Use these selections to view the FITS header of a FITS image file. The user will be asked for the filename just as if an image were being loaded for display. The header is displayed in a newly created window. Viewing the FITS header can be used to obtain information about an image (even before it is displayed). The information present in the header was determined by the program that saved the original FITS file. It contains some mandatory information such as the size of the image (in pixels), but may also contain the pixel size, the instrument used, the observer, etc. Values in a FITS header are in the standard units of the SI system: meters, seconds, degrees (e.g., for sky coordinates and pixel size), etc.

Depending on your browser you may have to deal with a Security Dialog Box when viewing a file's FITS header.

In a browser which can't run signed applets these menu selections are not present. Instead there is a selection entitled "Show FITS Header for File on SIP's Server...".

Copy Image to Storage Register

Selecting this menu item will make a copy of the current image that can be used in a subsequent Process operation (e.g., "Add or Subtract another Image..."). One could, or course, also use the local disk for this sort of thing (using "Save As..."). The current image's data values are copied.

Recall Image from Storage Register

Selecting this item will display the image stored in the Storage Register to the screen making it the current image for all subsequent operations.

Clear Image Storage Register

Selecting this item clears the memory of a stored image. This opens up more memory (which might be useful!).

Quit

Use this menu item (or the "close" button on the SIP window) to terminate SIP.

2) View Menu

The items under this menu are used to change the display of the current image by changing the image display parameters. Changing the display does not alter the image's data values, only the way they are displayed. Any changes in the display parameters are shown at the bottom of the SIP window. These parameters can be changed using the items under the View menu. Before discussing these menu items, it is necessary to make a few general remarks about image display.

When an image is first opened it is displayed using the display parameters already in effect at the beginning of the program, or for the previous image. All pixel values less than Display Min are set to pure black in the display. All pixel values greater than Display Max are set to pure white in the Grayscale display mode (pure red in the False Color mode). Pixels with values between Display Min and Display Max are displayed according to the Transform parameter.

The Transform parameter (Linear, Log, Power = 1/3, Power = 1/2, Power = 2, Power = 3) allows the user to select the function that transforms image data values into display pixel values. For example, in the Grayscale display mode if the user chooses "Power = 2", then pixels with data values below Display Min are set to 0 in the display (pure black), pixels with data values above Display Max are set to 255 (pure white) in the display, and pixels with data values between Display Min and Display Max are set to a gray value of 255 times the square of (I-Min)/(Max-Min), where I is the data value. (Linear is the same as Power = 1. The Log transform sets a display value to 255 times log(I-Min+1)/log(Max-Min+1), where I is the data value.) The Transform has no effect on the actual image data value, only how it is displayed.

The Color parameter can be set to Grayscale (display pixel values range from pure black to pure white), Negative (display pixel values range from pure white to pure black), or False Color (display pixel values range from pure black through blue, green, yellow, orange, and pure red --- essentially the colors of the spectrum with a gradation of in-between hues).

The Zoom parameter is selected from 1x (normal size), 2x, or 4x. If the resulting image is larger than the image display area, scroll bars appear to enable the user to scroll about in the image. If you zoom an image to "4x" its original size (that's 4x in both dimensions!), your machine may run out of memory, depending upon the original size of the image. Each pixel is represented in memory by a 4-byte number (in image display, or for use in precise calculations). Therefore, an image with dimensions of 64 by 64 (= 4096 pixels) is a little over 16 KB in size (in memory). Zooming this image to 4x its size would require more than 262 KB of memory. A 512 x 512 image (= 262,144 pixels) is just over 1 MB in size in memory; zoomed by 4x, this image would occupy more than 16 MB of memory. If you find that a zoomed image does not appear in the Image Display Area (the Display Area becomes totally blue), going back to a display zoom of "1x" should get you back to where you started without any problems. If you really need to greatly zoom an image (4x) to get a close look at some small part of it, try cropping the image first to yield only the part you are interesting in zooming in on.

The Orientation parameter is either "CG" (default) or "FITS." In the CG mode the first pixel contained in the FITS file is displayed in the upper left corner of the image display, subsequent pixels fill that row from left to right, and subsequent rows are filled in below; the top left pixel has coordinates (0,0) or x=0, y=0, and x increases to the right in the image while y increases in the downward direction. In the FITS mode the first pixel contained in the FITS file is displayed in the lower left corner of the image display, subsequent pixels fill that row from left to right, and subsequent rows are filled in above; the bottom left pixel has coordinates (1,1) or x=1, y=1, and x increase to the right in the image, while y increases in the upward direction. Many amateur CCD image acquisition programs produce FITS image files which are expected to be viewed in "CG" mode. Professional image acqusition programs typically produce FITS image files which are expected to be view in the convential FITS orientiaton mode (this "convention" will probably become a FITS "standard" in the future). Using the View menu the user may select either "CG image orientation" or "FITS image orientation". The default selection (set at the time the program is started up) is CG orientation. Once a new orientation selection is made, that mode remains in effect for all subsequent work, until a different selection is made.

Note that astronomical images typically have a large range of pixel values (very faint stuff is present along with very bright stuff). It is said that the images have a large "dynamic range." The SIP Grayscale image display mode shows 256 shades of gray from pure black to pure white --- more than enough to cover the range of shades that your eye can discern in the the display, but typically not enough to capture the full dynamic range in the image. The False Color display mode can show a larger range of hues (and your eye can discern the differences in the colors better than the differences in the Grayscale shades). Either way one choice of Display Min and Display Max may show you the bright objects/features in your image, another choice may be necessary to show the faint objects/features, and yet another may be a compromise. You may have to experiment with Display Min and Display Max to get the full idea of what is present in your image. A CCD image contains much more information than a single photograph which freezes a certain choice of Display Min and Display Max. Play around to see it all! You should also realize different choices of Transform will also produce different views of the image data, some better than others, with the results depending upon the nature of your target, and your image's dynamic range.

Automatic Contrast Adjustment

When an image is opened it is unlikely that the previous settings for Display Min and Display Max will result in a good display of the image data. One way of possibly improving the dislayed image is to use the "Automatic Contrast Adjustment" menu item. It sets Display Min equal to the pixel value nearest the 10% cut in a histogram of the image pixel values (10% of the pixels will have a smaller value than Display Min) and Display Max equal to the 98% cut in the histogram. These cuts usually produce a reasonable display of a deep-sky image (e.g., an image of a galaxy) when used in conjuction with the Linear tranform mode. They may or may not work as well for a planetary image.

Change Image Display Parameters

Selecting this menu item produces a dialog box in which changes can be made to all or any of the image display parameters. Once the user has specified the new values for the parameters, clicking on the Apply button will put those changes into effect.

Default Computer Graphics (CG) Image Orientation

This is the default image display orientation. It is in effect when the program is started. In CG orientation mode, the image pixel (0,0) is displayed in the lower left corner, the x coordinate increases to the right in the image, and the y coordinate increases in the downward direction. Selecting this orientation will immediately redisplay the image. All subsequent images will be displayed in this orientation.

Conventional FITS Image Orientation

This is the conventional image display orientation for FITS images made by professional astronomers. In FITS orientation mode, the image pixel (1,1) is displayed in the lower left corner, the x coordinate increases to the right in the image, and the y coordinate increases in the upward direction. Selecting this orientation will immediately redisplay the image. All subsequent images will be displayed in this orientation.

3) Process Menu

All operations under this menu change the current image's data values. As a result the title above the image display area becomes "untitled" to warn the user that the data are not saved on disk.

Smooth...

When the "Smooth..." menu item is selected a dialog box appears asking the user for the width of the square smoothing box that will be used in the smoothing operation. Each pixel data value in the new image (the smoothed image) is computed by centering this square box over the pixel's location, taking the mean (average) of all the pixel data values in the current image that lie within the boundaries of the smoothing box, and then recording that mean value as the data value of the pixel in the new image. Fractional contributions of pixels partially falling into the smoothing box are counted when computing the mean; such pixels contribute to the mean with less weight than the pixels that fully lie within the box (the weight is equal to the fraction of the pixel included in the box). The title above the image display area is changed to "untitled" to indicate that the resulting image data has not yet been saved.

Add or Subtract another Image...

The "Add or Subtract another Image..." menu selection does just what it says. The user is prompted, through a dialog box, for the name of the file containing the other image to add or subtract from the current image. This file name must, of course, be the name of a FITS format file. Furthermore, this second image must have the same dimensions as the current image! (Otherwise, the user is informed of the problem, and nothing is done.) Alternatively, the user may specify that the image to add to or subtract from the current image is the image in the storage register. Each pixel in the final result is the sum (or difference) of the corresponding pixels in the two images. The resulting image is displayed in the image display area. As usual, the title above the display area is changed to "untitled" to indicate the resulting image has not yet been saved.

Actually, the operation performed by this menu item produces a linear combination of the two images (the current image and the second image). When a user clicks on the "Add or Subtract another Image..." selection a dialog box pops up indicating that the image resulting from the computation will have pixel data values of a*I1 + b*I2 + c, where I1 is a pixel value in image 1 (the current image data), I2 is the corresponding pixel (location) data value in image 2 (the image referred to as "another image" or the "second image"), and where a, b, and c are user specified constants. (In the mathematical expression "*" means "times".) The dialog box asks for a, b, and c (real numbers). Once the user specifies a, b, and c, clicking on one of the buttons at the bottom of the dialog box will enable the user to select the second image file; the result is then computed. The resulting image is displayed in the SIP display image display area and the title above the display area is changed to "untitled" to show that the data have changed and are not yet saved.

Notice that one can add a constant to the current image data and/or multiply the current image data by a constant using this process, without loading in a second image. Just set b to zero; clicking on one of the "Select second image...Compute result" buttons will compute the result without asking for the name of a second image.

Multiply or Divide by another Image...

The user interface for the "Multiply or Divide by another Image..." menu selection looks like that for the "Add or Subtract another Image..." selection. However, the computation is different.

The operation performed by this menu item produces a multiplicative combination of the two images (the current image and the second image). When a user clicks on the "Multiply or Divide by another Image..." selection a dialog box pops up indicating that the image resulting from the computation will have pixel data values of (a*I1) * (b*I2)^c, where I1 is a pixel value in image 1 (the current image data), I2 is the corresponding pixel (location) data value in image 2 (the image referred to as "another image" or the "second image"), and where a, b, and c are user specified constants. (In the mathematical expression "*" means "times" and "^c" means "raised to the power c".) The dialog box asks for a, b, and c (real numbers). Once the user specifies a, b, and c, clicking on one of the buttons at the bottom of the dialog box will enable the user to select the second image file; the result is then computed. The resulting image is displayed in the SIP display image display area and the title above the display area is changed to "untitled" to show that the data have changed and are not yet saved.

Notice that one can divide the current image data by the second image's data by setting c = -1. Furthermore, one can multiply the current image data by a constant using this process, without loading in a second image. Just set c to zero; clicking on one of the "Select second image...Compute result" buttons will compute the result without asking for the name of a second image.

Flip Horizontally, or Flip Vertically, or Rotate 90 degrees Left

The "Flip Horizontally", "Flip Vertically", and "Rotate 90 degrees Left" selections make obvious changes to the displayed image and the image data. The title above the display area is changed to "untitled" to show that the new image data are not saved. The left rotation means counterclockwise.

Shift Image...

This menu selection can be used to shift the image by an integral number of pixels in both the x and y directions. A dialog box enables the user to enter the shifts that are desired. A positive shift moves the image in the positive direction along the axis in question (note that x increases in the rightward direction, while y increases in the downward direction in the image display). The image size remains the same. So, if pixels move off the edge of the image, those pixels are lost. If pixels are vacated by the shift, those pixel data values are set to 1.0.

Crop Image to Size of Box

If a user drawn box is visible in the image display selecting "Crop Image to Size of Box" will cut off the parts of the image outside the box and refresh the display showing only the part of the image inside the box, now placed at the upper left corner of the image display area. The current image's data are altered by this process (all that's left in memory is the smaller section of the image that is displayed). But the data is not saved on disk (so the title above the image display area is set to "untitled").

4) Analyze Menu

At any time a user image is displayed, the user can place the mouse cursor within the image to obtain the pixel data value and pixel coordinates at the position of the cursor. In "CG image display orientation mode," the x pixel coordinate runs horizontally left to right across the image; the y pixel coordinate runs vertically downward; in the "conventional FITS image display orientation mode," the x pixel coordinate runs horizontally left to right across the image; the y pixel coordinate runs vertically upward.

Pixel coordinates in SIP are whole numbers at the center of a pixel. It is possible to click on locations that are best represented by fractional pixel coordinate values when in Zoom modes greater than 1x. In such instances fractional values of x and/or y will be obtained. In SIP, clicking at exactly the center of a pixel would yield a integer value for x and y. Thus the left edge of a pixel would have a half-integral pixel coordinate value for x. This convention is followed in all the box selections, and statistical calculations for boxes. Only integer pixel values are possible for the line limits used in computing statistics along a line, or plotting image values along a line.

Statistical values can be obtained for the set of pixel data values in a user defined box in the current image through selections under the Analyze menu. The selections allow the user to set the coordinates of the box's corners, or the user can draw the box using the mouse. Once a box is specified, the user can request statistics within the box (number of pixels in the box, minimum pixel data value, maximum data value, sum of the pixel values, mean of the pixel values, median of the pixel values, and root-mean-square deviation of the set of pixel values, etc.). A histogram for the pixel values in the box can also be dislayed. Any NaN pixel values (NaN = "Not a Number," the FITS value meaning "blank") are ignored in computing statistics or plotting the histogram.

Statistics can also be computed for the image values along a user defined line in the current image. Selections under the Analyze menu allow the user to set the end coordinates of the line, or the user can draw the line using the mouse. Once a line is specified, statistics can be computed or a plot of the image values along the line can be displayed. The values plotted or used in the statistical calculations are image values at separations of 1 pixel-width along the line. If a line is horizontal or vertical the actual pixel values along the line are used. If the line is neither horizontal nor vertical, the first image value on the line is the pixel value at the start of the line and subsequent values at pixel-width intervals (which don't necessarily fall at the center of a pixel) are computed as a weighted average of the four nearest pixel values (this is equivalent to a bi-linear interpolation). Any NaN pixel values ("Not a Number", i.e., blank values) are ignored in the weighted average computation. Values on the line determined to be NaN (the case when all four nearest pixels have are NaN) are ignored in the statistical computations, and not plotted in the line plot.

Set Box Limits...

The user can select "Set Box Limits..." to pop up a dialog box where the box limits can be specified (as real numbers, not necessarily integers). The SIP message area shows the resulting box limits (minimum x value, maximum x value, minimum y value, maximum y value). The dialog box always shows the previous settings established by a "Set Box Limits..." command, or by drawing a box using the mouse).

The region of the image over which statistics will be calculated is within the box. Thus, if the box limit values are half-integral, the box edges land on pixel edges and full pixels near the box edges will contribute to the statistics in the box. If the box limits are not half-integral, then fractional pixels will contribute to the statistics: if xmin = 28.7, all of the image to the right of that location (and consistent with the other box limits) will contribute to the statistics in the box.

Setting the box limits to 0, 0, 0, 0 is the same as specifying the entire image.

The user defined box is drawn on the image in orange outline.

Compute Statistics in Box

Once a box has been specified or drawn, selecting "Compute Statistics in Box" does statisitcal calculations using the image's data values for the pixels in the box. The results are displayed in the message area on the right side of the SIP window.

Display Histogram for Box

Once a box has been specified or drawn, selecting "Display Histogram for Box" will produce a new window contaning a histrogram of the pixel data values in the box.

Remove Box

Selecting this menu item will remove the box from the image display.

Set Line Limits...

The user can select "Set Line Limits..." to pop up a dialog box where the line's end limits can be specified (as integer pixel coordinates for x and y). The SIP message area shows the resulting line limit coordinates. The dialog box always shows the previous settings established by a "Set Line Limits..." command, or by drawing a line using the mouse).

Setting the line limits to 0, 0, 0, 0 results in no line being drawn (in contrast with the workings of the "Set Box Limit..." menu item).

The user defined line is drawn on the image in green.

Compute Statistics along Line

Once a line has been specified or drawn, selecting "Compute Statistics along Line" statisitcal calculations using the image values at intervals of one pixel-width along the line (as described above under Analyze Menu). The results are displayed in the message area on the right side of the SIP window.

Plot Image Values along Line

Once a line has been specified or drawn, selecting "Plot Image Values along Line" will produce a new window contaning a plot of the image values determined at intervals of one pixel-width along the line (as described above under Analyze Menu).

Remove Line

Selecting this menu item will remove the line from the image display.

Determine Centroid or Magnitude of an Object

This selection pops up a dialog box which enables the user to determine the centroid ("center of light" or "center of mass") of the intensity within a box and the instrumental magnitude of the light within that box.

In addition to the appearance of the dialog box, two square boxes appear on the displayed image. The green box is meant be placed over the object of interest (e.g., a star). The red box shows the pixels that are used to calculate "background" values for use in the centroid and magnitude calculations for the object. The user can use the scrollbar controls in the dialog box to move the object and background boxes to various locations in the image. The use can also alter the width of each box. Typically, one would want to place the background box near the object box. Typically, one would want a large enough object box to encompass all the light from the object, but not any more sky than is necessary. As the user moves the boxes about, or changes their sizes, the results of calculations involving the pixels in both boxes are updated at the bottom of the dialog box. Those results are: the background mean pixel data value, background rms value, object centroid x coordinate, object centroid y coordinate, object instrumental magnitude, and object flux.

The background mean pixel value is simply the average of the pixel values within the background box.

The background rms is the "root-mean square deviation" or "standard deviation" from the background mean of the pixel values in the background box.

The centroid of the object is computed by determining the "center of mass" of "center of weight" of the pixels in the object box, using only the pixels that are greater than or equal to background mean plus 5 times the background rms. In effect, this will tell the user the pixel coordinates (down to a fraction of a pixel) of a star, for example. By excluding all pixels less than 5 times the background rms above the mean, SIP ensures that only truly meaningful pixels (i.e., not noise) are used. Nevertheless, for an accurate centroid the user should not make the object box too large, otherwise light from other stars or objects will unduly influence the results.

The object's instrumental magnitude is calculated by summing the pixel data values within the object box, after first subtracting the background mean value from each pixel. This result is the called the "object flux" and is displayed in the dialog box. The instrumental magnitude is then calculated as -2.5*log(object flux), where the log is to the base 10. Such a magnitude cannot be directly compared with a published magnitude for the object, until more work is done, yet it already has some of the correct properties of the astronomical magnitude scale (e.g., a increase in the flux of the object by a factor of 100 will result in a change in the magnitude of -5). Therefore, SIP refers to this magnitude as an "instrumental magnitude." The differences in instrumental magnitude between variable star and a non-variable star, measured over a period of time, can be precise measurements of the changes in magnitude undergone by the variable star. Consult a reference on photometry for more information on how these instrumental magnitudes can be used.

In calculating the background values (mean and rms), the user can select between using the (red) background box or a (red) square annulus centered on the object box. In the latter case the background values are calculated using the pixels that fall into the annulus (within the region between the inner and outer red square boundaries). The width and thickness of the annulus can be changed using scrollbars. Use of an annulus may be preferred over a separate background box since the annulus better samples the background around the object in a symmetric way; this could yield more accurate results for centroid and magnitude calculations of a small object (e.g., a star) especially if the object is embedded in a spatially varying background.


Standard CCD Image Processing Procedures

Astronomical CCD images typically must undergo various standard processing procedures before being suitable for analysis. Any pixel value in a raw image taken at the telescope represents the number of electrons collected in that pixel of the CCD chip due to incident photons (from the sky), and thermal agitation (the so-called "dark current"). Furthermore, the pixel value is biased upward from zero by some additive amount, and dependent upon the sensitivity of that particular pixel to incident sky light (due to variations in structure across the chip, and to variations in the optical system's delivery of photons to various locations on the chip). The standard procedures used to correct raw images for the contributions due to dark current and bias, and sensitivity variations are best described at length elsewhere (also see How to process images with SIP). Here simple steps to implement such procedures using SIP are listed.

Dark current correction. Clearly, simply subtracting a "dark image" from a raw sky image can be done using SIP.

Bias correction. Again, subtracting a "bias image" from a raw image will do the trick. Of course, one may not want to do both a dark and a bias correction to the same raw image. Consult your favorite reference.

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 an object is corrected for any dark current, a flat field correction can be done. The flat field image may need a dark correction or bias correction if it was a long exposure (but typically it might not need such corrections). A standard flat field correction procedure might be to (1) obtain the average pixel value within the flat field image (call it a) using SIP's "Compute Statistics in Box" menu item, then (2) divide the flat field image (multiplied by 1/a) into the object image using SIP's "Multiply or Divide by another Image..." menu item. One might need to save an intermediate result during this procedure (e.g., the flat field image could first be corrected by subtracting a bias image then stored in the storage register before opening the object image, correcting it for any dark current contribution, then dividing by the bias-corrected flat field image stored in the storage register).

Averaging (co-adding) images. To produce an image which is the 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 three images.

Unsharp Masking. In the SIP homepage I mention 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. Now smooth the image with a 5 by 5 smoothing box. 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.


Back to SIP homepage