Chandra X-Ray Observatory
Skip to the navigation links
Last modified: January 2016

AHELP for CIAO 4.9 Sherpa v1


Context: contrib


Plot up the model spectrum in the form required by ChaRT


plot_chart_spectrum(id=None, elow=None, ehigh=None, ewidth=None,


The plot_chart_spectrum() command creates a plot of the current model values in the form expected by ChaRT2 (the Chandra Ray Tracer). Please see the ChaRT preparation 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.chart import *


Name Default value Description
id None Which dataset to use: if None then the value returned by get_default_id() will be used.
elow None The minimum energy at which to evaluate the model; this parameter controls the lower edge of the lowest-energy bin, and is in keV. A value of None means to use the lowest energy bin from the ARF grid. This value should not be smaller than 0.2 keV.
ehigh None The maximum energy at which to evaluate the model; this parameter controls the upper edge of the highest-energy bin, and is in keV. A value of None means to use the highest energy bin from the ARF grid. This valus should not be larger than 10 keV.
ewidth None The bin width to use, in keV. A value of None means to use the bin width from the ARF grid.
norm None A scaling factor to allow you to easily change the overall flux of the model. A value of None is equivalent to a factor of 1; a value of 10 would create a ChaRT spectral model ten times brighter than the input model.

Example 1

sherpa> plot_chart_spectrum()

Create a plot of the model for the default dataset using the units expected by ChaRT2.

Example 2

sherpa> plot_chart_spectrum(elow=1, ehigh=8)

In this example the plot is restricted to the range 1 to 8 keV, using the default binning given by the ARF grid. Note that this energy range need not overlap the range used to fit the data (or even the energy ranges of the ARF and RMF files). It should however remain within the range 0.2 to 10 keV.

Changes in the scripts 4.8.2 (January 2016) release

The plot style is now a histogram rather than a curve.


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

See Also

get_chart_spectrum, get_data_prof, get_data_prof_prefs, get_delchi_prof, get_delchi_prof_prefs, get_fit_prof, get_model_prof, get_model_prof_prefs, get_resid_prof, get_resid_prof_prefs, get_source_prof, get_source_prof_prefs, prof_data, prof_delchi, prof_fit, prof_fit_delchi, prof_fit_resid, prof_model, prof_resid, prof_source, save_chart_spectrum, sherpa_chart
get_arf_plot, get_bkg_plot
normal_sample, t_sample, uniform_sample
get_energy_flux_hist, get_lrt_plot, get_lrt_results, get_photon_flux_hist, get_pvalue_plot, get_pvalue_results, get_split_plot, plot, plot_arf, plot_bkg, plot_cdf, plot_chisqr, plot_data, plot_delchi, plot_energy_flux, plot_fit, plot_model, plot_model_component, plot_order, plot_pdf, plot_photon_flux, plot_pvalue, plot_ratio, plot_resid, plot_scatter, plot_source, plot_source_component, plot_trace, set_xlinear, set_xlog, set_ylinear, set_ylog
get_chisqr_plot, get_delchi_plot

Last modified: January 2016
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-2017. All rights reserved.