Learning ds9: Overview | Part 1 | Part 2 | Part 3 | [Contact Help] [Chandra Public Page]
o


Part 1 Section Contents

Part 1: First Look Qualitative Analysis using ds9

Learning to Use the ds9 Imaging System

Part 1: First Look Qualitative Analysis using ds9

A quick list of the basic techniques of x-ray analysis:
  • look at an x-ray image using ds9 to get a qualitative feel for the data
  • use ds9 to select one or more regions of interest
  • perform quantitative analysis - spatial, spectral, or timing analysis - on the regions you have selected

In this first section you will use ds9 to make and color an image, and to look at some features.

One of the great things about Chandra is that both of its x-ray detectors can record really good position information. Because of this, the first thing we typically want to do when studying an object using Chandra data is to look at an image of the object. We call this a "qualitative" look because we are asking you to notice characteristics of the data that you can see by eye, without doing any complex numerical (quantitative) analysis.

Don't underestimate the value of taking a qualitative look at new data: the human eye is a wonderful instrument that can pick up subtle features of data, providing invaluable insights into where to look further with more quantitative methods.


Loading the Cas-A image

To load the Chandra image of the supernova remnant Cas-A, start up the ds9 imaging system.

You will see a window similar to the one to the left.

Click on Analysis on the menu bar. You'll notice a dashed line at the top of the drop down menu. Click on this line to keep the DS9 Analysis window opened on your desktop.

The DS9 Analysis window includes several quantitative analysis tools you will use at various times during the tutorial.

Choose the Virtual Observatory to access images from various sources.


For this tutorial, you will need to open the Cas-A supernova remnant image which is located on the Rutgers X-ray Analysis Server.

Place a checkmark in the box to the left of the Rutgers server.


Load the Cas-A image from the list of images shown.

A window indicating that you have loaded the image of interest will appear.

Minimize this window so that you can load other images from the list at a later time.

When you have successfully loaded the image of Cas-A the image will appear as it does here with the following default settings:

  • grey color
  • contrast = 1
  • bias = 0.5
  • linear scale


This is the same Cas-A data set that you can load through the Activities and Images section. If the image does not load, check to make sure that you have:

  1. installed ds9
  2. started ds9 and
  3. connected to the Chandra analysis tools through the virtual observatory on the ds9 pulldown analysis menu.

If you think you missed a step, go back to the links on the top installation page and check to be sure that you have completed parts a, b and c of Step 1. If you are still having a problem, contact SAO R&D.

You will want to follow the directions in this section while working primarily in the ds9 window. We suggest that you print this section and use the printout as your reference for working in the ds9 window.


Looking at an X-ray image

More on Contrast & Bias

Contrast refers to the rate of change of color with color level. At low contrast, color changes gradually over many color levels, while at high contrast it can change rapidly within a few levels. Contrast adjustment works whether the image is in black and white, or in color.

Bias refers to any offset added to the color levels before the color map is applied. Changing the bias corresponds to translating the color map with respect to the color levels without changing the shape of the map. At low bias, low color levels (i.e., low pixel values) will have non-zero intensities, while at high bias only high pixel values will have non-zero intensities.
Contrast and Bias

When the image of Cas-A is first displayed, the image is displayed in shades of black and white, and its features are a bit hard to see. But try this:

  • move the mouse into the window containing the image
  • press the right mouse button and hold it down
  • move the mouse around in image with the right mouse button pressed

Notice how the picture changes so that features of the image come in and out of prominence. Changing the contrast & bias like this is one way that astronomers get a better view of their data. You should experiment with this feature until you like the picture that you see. Note that you can change contrast and bias whether the image is in gray scale or in color.

- Changing Contrast: Contrast is adjusted by dragging the right mouse button vertically in the display window.

- Changing Bias: Bias is adjusted by dragging the right mouse button horizontally in the display window

- Finessing both Contrast and Bias: Choosing Color from the menu bar will allow you to access both contrast and bias numerically. The default measurement for each is 1.0 and 0.5 respectively. You can increase these measurements incrementally and apply the changes to the image until the view of the data meets your needs.

Cas-A remnant image in he color with:

Contrast  Bias
1.0
6.7
9.0
0.5
0.06
0.12


More on Color Maps

Colors are specified by the intensities, i.e. voltages, applied to the red, blue, and green color guns in the monitor of your computer screen. The assignment of actual colors to color levels is accomplished through the use of pseudo-color Color Maps. In such maps, any color can be assigned to any color level, and all image pixels whose values are binned into a particular color level will have the color that is assigned to that level. Color maps are designed to highlight differences among the pixel values. Depending on the levels which best distinguish the detail one wishes to study, the shifts from blue to red and red to yellow can be placed at higher or lower image pixel values and closer together or farther apart. The changes in color can be made gradual or sharp.

ds9 implements color maps by specifying colors at a few color levels, and linearly interpolating to assign colors at intermediate levels. For example, the basic grey-scale color map specifies no intensity for any color at the lowest color level (black), full intensity for all colors at the highest color level (white), with the red, green and blue intensities varying linearly for intermediate levels. ds9 offers a number of popular pseudo-color maps as well as a basic grey-scale map.

Color

There are other ways to adjust the image. Try this:
  • move the mouse to the top of the ds9 window, over the word "color"
  • press the left button to display the color menu options
  • while pressing the left button, move the mouse down until you reach an option that you want to apply to the image
  • let go of the left mouse button to select that color option
Now once again move your mouse into the image, press the right mouse button, and move the mouse around. See how the colors change, once again bringing out different features. You are using the contrast & bias adjustment with color. Try some other color menu choices until you find a color scheme that you like.

In ds9, the selected color map is displayed graphically in a "one-dimensional" image below the main display window. The x-axis corresponds to color level and the display intensity corresponds to the color assigned to that level.

 

 

 

 

 


grey  inverted grey  red
 bb  he  i8

Counting Photons

Recall that an incoming x-ray photon is focused by the x-ray telescope and then hits the x-ray detector that is currently in the focal plane of the telescope. This can be the HRC or ACIS (with some gratings options thrown in for good measure). The x-ray detector then records information about that x-ray photon for eventual transmission back to earth. If the detector is the HRC, an accurate position and arrival time are recorded. If it is the ACIS, an accurate position and energy are recorded, along with some timing information. To record an accurate position, both detectors act like a super-fine mesh or grid, recording the grid element (or "pixel") that the x-ray strikes. As more and more x-rays strike the detector grid, each pixel in the grid can be hit by zero, one, or more x-rays. When we display this initial image of Cas-A, what we are displaying is the number of x-rays that were recorded to hit each pixel. Try this:

  • In the ds9 window there is a text table at the upper left. One entry is "file" and to the right of this is a box with the file name, in this case, "casa" (Cas-A). Directly below that is another entry called "value" which has a single box to its right. Still below are two entries called "physical" and "image". They each have two boxes to the right, labelled "x" and "y". Watch those boxes while you move your mouse around the Cas A image.
  • You will see both rows of "x" and "y" values change as you move your mouse. The differences between the two titles do not matter for this exercise, and all subsequent x,y values will refer to the numbers appearing in the "physical" row. That pair of numbers together are the x,y coordinates that identify each individual pixel of the detector. As you move the mouse, the "physical" table is telling you which pixel of the detector you are located in.

  • The "value" shows the number of x-ray photons that were recorded at that pixel position.
  • Note that you can use the arrow keys on your computer to move the mouse one pixel at a time in any direction, so that you can see the values change slowly over small regions of the image. There is a smaller window in the upper right side that shows a magnified view of a portion of the image around your pointer location. You can use this window to "zone in" on a specific area of the image.
  • Pick a particular pixel by its x,y coordinates (image value), for instance, the pixel for which the physical x,y value is 4158,4398. Move your cursor around until you figure out which way the grid coordinates are oriented. Hint: This pixel is located in a nice bright spot in the upper left part of Cas-A. Note that the "value" at that pixel is 92. Ninety-two is the numbers of x-ray photons that were recorded to strike that pixel.

More on Scaling


Binning Pixel Values by Scaling

In order to display a large range of pixel values with a limited number of color levels (typically 256), image data must be binned according to some scaling function. A number of different functions are supported, including:

Linear Scaling: The range of pixel values is divided by the number of color levels to determine the range of pixel values for each color level. The fixed range is applied to mapping all pixel values between the minimum and maximum pixel value.

Log Scaling: The distribution of pixel values to color levels is based on the distribution of exp(n) from 0 to X, where n is a parameter (the ds9 default is 10.0) and X is determined by n and the two ranges (pixel and color level). Positive values of n favor the lower pixel values, while negative values of n favor the higher pixel values.

Square Root Scaling: The distribution of pixel values to color levels is based on the distribution of X^{1/n} from 0 to 1, where n is a parameter (the ds9 default is 2.0) and X varies from 0 to 1 in steps determined by the number of color levels. Values of n greater than 1 favor the lower pixel values, while values of n less than 1 favor the higher pixel values (negative values and 0 are not allowed).

Image Manipulation & Pixel "Value"

Doesn't changing the colors and/or contrast change the data? Not at all. Try this:

  • Change the color map with the color menu, or change the contrast by moving over the image with the right mouse button pressed. Go back to the x,y location of 4158,4398 in the "physical" line. What "value" is displayed? Again it is 92. Why is this?
  • ds9 is not changing the value of each pixel when you change colors. Rather, it is simply changing the color assigned to that given number of photons. When the grey colors are used, then ds9 assigns grey colors to pixel values ranging from 0 (black) to 255 (white)
  • When the contrast is changed, the assignment of colors is changed, not the data values. You can see the rough assignment of color to pixel value in the color bar under the image.
  • Watch what happens to the color bar while you change the contrast (right mouse button) or the whole color scheme (color menu).
  • The color bar can be roughly divided into 256 pieces, each of which is assigned a color corresponding to 256 possible pixel values. What happens if a pixel has more than 256 x-rays and therefore a value of more than 256? (see More on Scaling in the side bar)

Closing an Image

  • When you are finished using the Cas A image, clear the frame by using the "Clear Frame" command. You will find this in the main "Frame" pull down menu at the top of the ds9 window. You can also click on Frame in the lower "short cuts" menu bar and the Frame options will appear on the bottom line.


First Look, Summary

Astronomers use different colors and contrasts to make the features of an image easier to recognize by eye. This sort of "first look" qualitative analysis of data is very important, because it gives direction to further investigation. ds9 supports a number of other qualitative techniques that you can learn to further investigate an image.

Part 2: More Features for Qualitative Analysis [
next] [back]



Last updated: 7/20/04

bar


Chandra Ed. Home Page | Installation | Learning ds9 | Activities & Images | Evaluation
Learning ds9: Overview | part 1 | part 2 | part 3
Resources: ds9 | Chanda Public Information & Education


Harvard-Smithsonian Center for Astrophysics
60 Garden Street, Cambridge, MA 02138 USA
Phone: 617.496.7941  Fax: 617.495.7356
Comments & Questions?
cxcedu@cfa.harvard.edu

This site was developed with funding from NASA under Contract NAS8-39073.