Friday, April 8, 2011

Making overlays

Hi there! Today I'd like to tell you about the techniques that I use to create overlays of astronomical data. Usually I want to compare two or more maps, taken with different telescopes and different resolution. Examples would be to mark all the stars detected on an optical image on a near-infrared of the same area. Or to show an optical image of a spiral galaxy and overlay contours of the molecular gas (from observations of CO).

Enough said, lets get started. To create overlays the data need to be in the FITS format for all these techniques to work. FITS-files are astronomical images that have information about the area of the sky that has been observed. Most astronomical data are distributed as fits files, and other formats can be inverted into fits.

The Data
For this presentation I decided to use two images of the Starburst galaxy M82. First, I downloaded a Hubble Space Telescope image from HLA (Hubble Legacy Archive). Most data are public so you can download lots of beautiful images. I got the ACS image in filter F435 (4350 Angstrom or 0.44 micron) which looks like this:


I also found the Spitzer image taken with the IRAC instrument (3.6 micron or 36000 Angstrom) from the Spitzer Heritage Archive. It looks like this:


 (the strange shape of the observed region is due to the way that Spitzer observes: it observes several "patches" of the area and then stitches them together).

Ok, now we have some data, let's see how we can check how well the two maps correspond.


DS9
SAOimage DS9 is a program that is powerful, but tricky to use. In my opinion, the manual is hard to read and does not include all features in the software. There are some sources on the web (see the link above or http://casa.colorado.edu/~ginsbura/ds9tips.htm#body5).

Let's go through how to make an overlay. We represent the HST image as a pixel image (since it has the highest resolution), and the IRAC image as contours. To load the images in DS9, they need each to be in separate "frames".


  1. Open the first image ( File -> Open
  2. Normally, the default image scaling makes it impossible to see the faint structures in these images. Change scaling to something more useful, with the buttons in the main DS9 window or the meny items. Click on "scale" button and the "zscale" ( or Scale -> zscale in the menues).
  3. Make a second frame by clicking on the "frame" button followed by "new".
  4. Load the second image in this frame in the same way as the first. 
  5. To see both images, click the "tile" button. You should now have the two images side by side.
  6. To make sure that we are showing the same area, click (Frame -> Math -> Frame -> WCS)
  7. Start by making the contours of the Spitzer image. Click (Analysis -> Contours) and choose the number of contours and spacing. I got something looking as the second image below. 
  8. Finally, we copy the contours to the HST image. Clock on the frame where the Spitzer image is (You may have to click the menu (Edit -> Pointer) first. Bring up the contour window again, and click File -> Copy contours.
  9. Click in the HST frame. Go back to the contours window and click File -> Paste contours. A dialog appears where you choose coordinate system, colour and linewidth. Use always the WCS system and any color you like. 
  10. The contours are copied, and the image looks like below.

Images loaded in two frames

Contours on the Spitzer image

Final overlay. See the good astrometric correspondance on the bright star in the lower right part.

That was a short guide to making overlays in DS9. DS9 is useful for data analysis, but when preparing figures for publication many clicks are needed to create the graphs. It is possible to use scripts to speed up the generation of graphs, but the final appearance is not the best. For publication-level graphs I prefer the Karma program, but that will be the focus of another post.

2 comments:

  1. Thank you very much for this. This was really useful and easy to understand.

    ReplyDelete
  2. Hi, I cannot find the 'copy contours' option in file menu. Can you help me out?

    ReplyDelete