Chandra X-Ray Observatory
Skip to the navigation links
Last modified: April 2010

Jump to: Description · Examples · Bugs · See Also

AHELP for CIAO 4.3 Sherpa v1


Context: contrib


Return the model spectrum in the form required by the spectrumfile parameter of mkinstmap


get_instmap_weights( [id=None, fluxtype="photon"] )


The get_instmap_weights() command turns the current model values into the form used for the spectrumfile parameter of the CIAO mkinstmap tool. The return value is an object with the following fields:

Field Value
id The dataset identifier.
modelexpr A string containing the model expression.
xlo The lower edge of each bin.
xhi The upper edge of each bin.
xmid The mid-point of each bin.
weight The weight for each bin.
fluxtype "photon" or "erg"; the instrument map is in units of cm^2 count / <fluxtype>.

Please see the Calculating Spectral Weights thread for further information on how to use this routine.

Loading the routine

The routine can be loaded into Sherpa by saying:

from sherpa_contrib.utils import *


Name Default value Description
id None (which means use the value of get_default_id) Which dataset to use.
fluxtype "photon" The units for the instrument map are cm^2 count / <fluxtype>. The valid options for this argument are "photon" (the default) or "erg".

Example 1

sherpa> w = get_instmap_weights()
sherpa> print (w)
id = 1
modelexpr = ( * xsmekal.clus)
xlo = Float32[47]
xhi = Float32[47]
xmid = Float32[47]
weight = Float32[47]
fluxtype = photon
sherpa> add_curve(w.xmid, w.weight, ["", "none"])

Get the weights for the model values of the default dataset and then plot them up as a curve using ChIPS. The weights are appropriate for creating an instrument map in units of cm^2 count / photon and will sum to 1.

Example 2

sherpa> w = get_instmap_weights(fluxtype="erg")

In this case the weights are intended to create an instrument map in units of cm^2 count / erg and so will not sum to 1 (the individual weights will be large in this case, with values somewhere around 1e8, depending on the binning and spectral model chosen).


See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.

See Also

get_conf, get_covar, get_int_proj, get_int_unc, get_proj, get_reg_proj, get_reg_unc
estimate_weighted_expmap, get_chart_spectrum, plot_instmap_weights, save_instmap_weights, sherpa_utils
get_areascal, get_arf, get_arf_plot, get_axes, get_backscal, get_bkg, get_bkg_plot, get_bkg_scale, get_coord, get_counts, get_data, get_data_plot, get_dep, get_dims, get_error, get_exposure, get_grouping, get_indep, get_quality, get_rmf, get_specresp, get_staterror, get_syserror
calc_stat_info, get_fit, get_stat_info
get_default_id, list_stats
get_iter_method_name, get_iter_method_opt, get_method
get_model, get_model_component, get_model_component_image, get_model_component_plot, get_model_plot, get_num_par, get_order_plot, get_par, get_pileup_model, get_response, get_source, get_source_component_image, get_source_component_plot, image_source
get_kernel, get_psf
get_chisqr_plot, get_delchi_plot, get_stat
get_analysis, get_rate
get_ratio, get_resid, image_getregion

Last modified: April 2010
Smithsonian Institute Smithsonian Institute

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