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

Jump to: Description · Examples · Bugs · See Also

AHELP for CIAO 4.3 Sherpa v1


Context: statistics


Return the data and preferences defining a delta chi plot


get_delchi_plot( [id] )


The get_delchi_plot() command returns the data and preferences which define a plot of the delta chi of a data set in a Sherpa session (delta chi --> data-minus-model residuals divided by dataset uncertainties). Once a model is assigned to a loaded data set, this command can be used to list the x, y, x error, and y error data arrays used in the delta chi plot created with plot_delchi() or plot(), in addition to the values for the x label, y label, title, and other plotting preferences. The information returned by get_delchi_plot() may be stored in a variable, or printed to the screen, as shown in the examples section.


  • id - the id of the dataset to use; if not given, uses the default dataset id (id=1 by default, see "ahelp get_default_id")

Example 1

sherpa> print(get_delchi_plot())

When called with no arguments within the print() command, get_delchi_plot() returns the data and preferences associated with the delta chi plot of the default data set 1 (using the model assigned to data set 1).

sherpa> print(get_delchi_plot())
x      = [  1.0950e-02   2.1900e-02   3.6500e-02 ...,   1.4914e+01 1.4928e+01 1.4943e+01]
y      = [  0.       0.       0.     ...,   1.0216   0.4305  16.2691]
yerr   = [ 1.  1.  1. ...,  1.  1.  1.]
xerr   = [ 0.0073  0.0146  0.0146 ...,  0.0146  0.0146  0.0146]
xlabel = Energy (keV)
ylabel = Sigma
title  = Sigma Residuals of source.pi
plot_prefs = {'symbolfill': False, 'errstyle': 'line', 'yerrorbars': True, 'xaxis': True, 'symbolstyle': 2, 'linestyle': 0, 'xerrorbars': True, 'symbolsize': 3}

Example 2

sherpa> delta_chi_plot=get_delchi_plot(2)

This command stores to the variable "delta_chi_plot" the data and preferences defining the plot of the delta chi of data set 4 (using its associated model). The contents may be printed with 'print(delta_chi_plot)'.

Example 3

sherpa> get_delchi_plot().plot_prefs

This command lists the library of plotting preferences available for get_delchi_plot(), and can be used to modify the plot settings:

sherpa> get_delchi_plot().plot_prefs
{'errstyle': 'line',
 'linestyle': 0,
 'symbolfill': False,
 'symbolsize': 3,
 'symbolstyle': 2,
 'xaxis': True,
 'xerrorbars': True,
 'yerrorbars': True}

sherpa> get_delchi_plot().plot_prefs["linestyle"]=3


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
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, plot_chart_spectrum, prof_data, prof_delchi, prof_fit, prof_fit_delchi, prof_fit_resid, prof_model, prof_resid, prof_source
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_energy_flux_hist, get_photon_flux_hist, get_split_plot, plot, plot_arf, plot_bkg, plot_chisqr, plot_data, plot_delchi, plot_energy_flux, plot_fit, plot_model, plot_model_component, plot_order, plot_photon_flux, plot_ratio, plot_resid, plot_source, plot_source_component, set_xlinear, set_xlog, set_ylinear, set_ylog
get_kernel, get_psf, plot_kernel
get_chisqr_plot, get_stat
get_analysis, get_rate
contour_resid, get_ratio, get_resid, image_getregion

Last modified: December 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.