spectrum.sl - Calculate spectral weights for creating an instrument map
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.
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.
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.
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
- calibration
-
ardlib
- tools
-
acis_bkgrnd_lookup,
acis_fef_lookup,
acis_set_ardlib,
acisspec,
add_grating_orders,
add_grating_spectra,
asphist,
dither_region,
dmarfadd,
dmfilth,
dmregrid,
fullgarf,
mkacisrmf,
mkarf,
mkexpmap,
mkgarf,
mkgrmf,
mkinstmap,
mkpsf,
mkrmf,
mkwarf,
psextract,
psf_project_ray,
rmfimg,
specextract
|