Spectral Weights - CIAO 4.2 (S-Lang) - Chandra X

Transcription

Spectral Weights - CIAO 4.2 (S-Lang) - Chandra X
Spectral Weights - CIAO 4.2 (S-Lang)
Calculating Spectral Weights for mkinstmap
CIAO 4.2 Science Threads
[S-Lang Syntax]
Calculating Spectral Weights for mkinstmap
1
Spectral Weights - CIAO 4.2 (S-Lang)
Table of Contents
• Get Started
• Why are weighted instrument maps important?
• Create a model in Sherpa
• Plot the weights
• Save the weights
• Comparing weights
• How do the resulting instrument maps differ?
• How do the resulting exposure maps differ?
• Notes and Caveats
♦ Changes from CIAO 3.4
• History
• Images
♦ Figure 1: Source spectrum
♦ Figure 2: Weights using a bin width of 0.25 keV
♦ Figure 3: A comparison of bin widths of 0.25 and 0.5 keV
♦ Figure 4: Using a variable bin width
♦ Figure 5: Comparing a set of weights to an ARF
♦ Figure 6: Ratio of a weighted instrument map to a mono-energetic one
♦ Figure 7: Ratio of 0.5 keV to 0.25 keV bin-width instrument maps
♦ Figure 8: Ratio of variable to 0.25 keV bin-width instrument maps
♦ Figure 9: Ratio of 0.25 keV bin-width to mono-chromatic exposure maps
♦ Figure 10: Histograms of the ratio images
2
Table of Contents
Spectral Weights - CIAO 4.2 (S-Lang)
URL: http://cxc.harvard.edu/ciao/threads/spectral_weights/index.sl.html
Last modified: 12 Mar 2010
Calculating Spectral Weights for mkinstmap
CIAO 4.2 Science Threads
[S-Lang Syntax]
Overview
Last Update: 12 Mar 2010 - Added an example of the essential commands to the synopsis section at the start of
the thread, for those users who just need reminding of the syntax; updated some of the figures to use ChIPS for
display rather than ds9.
Synopsis:
When a spectral weights file is provided to 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. More details are given in the Why are weighted
instrument maps important? section of this thread.
An example set of commands used to create the weight file follows; please remember to change the data range,
binning, spectral model and parameters to those appropriate for your data!
sherpa>
sherpa>
sherpa>
sherpa>
sherpa>
sherpa>
require("sherpa_contrib");
dataspace1d(0.5, 8, 0.25);
set_source(xsphabs.gal * powlaw1d.pl);
gal.nh = 1.3;
pl.gamma = 1.7;
save_instmap_weights("weights.txt");
The output file - here called weights.txt - can then be used as the input for the spectrumfile parameter of
mkinstmap.
Purpose:
Use Sherpa to create a spectral weights file than can be used by mkinstmap to create a weighted instrument map.
Read this thread if:
you are working with an ACIS or HRC imaging observation and would like to create a spectral weights file for
use in one of the exposure map threads.
Related Links:
• Analysis Guide: Extended Sources
Calculating Spectral Weights for mkinstmap
3
Spectral Weights - CIAO 4.2 (S-Lang)
Proceed to the HTML or hardcopy (PDF: A4 | letter) version of the thread.
Get Started
Sample ObsID used: 1838 (ACIS-S, G21.5-0.9)
No data file is actually needed to create the weights file. As we create instrument- and exposure- maps to see what
difference adding a weights file makes, we require the same data products for these steps as the Single Chip
Exposure Map thread.
This thread uses the sherpa_contrib package, which can be loaded into Sherpa using the following
command:
sherpa> require ("sherpa_contrib");
An error message of
Unable to locate sherpa_contrib on load path
means that the CIAO contributed scripts package has not been installed or is out of date.
This script requires that the contributed scripts package is no older than August 3, 2009. This can be checked by
saying
unix% cat $ASCDS_CONTRIB/VERSION.CIAO_scripts
03 Aug 2009
Why are weighted instrument maps important?
In dividing a counts image by an exposure map, the primary aim is to obtain an image with units of surface
brightness in photons/s/cm2/arcsec2 or, equivalently, in flux/pixel. It is important to understand that
this can yield an accurate answer only if the number of counts in each pixel is actually proportional to the integral
of the incident source spectrum over the relevant energy band.
Due to the strong energy dependence of the effective area, this is not always true. In particular, the number of
detected counts is proportional to the incident flux in a broad band only when the effective area is constant within
the chosen band. Large systematic errors may result if one blindly applies a monochromatic exposure map to a
broad band image which encompasses a large range of variation in the effective area.
Nevertheless, it is often desirable both to examine broader energy bands and to examine energy bands where the
response is not particularly flat. In such cases, if the broad features of the incident spectrum are known (e.g.
thermal emission from a cluster) and if the spectral variations within the image are not too large, one can reduce
the systematic errors by computing an exposure map which is weighted according to a specific model for the
incident spectrum. An Introduction to Exposure Maps (PS, 12pp) gives a comparison of MARX simulated data
analyzed using both weighted and monochromatic exposure maps.
4
Overview
Spectral Weights - CIAO 4.2 (S-Lang)
Create a model in Sherpa
Since the weights are largely independent of the responses, it is not necessary to use the PHA and ARF files to
define a model. Instead, we can use the Sherpa dataspace1d command to create an energy grid from 0.5 to 8
keV with a bin width of 0.25 keV:
sherpa> dataspace1d(0.5, 8, 0.25);
Now we want to define a model that represents the source emission: we do not need to worry about the overall
normalization of the model, just that the relative amplitudes of any emission components is correct.
For this example we are going to use a power law, with a gamma of 1.7, which is absorbed by a line-of-sight
column density of 1.3 x 1022 atoms cm-2. The models and parameter values should be changed to match the
emission from the source of interest.
sherpa>
sherpa>
sherpa>
sherpa>
sherpa>
set_source(xsphabs.gal * powlaw1d.pl);
gal.nh = 1.3;
pl.gamma = 1.7;
plot_source;
log_scale;
The plot of the spectrum is shown in Figure 1:
Why are weighted instrument maps important?
5
Spectral Weights - CIAO 4.2 (S-Lang)
Figure 1: Source spectrum
The source model evaluated on the energy grid that will be used to create the weights. The normalisation of the
powerlaw model is not important here, since the calculation of the weights involves normalizing the model
values by the total model flux.
Plot the weights
The plot_instmap_weights routine plots up the weights, as shown in Figure 2.
sherpa> plot_instmap_weights;
sherpa> log_scale;
Figure 2: Weights using a bin width of 0.25 keV
Since we are evaluating the weights on the same grid used to calculate the source spectrum (Figure 1), the shape
of the two plots are the same; the only differences are the magnitude of the Y axis and that the data is now plotted
as a histogram.
6
Create a model in Sherpa
Spectral Weights - CIAO 4.2 (S-Lang)
Save the weights
The weights can be saved to an ASCII file, in a format suitable for mkinstmap using the
save_instmap_weights routine. Here we save them to the file "weights.txt".
sherpa> save_instmap_weights("weights.txt");
Since the file is in ASCII format you can view it with various UNIX utilities, or with the dmlist and prism
tools:
unix% head -5 weights.txt
#TEXT/SIMPLE
# X WEIGHT
6.2500000000000e-01 2.6220696092014e-04
8.7500000000000e-01 6.8033671439539e-03
unix% tail -5 weights.txt
6.875000000000 1.5496657006506e-02
7.125000000000 1.4520638260218e-02
7.375000000000 1.3549337557838e-02
7.625000000000 1.2839676215019e-02
7.875000000000 1.2185290954080e-02
The dmstat tool can be used to show that the weights column sums up to 1, as is needed for use in
mkinstmap:
unix% dmstat weights.txt
X
min:
0.625
max:
7.875
mean:
4.25
sigma:
2.1638603621
sum:
127.5
good:
30
null:
0
WEIGHT
min:
max:
mean:
sigma:
sum:
good:
null:
@:
@:
0.00026220696092
0.074007102956
0.033333333333
0.020733677512
1
30
0
1
30
@:
@:
1
6
The output table gives the energy at the center of each band (in keV, X) and the fraction of the incident flux
falling in that band (the spectral weighting, WEIGHT). This file may now be used to create a weighted instrument
map; e.g. see the Compute an ACIS Exposure Map (Single Chip) and Build Fluxed Image thread.
In the following sections of the thread we show how you can change the binning used to create the weights and
visualize the differences. Note that using a bin width of 0.25 keV is generally excessive, in that it over-resolves
the energy grid, and so will lead to longer run times of mkinstmap than are strictly necessary.
Figure 2: Weights using a bin width of 0.25 keV
7
Spectral Weights - CIAO 4.2 (S-Lang)
Comparing weights
If you wish to use a different energy range then you can call dataspace1d to create a new grid, or filter the
grid by using the ignore and notice routines. In the following we create new datasets with different binning
characteristics to investigate the differences these choices can make.
First we use the same energy range but double the bin width to 0.5 keV. We add the weights to the existing plot
(Figure 2) rather than create a new plot, and so create Figure 3:
sherpa>
sherpa>
sherpa>
sherpa>
sherpa>
dataspace1d(0.5, 8, 0.5; id=2);
set_source(2, gal * pl);
plot_instmap_weights(2; overplot=1);
set_histogram({"line.color", "red"});
save_instmap_weights(2, "weights2.txt");
Figure 3: A comparison of bin widths of 0.25 and 0.5 keV
The red line, from the second set of weights, is roughly twice as high as the original plot. The actual difference
depends on how much the model varies within the new bins.
We now decide to use variable-width bins, manually choosing energy ranges over which we consider the effective
area to be approximately flat. These values are for demonstration purposes only and should not be considered to
8
Comparing weights
Spectral Weights - CIAO 4.2 (S-Lang)
be valid choices for your analysis!
As the dataspace1d command only creates regularly-spaced grids, we use the load_arrays command to
create the grid: the xlo*0 statement is used to create a fake data array, since we ignore the data values for this
calculation. The result is shown in Figure 4.
sherpa>
sherpa>
sherpa>
sherpa>
sherpa>
sherpa>
sherpa>
sherpa>
edges = [0.5, 1, 1.5, 2, 2.25, 2.5, 2.75, 3, 3.5, 4, 6, 8];
xlo = edges[[:-2]];
xhi = edges[[1:]];
load_arrays(3, xlo, xhi, xlo*0, Data1DInt);
set_source(3, gal * pl);
plot_instmap_weights(3; overplot=1);
set_histogram({"line.color", "green"});
save_instmap_weights(3, "weights3.txt");
Figure 4: Using a variable bin width
The green line, showing the weights from the variable bin widths, is similar to the second (red) set of weights
since the bin widths are not too different.
It may be useful to plot the ARF for your source along with the weights, to check that the binning you have used
is sensible. In the following we use ChIPS commands to plot the data from the file src.arf on top of the
weights, creating Figure 5:
Figure 3: A comparison of bin widths of 0.25 and 0.5 keV
9
Spectral Weights - CIAO 4.2 (S-Lang)
sherpa>
sherpa>
sherpa>
sherpa>
sherpa>
sherpa>
sherpa>
plot_instmap_weights(3);
add_axis(Y_AXIS, 1, 1, 2);
add_curve("src.arf[cols energ_hi,specresp]", {"symbol.style", "none"});
set_plot_ylabel("ARF (cm^2)");
log_scale(Y_AXIS);
limits(Y_AXIS, 30, AUTO);
limits(X_AXIS, 0, 9);
Figure 5: Comparing a set of weights to an ARF
By adding a second Y axis to the plot, the ARF can be shown in the same plot, even though the Y axis values for
the two data sets are very different.
The plot can be used to help you determine whether the choice of bins is sensible or not by seeing how the ARF
varies within a bin. Ideally, the bins should be chosen to define regions where the effective area curve is roughly
flat (slowly varying with energy); the reasons for this are discussed in An Introduction to Exposure Maps (PS,
12pp).
10
Figure 4: Using a variable bin width
Spectral Weights - CIAO 4.2 (S-Lang)
How do the resulting instrument maps differ?
In this section we create instrument maps for the weights created above, and compare them to a mono-energetic
version. All the instrument maps were created using the following set of parameters (taken from the single chip
exposure map thread):
unix%
unix%
unix%
unix%
unix%
unix%
unix%
punlearn mkinstmap
pset mkinstmap obsfile="asphist_7.fits[asphist]"
pset mkinstmap maskfile=acisf01838_000N002_msk1.fits
pset mkinstmap pbkfile=acisf084245776N002_pbk0.fits
pset mkinstmap dafile=CALDB
pset mkinstmap detsubsys=ACIS-7
pset mkinstmap pixelgrid="1:1024:#1024,1:1024:#1024"
The maps that were created are given below:
Mono-energetic: imap.e1.7.fits
unix% pset mkinstmap spectrumfile=NONE
unix% pset mkinstmap monoenergy=1.7
0.25 keV bin width: imap.weights.fits
unix% pset mkinstmap spectrumfile=weights.txt
0.5 keV bin width: imap.weights2.fits
unix% pset mkinstmap spectrumfile=weights2.txt
Variable bin width: imap.weights3.fits
unix% pset mkinstmap spectrumfile=weights3.txt
On a reasonably modern Linux machine the run times for mkinstmap were approximately 5 s, 20 s, 10 s, and 10
s for these four maps (rounded to the nearest 5 seconds). The actual run times depend strongly on operating
system and disk access, so these numbers should only be taken as rough guides.
A quick comparison using dmstat shows that the three weighted maps are similar, but significantly different to
the mono-energetic case:
unix% cat istack
imap.e1.7.fits
imap.weights.fits
imap.weights2.fits
imap.weights3.fits
unix% dmstat @istack cen- med+ sigFile=imap.e1.7.fits
IMAP
min:
0
@:
max:
628.43005371
mean:
589.88732488
median:
598.66592407
sum:
618541691.57
good:
1048576
null:
0
File=imap.weights.fits
IMAP
min:
0
@:
max:
414.24081421
mean:
382.64538286
median:
388.6978302
sum:
401232764.98
( 1 1 )
@:
( 216 416 )
( 1 1 )
@:
How do the resulting instrument maps differ?
( 216 416 )
11
Spectral Weights - CIAO 4.2 (S-Lang)
good:
1048576
null:
0
File=imap.weights2.fits
IMAP
min:
0
max:
414.68215942
mean:
383.25308209
median:
389.25798035
sum:
401869983.81
good:
1048576
null:
0
File=imap.weights3.fits
IMAP[cm**2]
min:
0
max:
417.61373901
mean:
385.95979285
median:
392.26676941
sum:
404708175.75
good:
1048576
null:
0
@:
( 1 1 )
@:
@:
( 216 416 )
( 1 1 )
@:
( 216 416 )
Comparing the median values - shown in bold above - shows that the weighted maps are roughly 65 % of the
mono-energetic value. Dividing imap.weights.fits by imap.e1.7.fits produces the image shown in
Figure 6.
unix% punlearn dmimgcalc mode=h
unix% dmimgcalc imap.weights.fits,imap.e1.7.fits out=ratio1.fits op=imgout=img1/img2 mode=h
unix% dmstat ratio1.fits cen- sig- med+
ratio1.fits
min:
0.61701643467
@:
( 594 592 )
max:
0.66749340296
@:
( 225 2 )
mean:
0.64855308378
median:
0.64922356606
sum:
672037.83949
good:
1036211
null:
12365
The use of imgout=img1/img2 for the operation parameter of dmimgcalc ensures that 0-pixel values
get replaced by NaN values, and so will be ignored by dmstat, ChIPS, and ds9. If we had used op=div and
set both infile and infile2 then these pixels would have been set to 0 instead.
unix% chips
----------------------------------------Welcome to ChIPS: CXC's Plotting Package
----------------------------------------CIAO 4.2 Monday, November 30, 2009
chips-1> add_window({"width", 8, "height", 8, "units", "inches"});
chips-2> add_plot(0, 0, 1, 1, {"style", "open"});
chips-3> add_image("ratio1.fits", {"colormap", "rainbow", "axis.pad", 0});
chips-4> add_colorbar(0.4, 0.9, {"width", 0.05, "length", 0.6});
chips-5> set_colorbar({"*.color", "black", "*.thickness", 2,
... "ticklabel.size", 16, "ticklabel.fontstyle", "bold"});
12
How do the resulting instrument maps differ?
Spectral Weights - CIAO 4.2 (S-Lang)
Figure 6: Ratio of a weighted instrument map to a mono-energetic one
The ratio image shows that whilst there is a lot of small-scale differences - the ACIS-S instrument maps are
calibrated per column and there are horizontal and vertical gradients - the overall image is flat within a 5%
margin. The large-scale variations are more relevant since the small-scale structure tends to get washed out when
creating an exposure map due to the Chandra dither pattern (see Figure 9).
In general the per-column variation is due to the variation in the detector response (the Quantum Efficiency),
whilst the large-scale differences are due to the off-axis dependence of the effective area.
Comparing the weighted instrument maps show that the absolute variation between them is much smaller than to
the mono-energetic case (Figure 7 and Figure 8):
unix% dmimgcalc imap.weights2.fits,imap.weights.fits out=ratio2.fits op=imgout=img1/img2 mode=h
unix% dmimgcalc imap.weights3.fits,imap.weights.fits out=ratio3.fits op=imgout=img1/img2 mode=h
Figure 6: Ratio of a weighted instrument map to a mono-energetic one
13
Spectral Weights - CIAO 4.2 (S-Lang)
Figure 7: Ratio of 0.5 keV to 0.25 keV bin-width instrument maps
The 0.5 keV bin width instrument map has slightly higher pixel values than the 0.25 keV case, but the difference
is small (less than one per cent).
14
Figure 7: Ratio of 0.5 keV to 0.25 keV bin-width instrument maps
Spectral Weights - CIAO 4.2 (S-Lang)
Figure 8: Ratio of variable to 0.25 keV bin-width instrument maps
Unlike Figure 7, the variable bin width map is generally slightly lower than the 0.25 keV version, although the
differences are again at the less than one per cent level. The different energy-binning scheme has resulted in a
change to the the large-scale pattern, reflecting both the energy and positional dependence of the effective area.
How do the resulting exposure maps differ?
Figure 9 shows the ratio of the exposure maps created using imap.e1.7.fits and imap.weights.fits:
unix%
unix%
unix%
unix%
punlearn mkexpmap
pset mkexpmap xygrid="3643.1:4723.1:#1080,3853.4:4933.4:#1080"
pset mkexpmap asphistf=asphist_7.fits
pset mkexpmap useavgaspect- normalize-
Figure 8: Ratio of variable to 0.25 keV bin-width instrument maps
15
Spectral Weights - CIAO 4.2 (S-Lang)
unix% mkexpmap instmap=imap.e1.7.fits outf=emap.e1.7.fits mode=h
unix% mkexpmap instmap=imap.weights.fits outf=emap.weights.fits mode=h
unix% dmimgcalc emap.weights.fits,emap.e1.7.fits outf=emap.ratio.fits op=imgout=img1/img2 mode=h
Figure 9: Ratio of 0.25 keV bin-width to mono-chromatic exposure maps
The difference in the exposure maps is similar to the corresponding instrument map comparison shown in Figure
6.
An alternative view is the histogram of the pixel values in the various ratio images, as shown in Figure 10:
16
How do the resulting exposure maps differ?
Spectral Weights - CIAO 4.2 (S-Lang)
Figure 10: Histograms of the ratio images
The left plot compares the pixel distribution of the instrument- and exposure-map ratio images comparing the
weighted result (bin width of 0.25 keV) to the mono-energetic case. The two distributions are very similar.
The right-hand plot shows how the different binning schemes affect the instrument map: in this particular case
the choice of binning scheme does not seem to make a large difference on the overall result, but this is a scientific
call to be made for each observation.
This figure was created using the following set of commands, making use of routines from Crates, ChIPS, and
ciao_utils.
First we ensure that the ciao_utils module is loaded:
sherpa> require ("ciao_utils");
Now we read in the data we want to plot using the Crates routines read_file and get_piximgvals. We
then filter the image values to exclude those pixels with values of 0, and use the filtered set of pixels in the call to
simple_hist.
sherpa>
sherpa>
sherpa>
sherpa>
r1
r2
r3
re
=
=
=
=
read_file("ratio1.fits");
read_file("ratio2.fits");
read_file("ratio3.fits");
read_file("emap.ratio.fits");
sherpa>
sherpa>
sherpa>
sherpa>
i1
i2
i3
ie
=
=
=
=
get_piximgvals(r1);
get_piximgvals(r2);
get_piximgvals(r3);
get_piximgvals(re);
sherpa>
sherpa>
sherpa>
sherpa>
ix1
ix2
ix3
ixe
=
=
=
=
where(i1
where(i2
where(i3
where(ie
>
>
>
>
0);
0);
0);
0);
Figure 9: Ratio of 0.25 keV bin-width to mono-chromatic exposure maps
17
Spectral Weights - CIAO 4.2 (S-Lang)
sherpa>
sherpa>
sherpa>
sherpa>
h1
h2
h3
he
=
=
=
=
simple_hist(i1[ix1];
simple_hist(i2[ix2];
simple_hist(i3[ix3];
simple_hist(ie[ixe];
nbins=20);
nbins=20);
nbins=20);
nbins=20);
With the data available now in the h1, h2, h3, and he variables we can now plot up the histograms (normalized
to give the fraction of pixels in each bin):
sherpa> add_window({"width", 6, "height", 4, "units", "inches"});
sherpa>
sherpa>
sherpa>
sherpa>
add_histogram(h1.xlow, h1.xhigh, h1.y / sum(h1.y));
add_histogram(he.xlow, he.xhigh, he.y / sum(he.y));
set_histogram({"line.style", "dot"});
set_plot_ylabel("Fraction of pixels");
sherpa> split(1,2);
sherpa>
sherpa>
sherpa>
sherpa>
add_histogram(h2.xlow, h2.xhigh, h2.y / sum(h2.y));
set_histogram({"line.color", "red"});
add_histogram(h3.xlow, h3.xhigh, h3.y / sum(h3.y));
set_histogram({"line.color", "green"});
sherpa> bind_axes("plot2", "ay1", "plot1", "ay1");
sherpa> set_yaxis({"ticklabel.visible", 0});
sherpa> set_yaxis("by2", {"ticklabel.visible", 1});
sherpa> limits(X_AXIS, 0.9945, 1.0059);
sherpa> add_label(1.0025, 0.22, "ratio2.fits", {"color", "red"});
sherpa> add_label(0.999, 0.2, "ratio3.fits", {"color", "green", "halign", 0.5});
sherpa> current_plot("plot1");
sherpa>
sherpa>
sherpa>
sherpa>
sherpa>
limits(X_AXIS, 0.615, 0.669);
add_line(0.62, 0.22, 0.628, 0.22);
add_label(0.63, 0.22, "ratio1.fits", {"valign", 0.5});
add_line(0.62, 0.2, 0.628, 0.2, {"style", "dot"});
add_label(0.63, 0.2, "emap.ratio.fits", {"valign", 0.5});
sherpa> x1 = get_plot("plot1").leftmargin;
sherpa> x2 = 1 - get_plot("plot2").rightmargin;
sherpa> add_label(0.5*(x1+x2), 0.05, "Pixel value", {"size", 14, "coordsys", "FRAME_NORM", "halign", 0.5});
The bind_axes call is used to make sure the y axes of the two plots show the same range. Since the two plots
share a common axis, we decide to display the tick labels on the right-hand axis of the second plot. Labels and
lines are used to add annotations to each plot (setting the valign or halign attributes of a label to 0.5 centers
them vertically or horizontally at that coordinate). The last label is added using the frame-normalized
(FRAME_NORM) coordinate system to ensure that it is centered between the plots (we use the get_plot routine
to get the coordinates of the plot edges).
Note: The comparisons above were all made with the on-axis chip; larger differences may be seen between
different weighting schemes for ACIS chips that are further off axis, and so are subject to stronger,
energy-dependent, vignetting.
18
Figure 10: Histograms of the ratio images
Spectral Weights - CIAO 4.2 (S-Lang)
Notes and Caveats
The An Introduction to Exposure Maps document provides background reading on why weighted exposure maps
are important, and under what conditions they produce meaningful results.
1. If you wish to make several exposure maps for different bands (e.g. 1-2 keV, 2-4 keV, and 4-10 keV),
rerun the script for each of these bands. Any time you use the weighting scheme, the sum of the weights
should be equal to one. If one (incorrectly) makes a single set of weights with this script and then
subdivides them to weight different bands, the weights of each instrument map would not sum to one.
Thus, the instrument and exposure maps that are derived would have effective areas that are much too
small.
2. To compute an image which gives the integrated flux over the full energy range, it may be best to first
compute flux-corrected images in several narrow energy bands (where the ARF is nearly flat) and then
sum those fluxed images together. Weighted exposure maps work well for an energy band where the ARF
variation isn't very large, but for a full-band 0.5-10 keV image, it may not be a good idea to compute the
flux by dividing the counts image by a single number. This is especially true for cases where the source
spectrum varies significantly within the image; in that case, there is no general way to compute a single
set of weights which will be sensible for every part of the image.
Changes from CIAO 3.4
The CIAO 3.4 version of the code required you to:
a. save the spectrum to a text file,
b. and manually edit the spectrum.sl file if you wanted to change the bins used for the calculation of the
weights.
Neither of these steps are needed now, since the calculation can access the spectal model directly and the choice
of bins used for the weights is now determined by the values used in the dataspace1d or load_arrays call.
History
03 Aug 2009 Updated for CIAO 4.1: spectrum.sl has been replaced by the sherpa_utils module; see
the Changes from CIAO 3.4 section; a comparison of weighted to mono-energetic instrument
maps has been added.
09 Feb 2010 updated for CIAO 4.2: the "get_imagevals" command has been renamed to
get_piximgvals
12 Mar 2010 Added an example of the essential commands to the synopsis section at the start of the thread, for
those users who just need reminding of the syntax; updated some of the figures to use ChIPS for
display rather than ds9.
URL: http://cxc.harvard.edu/ciao/threads/spectral_weights/index.sl.html
Notes and Caveats
Last modified: 12 Mar 2010
19
Spectral Weights - CIAO 4.2 (S-Lang)
20
History