sherpa.astro.ui.get_energy_flux_hist(lo=None, hi=None, id=None, num=7500, bins=75, correlated=False, numcores=None, bkg_id=None, **kwargs)

Return the data displayed by plot_energy_flux.

The get_energy_flux_hist() function calculates a histogram of simulated energy flux values representing the energy flux probability distribution for a model component, accounting for the errors on the model parameters.

  • lo (number, optional) – The lower limit to use when summing up the signal. If not given then the lower value of the data grid is used.

  • hi (optional) – The upper limit to use when summing up the signal. If not guven then the upper value of the data grid is used.

  • id (int or string, optional) – The identifier of the data set to use. The default value (None) means that the default identifier, as returned by get_default_id, is used.

  • num (int, optional) – The number of samples to create. The default is 7500.

  • bins (int, optional) – The number of bins to use for the histogram.

  • correlated (bool, optional) – If True (the default is False) then scales is the full covariance matrix, otherwise it is just a 1D array containing the variances of the parameters (the diagonal elements of the covariance matrix).

  • numcores (optional) – The number of CPU cores to use. The default is to use all the cores on the machine.

  • bkg_id (int or string, optional) – The identifier of the background component to use. This should only be set when the line to be measured is in the background model.

  • scales (array, optional) – The scales used to define the normal distributions for the parameters. The form depends on the correlated parameter: when True, the array should be a symmetric positive semi-definite (N,N) array, otherwise a 1D array of length N, where N is the number of free parameters.

  • recalc (bool, optional) – If True, the default, then re-calculate the values rather than use the values from the last time the function was run.


hist – An object representing the data used to create the plot by plot_energy_flux.

Return type

a sherpa.astro.plot.EnergyFluxHistogram instance

See also


Return the data displayed by plot_photon_flux.


Display the energy flux distribution.


Display the photon flux distribution.


Return the energy flux distribution of a model.


Return the flux distribution of a model.


Return the photon flux distribution of a model.


Get the energy flux distribution for the range 0.5 to 7 for the default data set:

>>> ehist = get_energy_flux_hist(0.5, 7, num=1000)
>>> print(ehist)

Compare the 0.5 to 2 energy flux distribution from the “core” data set to the values from the “jet” data set:

>>> ehist1 = get_energy_flux_hist(0.5, 2, id='jet', num=1000)
>>> ehist2 = get_energy_flux_hist(0.5, 2, id='core', num=1000)