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/spectrum.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 spectrum Context: tools

Synopsis

spectrum.sl - Calculate spectral weights for creating an instrument map

Description

The spectrum.sl script is used to create the spectral weights file for a given source model spectrum. When a spectral weights file is provided to mkinstmap ("ahelp mkinstmap"), the tool computes a weighted instrument map instead of a monochromatic instrument map. Essentially, a weighted instrument map is a linear combination of monochromatic maps calculated for several energy-weight pairs.

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

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

This step is only necessary once per Sherpa session.

Input Source Model and Energy Bands

Refer to the Calculating Spectral Weights thread for details on how to create the source model input required for spectrum.sl. Instructions on creating this file and defining the appropriate energy bands in the script are outside the scope of this help file.

Output File

The script creates a file called weights.txt which contains the energy at the center of each band (in keV) and the fraction of the incident flux falling in that band (the spectral weighting). If this file already exists in the working directory, the script will clobber it without warning. When running the script multiple times, be sure to rename any files that are to be saved.

This script is used in the Calculating Spectral Weights thread.

Example

sherpa> runtest("1838.model")

Given an input source model for ObsID 1838, spectrum.sl computes the fraction of the incident flux falling in each energy band.

The output file contains:

unix% more weights.txt
 7.500e-01  1.577e-01
 1.400e+00  1.977e-01
 1.900e+00  3.815e-02
 3.000e+00  2.586e-01
 5.000e+00  1.538e-01
 7.000e+00  1.094e-01
 9.000e+00  8.470e-02

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.