About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: March 2007

URL: http://cxc.harvard.edu/ciao3.4/chart_spectrum.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 chart_spectrum Context: tools

Synopsis

chart_spectrum.sl - Create a source spectrum for input to ChaRT

Syntax

write_chart_spectrum("output_file.dat",[min_energy],[max_energy])
plot_chart_spectrum(min_energy,max_energy)

Description

If you use a spectrum file as the spectral specification for your PSF when running ChaRT, you will need to use the script chart_spectrum.sl.

It is assumed that the spectral data have been fit in Sherpa before chart_spectrum.sl is run. For help with fitting, see the Fitting PHA Spectra thread.

The script is run from within Sherpa ("ahelp sherpa"), as shown in the example. To load the script:

sherpa> () = evalfile("chart_spectrum.sl")

This step is only necessary once per Sherpa session.

The first argument to write_chart_spectrum is the name of the spectrum file to create. (If the file already exists, it will be overwritten.) The other arguments specify the minimum and maximum energies to include in the spectrum. If the bounds are omitted, the full energy range (as determined by Sherpa) will be used.

The output produced by write_chart_spectrum is an ASCII file that contains two columns. The first column gives the center of the energy bin in [keV]. The second column is the flux in [photons/cm2/s].

If you would like to plot your spectrum, use the function plot_chart_spectrum.

This script is used in the Preparing to Run ChaRT thread.

Example 1

sherpa> write_chart_spectrum("source_flux_chart.dat",1.0,8.0)

Create a spectrum file named "source_flux_chart.dat" over the range 1-8 keV.

Example 2

sherpa> plot_chart_spectrum(1.0,8.0)

Plot the spectrum over the range 1-8 keV.

NOTES

This script is not an official part of the CIAO release but is made available as "contributed" software via the CIAO scripts page. Please see the installation instructions page for help on installing the package.

Bugs

See the bugs page for this script on the CIAO website for an up-to-date listing of known bugs.

Hardcopy (PDF): A4 | Letter
Last modified: March 2007



The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.