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

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


AHELP for CIAO 4.6 Sherpa v1

plot_photon_flux

Context: plotting

Synopsis

Plot the calculated photon flux distribution

Syntax

plot_photon_flux( [lo, hi], [id=1, num=7500, bins=75, correlated=False,
recalc=True, overplot=False,numcores] )

Description

The plot_photon_flux command plots the calculated photon flux distribution, which is the flux distribution for the model component accounting for the errors on the model parameters.

The sample_photon_flux() command can be used to return an array of flux values drawn from this distribution.

The plot_photon_flux command is parallelized to make use of multi-core systems (i.e., laptops or desktops with 2 or 4 cores) to provide significant improvements in efficiency compared to previous releases of Sherpa; the 'numcores' argument may be used to specify how the cores should be used when the command is run.

Function arguments

  • lo - lower photon bound; the default value of None means that the lower limit if the instrument model (ARF and RMF) should be used.
  • hi - upper photon bound; the default value of None means that the upper limit if the instrument model (ARF and RMF) should be used.
  • 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")
  • num - number of samples used in the distribution (the default value is 7500)
  • bins - number of bins used to bin the distribution into a histogram (bins=75 by default)
  • correlated - whether to use a multi- or uni-variate distribution to sample the parameter values. The default value of False means use a uni-variate distribution, whilst True means use a multi-variate distribution.
  • recalc - should the arrays be recomputed for the plot? The default value of True means that the plot values will be re-computed, otherwise the previously-plotted values will be re-used.
  • overplot - should the new plot be overlaid in the plotting window? If False, which is the default value, then the plot window will be cleared before creating the plot, otherwise the data will be added to the existing plot.
  • numcores - number of cores to use in parallelization; default is to use all cores available (2 or 4)

The plot is displayed in a ChIPS plotting window. If there is no plotting window open, one is created. If a plotting window exists, the overplot parameter value determines whether the new plot is overlaid on any existing plots in the window or if the window is cleared before the plot is drawn.

ChIPS commands may be used within Sherpa to modify plot characteristics and create hardcopies; refer to the ChIPS website for information.

Plotting Multiple Objects

To plot multiple Sherpa objects - e.g. data, model, fit, residuals - in a single window, use the plot command.

Example 1

sherpa> plot_photon_flux()

Plot the photon flux distribution for the default dataset.

Example 2

sherpa> plot_photon_flux(0.5, 7)

Plot the photon flux distribution for the default dataset, between 0.5 and 7.0 keV.

Example 3

sherpa> plot_photon_flux(id="src")
sherpa> plot_photon_flux(0.5, 7, id="src", overplot=True)
sherpa> set_histogram(["line.color", "blue"])

Plot the photon flux distribution the "src" dataset, using the full energy range, and then overplot the 0.5 to 7 keV distribution as the blue histogram.

Bugs

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

See Also

contrib
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_arf_plot, get_bkg_plot
modeling
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_pvalue, plot_ratio, plot_resid, plot_scatter, plot_source, plot_source_component, plot_trace, set_xlinear, set_xlog, set_ylinear, set_ylog
psfs
plot_kernel
statistics
get_chisqr_plot, get_delchi_plot
utilities
sample_energy_flux, sample_flux, sample_photon_flux
visualization
contour_resid

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.