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 (e.g., Netscape Communicator 4.5, Microsoft Internet Explorer 4.5, on a Windows 95/98 machine), 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 (e.g., Microsoft Internet Explorer Macintosh Edition).
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 "Virginia Polytechnic Institute and State University" (Virginia Tech), 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?
Netscape Communicator 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, 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 "Virginia Polytechnic Institute and State University." 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://www.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.
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.
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 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
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).
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.
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://www.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.
In a browser which can't run signed applets this menu selection does not exist.
The BMP file will be a copy of the image display, as determined by the display parameters. 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.
In a browser which can't run signed applets this menu selection does not exist.
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...".
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. The Display Min and Display Max values determine the contrast of the 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).
The Transform parameter (Linear, Log, Power = 1/3, Power = 1/2, Power = 2, Power = 3) allow 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 (black), pixels with data values above Display Max are set to 255 in the display, and pixels with data values between Display Min and Display Max are set to a value of 255 times the square of (I - Min)/(Max-Min), 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 Image Size is a reminder of the actual image's size in pixels, regardless of the zoom.
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.
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.
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.
Displaying images with the pixel coordinate origin at the upper left corner is consistent with many amateur and even some professional CCD imaging programs (i.e., the programs most likely to generate the FITS files you might use in SIP). These programs will typically assign the coordinates (0,0) to the upper left pixel in the displayed image. If you have obtained an image saved as a FITS file by such a program, it will be displayed in SIP with the same orientiation as in the original program. However, some professional image processing programs (IRAF, AIPS,...) put the pixel coordinate origin at the lower left corner in their displays; furthermore, they assign the coordinates (1,1) to the pixel in the lower left corner. FITS image files generated by these programs will be readable in SIP, of course, but the displayed image in SIP will appear to be flipped vertically when compared to the image as displayed in the original program, and pixel coordinates read from SIP will differ by 1 from pixel coordinates read in the program of origin (a SIP pixel at (5,10) would have coordinates (6,11) in the original program). Of course, if the orientation of an image in SIP is not to your liking, you can always flip it vertically (or flip it horizontally, or rotate it, if you like).
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.
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.
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.
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.