Making your first Hess diagram

1. Copy imgunder.pro from /home/bwillman/astr333/

2. Start a new IDL procedure to create this Hess diagram.

3. Choose one of your datasets to create a Hess diagram for. Read in the data.

4. Read the IDL help page for hist_2d to learn how to make a 2d histogram. Then make a 2d histogram of the color-magnitude diagram of your dataset. Be smart about what color and magnitude range you select, as well as what bin size you select for color and magnitude. In the following example, I've already set the histogram ranges and the histogram binsizes within my IDL procedure. I give one example of how I set the bin size for apparent magnitude in the Hess diagram:

rbin = 0.1
maghist = hist_2d(color, mag, bin1=grbin, bin2=rbin, min1=grmin, max1=grmax,$ min2=rmin, max2=rmax)

5. Right now, you have a 2D array called "maghist". This array holds the densities of the brightest stars (lowest numbered magnitudes) in the lowest indexed elements. You instead want to reverse this so that your Hess CMD will display fainter stars at the bottom. Use the IDL function "reverse" to reverse the columns of your Hess diagram.

6. You will use a combination of plot and imgunder to visualize this Hess diagram. You first want to use 'plot' to draw the plot axes. Use plot to draw the CMD of these data exactly like you did before. But this time, force IDL to hide the actual data points. Do this with "/nodata". Then use imgunder to show your 2D image on top of the plot you just created: imgunder, (bytscl(histogram)).

imgunder would be more correctly named imgover, because it actually plots the image on top of what you just created.

7. Because you have now plotted your image on top of the plot, the tick marks on the axes have disappeared. To fix this, call plot again, exactly as you just did. The only difference is that this time you need to also tell it to not erase the plot you just made. Do this with "/noerase".

8. You should now be looking at a Hess diagram. It doesn't look that fabulous yet. It will look better if you convolve it with a box filter.


Last modified: Thu Sep 11 13:31:48 EDT 2008