Introduction to Chandra X-ray Data Analysis with DS9

When we think of an astronomer doing research, we often picture someone peering through a telescope in a domed observatory building. x-ray astronomy is different, because the telescopes are not located in a building or even anywhere on earth. Rather, x-ray telescopes orbit the earth in highly sophisticated spacecraft that are carefully controlled by astronomers on the ground. After a star or galaxy or other object is observed by an x-ray telescope, the information gathered about that object is relayed back to earth, where astronomers use computers to do their analysis.

X-ray data is rich and complex, containing quite different information than the image or picture that we can "see" when looking at objects in visible light through a telescope on earth. An x-ray telescope collects x-ray emission (called "x-ray photons") from a star, galaxy, or other source. It uses an x-ray detector to record different kinds of information (position, energy, time of arrival) about each individual x-ray photon. No single x-ray detector can accurately record all three types of information, so Chandra has two different x-ray detectors, the High Resolution Camera (HRC) and the Advanced CCD Imaging Spectrometer (ACIS), that specialize in recording one or another type. The HRC can record very accurate positions as well as the photon arrival time (i.e., the exact time that the x-ray photon hit the detector). The ACIS records accurate position and very good energy information (i.e., the energy of each photon is determined within a narrow range). It has crude timing information as well, usually pinpointing the photon's arrival time to a precision of about 3 seconds.When proposing an observation, astronomers specify one x-ray detector or the other based on what sort of data analysis they think is appropriate for that object. When Chandra carries out the observation, the proper detector is placed at the focal point of the mirrors to record the incoming x ray photons. For example, timing information is most important for studying the blinking properties of a pulsar in a supernova remnant (SNR), but spectral information is most important for studying the composition of the expanding material in the outer shell of the SNR. Thus, to get the most complete x-ray information about the SNR Cas-A, an astronomer would want to see data from observations using both Chandra detectors, the HRC and the ACIS.

A quick summary of the basic techniques of x-ray analysis:

The paragraphs below tell you more about each of these techniques.

A first qualitative look at x-ray data

In our investigations of x-ray data, we will be looking at data that was recorded with more accurate energy information (using ACIS) and at data that has more accurate timing information (using HRC). One of the great things about Chandra, though, is that both of these x-ray detectors can record really good position information. Because of this, the first thing we always do when studying a new object using Chandra data is to look at a picture 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 numerical (or 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.

To look at x-ray data, we use a special image display program called ds9. If you do not have ds9 installed on your computer, click here to learn how to install it.

We can start by looking at the beautiful Chandra observation of the SNR named Cas-A. To view Cas-A in x-rays, first be sure that you have installed ds9 on your computer. Start up ds9 by double-clicking on the ds9 icon, which usually is installed in the DS9 sub-folder of the Program Files folder on your computer. After the ds9 program is started, we must make connection with the Chandra Education data and analysis server. To do this:

Once a connection has been made to the Chandra Education data and analysis server, we can load the Cas-A image by clicking  .

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

Notice how the picture changes, so that features of the image come in and out of prominence. Changing the contrast like this is one way that astronomers get a better view of their data. You should play with the contrast until you like the picture that you see. (Find out more about contrast adjustmenthere.)

There are other ways to get a better view of the image. Try this:

Now once again move your mouse into the image, press the right mouse button, and move around. See how the colors change, once again bringing out different features. Try some other color menu choices. Play around until you find a color scheme that you really like! (Find out more about using these different color mapshere.)

Why can we do this? Doesn't changing the colors and/or contrast change the data? Not at all! To see why this is so, we have to better understand  what we are doing when looking at x-ray data such as Cas-A with ds9.

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 hits. 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.

To see this more clearly, simply move the mouse over the Cas-A image while watching the numbers change in the upper left text display. The "x" and "y" values are displayed with two sets of numbers ("physical" or "image"; the differences between the two sets involve the way the image is displayed and do not affect us here.  All subsequent pairs of x,y values will refer to the set of numbers appearing in the physical x,y row). These nmbers identify each individual pixel of the detector. The "value" number shows the number of x-ray photons that were detected 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.

Now, 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. 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.the number 92 is the numbers of x-ray photons that were recorded to strike that pixel. Now change the colormap with the color menu, or change the contrast by moving over the image with the right mouse button pressed. Go back to image x,y of 4158,4398. What value is displayed? again it is 92. Why is this?

The reason is that 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 x-rays. 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? Click here to find out more about scaling data.)

In sum, astronomers use different colors and contrasts to make the features of an image easier to recognize by eye. This sort of initial "qualitative" analysis of data is very important, because it gives direction to further "quantitative" investigation. Ds9 supports a number of other qualitative techniques that you can and should learn to play with as a means of approaching new data. Try some of these:

Horizontal and vertical cuts
Pull down the analysis menu and click on horizontal cut graph. A new window will be displayed at the bottom of the image display. Now move the mouse up and down in the image window. Notice how the graph changes. This graph displays the values in the horizontal line of pixels going through the y position indicated by of the mouse. Look for peaks in the graph to get a qualitative feel for how the data varies over the x-axis of the image. Similarly, the vertical cut graph shows the data values in a vertical line of pixels as they vary over the y-axis of the image. When both of them are activated simultaneously, the shapes of features become easier to see.

Pixel value table
Pull down the analysis menu and click on pixel table. A new window will be activated that displays pixel values in a 6x6 pixel area around the mouse position. Now move the mouse around the image window. Notice how the pixel table display changes. This pixel table gives a small scale view of the data. It is especially useful when used in conjunction with the magnification window in the upper right corner (which shows a blown up version of the data under the current mouse position).

Display contours
Iso-intensity contours are connected lines drawn on the image through pixels of equal value. (The root "iso" comes from the Greek meaning "equal". We are talking here about marking out lines of equal pixel intensity on an image, just as a topographical map marks out lines of equal elevation.) They are useful for indicating large-scale features of an image. The analysis menu has an option to overlay iso-intensity contours on the image. You can choose the number of contours to generate, as well as the smoothness of the contour lines. Select the display contours and contour parameters menu options in the analysis menu and try some values. (remember that you must push both the generate and apply buttons in order for new contour parameters to be drawn on the image.)

Display coordinate grid
Pull down the analysis menu and click on display coordinate grid menu option. A grid of astronomical sky coordinates will be displayed over the image. This is useful for reminding yourself where in the sky your object is located. This feature is especially useful when looking at areas of the sky with multiple sources, like the deep surveys, or areas where it is important to be able to pick out a particular source in an area where sources are close together.

There are, of course, many other features in ds9 that will help you get a "qualitative" feel for your x-ray data so that you can begin to notice interesting features that you will want to analyze quantitatively. Don't be afraid to try things out!


Last updated: February 8, 2001