Contour Maps



Below are the detail steps to create contour maps of the HI sources, the overlays with an optical image, and the programs needed. Each program links to the header of the program and some extended explanation for each of them.

    1. From the sources in your catalogue that you want to create contour maps for, identify the velocity and channel range, the RA and DEC, the pixel coordinates and the main channel of each galaxy.

    2. Use (in IDL) to plot the contours for 16 channels around the center channel of your source. With this program you can get a general idea of what the contours look like. This is only useful for you to see what contours exist in more than 3 channels.


    • SLICE_IT_TEST, datacube, channel_center, channel_boxcar, channel_increment, level_scale, pos_x, pos_y, pos_size, postscript


    • slice_it_test,grid,765,1,1,1.0,10,60,50,0


    • You need to restore the grid before using the program.

    • the postcript option are 0 or 1. The postcript option 0 will just display the 4x4 image and 1 will save the file created. The name of the file is in the program so make sure to change it before saving the file.

    • For this program the pixel coordinates refer to the lower left corner of the box you want to create. Therefore, to make sure your galaxy is as centered as possible, subtract half of the box size from your galaxy's coordinates.

    • Use boxcar=1
    • You need to finetune with the level scale, until you are satisfied with the results. Try the highest possible value in which you can see the galaxy in at least 3 boxes.

    • Create a box at least 80 pixels, so that you can see all the surroundings of the galaxy

    • After you are happy with the level scale and the size of the box, print the 4x4 channels. Write down the c_levels, you'll need them afterwards. In the 4x4 box, I recommend that you box the contoured-galaxy which occurs in 3 or more channels. At the same time, look for other contours that might occur in 3 or more channels as well.

    • It is possible that you find contours for other galaxies, since you have only checked 16 boxes and some of the galaxies' ranges goes beyond that. Watch out for that and identify them if necessary.

    3. Use (in IDL) to box what you have selected in your 4x4. This program makes contour plots for specified channels in a grid datacube and allows for the user to box and write the "good" data to a new array.


    • BOX_IT, datacube, channel_start, channel_range, channel_boxcar, level_scale


    • box_it,grid,765,10,2,1.0


    • You need to restore the grid before calling the program.

    • The maximun size of the box is 144x144. The adjust your left corner coordinates acording to it.

    4. Use to create contours. This program takes the "good" data selected by the program box_it, and sums it up into one contour.


    • Read_it, filename, OPTION


    • read_it, "box_it_data.sav", 0


    • You will need to restore the grid before using the program.

    5. Use the to box the contours that you want to use to create overlays. This program gives the size of the box you create around the contours and the center coordinate of that box. From that, find the corner coordinates of the box because you will need both the coordinates of the center and the corner of the box to create an overlay.


    • getcoords, filename


    • getcoords,"readit324_1508.sav"

    6. Use the center coordinate and the box size to create the image using the program mosaic in the page . You should use the SDSS R band and use the best resolution possible (0.4 arcsec)

    7. In Unix, once the image is done (this could take a long time) use the command wget and then the link to the fits file to download the image. Check that the image is the right one before downloading.

    8. In IDL, use the command img=mrdfits('mosaic.fits') to convert the file into a .sav file. The mosaic.fits is the name of the file that you downloaded.

    9. In IDL, use the command save,img,filename='img.sav' to save the file as .sav file.

    10. In Unix, change the name of your mosaic.fits to a specificname.fits

          This step is optional. But I recommend it in case you need to reuse the image.

    11. In IDL use to create the final overlay. To save the image take a screenshot of it.


    • OVERLAY,grid,znew,rahr,decdeg,c_levels,xmin,xmax,ymin,ymax,img,channel_start,channel_end,velocity_start,velocity_end


    • overlay,grid,sumarr,ra,dec,levels,15.08,15.113,1.8,2.3,mosaic174_1508,channel_start,channel_end,velocity_start,velocity_end


    • You will need to restore your grid, the img.sav and the contour file created by

    • Check the header of the fits file image to make sure it is the correct one.
    • Channel_start, Channel_end, Velocity_start and velovity_end are variables in the file created by Therefore you do not need to write any numbers for them, the program will read them.


  • Be systematic and careful. The process is not hard but it has a lot of steps.

  • Name the same type of files in the same way.

  •       EX. For Box_it: box3.sav

                        Overlay: overlay3.jpg

  • Make sure to know what the names correspond to.

  • Have a spreadsheet where you keep track of all the information and the steps that you have done for each image.

  • Always check the programs and compile any changes. The programs are well commented so read them, they are really helpful!


Ana Paola Mikler, Union College

Nicholas Crump, George Mason University