Chandra X-Ray Observatory
	(CXC)
Skip to the navigation links
Last modified: December 2013

URL: http://cxc.harvard.edu/sherpa/ahelp/get_chisqr_plot.html
Jump to: Description · Examples · Bugs · See Also


AHELP for CIAO 4.6 Sherpa v2

get_chisqr_plot

Context: statistics

Synopsis

Return the data and preferences defining a chi^2 plot

Syntax

get_chisqr_plot( [id] )

Description

The get_chisqr_plot() command returns the data and preferences which define a plot of the chi^2 of a data set in a Sherpa session (chi^2 --> data-minus-model residuals divided by dataset uncertainties, the quantity squared). 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 chi^2 plot created with plot_chisqr() or plot(), in addition to the values for the x label, y label, title, and other plotting preferences. The information returned by get_chisqr_plot() may be stored in a variable, or printed to the screen, as shown in the examples section.

Arguments:

  • 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_chisqr_plot())

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

sherpa> print(get_chisqr_plot())
x      = [  1.0950e-02   2.1900e-02   3.6500e-02 ...,   1.4914e+01 1.4928e+01 1.4943e+01]
y      = [  0.0000e+00   0.0000e+00   0.0000e+00 ...,   1.0437e+00 1.8533e-01 2.6468e+02]
yerr   = None
xerr   = [ 0.0073  0.0146  0.0146 ...,  0.0146  0.0146  0.0146]
xlabel = Energy (keV)
ylabel = chi2
title  = chi2 of source.pi
plot_prefs = {'symbolstyle': 0, 'linethickness': 3, 'linestyle': 1, 'linecolor': 'red'}

Example 2

sherpa> chi2_plot=get_chisqr_plot(3)

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

Example 3

sherpa> get_chisqr_plot().plot_prefs

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

sherpa> get_chisqr_plot().plot_prefs

    {'linecolor': 'red', 'linestyle': 1, 'linethickness': 3, 'symbolstyle': 0}
	sherpa> get_chisqr_plot().plot_prefs["linestyle"]=3
            

Bugs

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

See Also

confidence
get_conf, get_covar, get_int_proj, get_int_unc, get_proj, get_reg_proj, get_reg_unc
contrib
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
data
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
filtering
get_filter
fitting
calc_stat_info, get_fit, get_stat_info
info
get_default_id, list_stats
methods
get_draws, get_iter_method_name, get_iter_method_opt, get_method
modeling
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, normal_sample, t_sample, uniform_sample
plotting
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_lrt, 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
psfs
get_kernel, get_psf, plot_kernel
statistics
get_delchi_plot, get_prior, get_sampler, get_stat
utilities
get_analysis, get_rate
visualization
contour_resid, get_ratio, get_resid, image_getregion

Last modified: December 2013
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:   cxcweb@head.cfa.harvard.edu Smithsonian Institution, Copyright © 1998-2014. All rights reserved.