Evt2img: A demo that uses the SLgtk and histogram modules
evt2img is a simple interactive program that produces either a PNG or JPEG true-color (RGB) image from a Chandra X-ray Observatory event file. It was was put together in relatively little time to illustrate the power and flexibility of the S-Lang histogram and SLgtk modules. The script may be found in the examples directory of the histogram module distribution.
evt2img creates the image by filtering the data in the selected energy
bands and then bins the selected events using the
One of the most useful features of the program is the ability to plot
the energy spectrum of the events and use it to adjust the energy
bands. The script creates the energy spectrum using the histogram
As figure shows, one may pan around (by clicking to center the image) and zoom in and out, and set various scaling properties by clicking on the corresponding buttons. Note that the above image contains a fair amount of high energy background noise as is evidenced by the number of blue background pixels. These may be removed from the image by adjusting the energy bands that define the RGB levels. Clicking on the "Adjust RGB Levels" button brings up the RGB selection widget:
This widget shows a plot of the color-coded energy spectrum of the events making up the image and various sliders to adjust the color levels. Moving the upper limit blue slider down to about 7 keV and the clicking on the "Equalize" button produces:
Assuming that these are the desired levels, click the "Ok" button to close this dialog and recreate the image using the new levels:
Finally, the image may be saved to either a JPEG or PNG by clicking on the "Save" button:
This page was last updated Dec 2, 2007 by John E. Davis. To comment on it or the material presented here, send email to davis at space mit edu.