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

Jump to: Description · Example · Bugs · See Also

AHELP for CIAO 4.9 Sherpa v1


Context: statistics


List thawed Sherpa model parameters with associated priors.




The Sherpa prior functions constitute a subset of the pyBLoCXS suite of functions; pyBLoCXS is a sophisticated Markov chain Monte Carlo (MCMC) based algorithm designed to carry out Bayesian Low-Count X-ray Spectral (BLoCXS) analysis in the Sherpa environment. The algorithm explores parameter space at a suspected minimum using a predefined Sherpa model to high-energy X-ray spectral data.

By default, pyBLoCXS uses a flat prior defined between the hardcoded parameter minima and maxima. The list_priors() function may be used to return the list of all currently associated parameter-prior pairs, which have been set using the set_prior() function (see 'ahelp set_prior'). The get_prior() function accesses the name of the prior function ('prior') which has been assigned to a particular thawed fit parameter ('par').

Refer to the pyBLoCXS documentation for additional information about the algorithm.


print list_priors()

Call the list_priors() function with no arguments to return the dictionary of currently set prior functions for the set of thawed Sherpa model parameters.

sherpa> normgauss1d.g1
sherpa> xsapec.therm
sherpa> g1.pos=2.5; g1.fwhm=0.5
sherpa> set_prior(therm.kT,g1)

sherpa> def lognorm(x, sigma=0.5, norm=1.0, x0=20.):
   return (norm/numpy.sqrt(2*numpy.pi)/sigma)*numpy.exp(-0.5*(xl-x0)*(xl-x0)/sigma/sigma)

sherpa> set_prior(abs1.nH,lognorm)

sherpa> print list_priors()
{'therm.kT': <NormGauss1D model instance 'normgauss1d.g1'>, 'abs1.nH': <function lognorm at 0xc857230>}


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

See Also

list_functions, list_response_ids, list_stats
list_iter_methods, list_methods
list_model_components, list_models
cash, chi2constvar, chi2datavar, chi2gehrels, chi2modvar, chi2xspecvar, chisquare, cstat, get_prior, leastsq, list_samplers, set_prior, set_sampler, set_stat, wstat

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: Smithsonian Institution, Copyright © 1998-2017. All rights reserved.