The sherpa.ui module
The sherpa.ui module provides an interface to the
sherpa.ui.utils.Session
object, where a singleton class is used to provide the access but
hidden away. This needs better explanation…
Functions
add_model(modelclass[, args, kwargs])Create a user-defined model class.
add_user_pars(modelname, parnames[, ...])Add parameter information to a user model.
calc_chisqr([id])Calculate the per-bin chi-squared statistic.
calc_stat([id])Calculate the fit statistic for a data set.
Display the statistic values for the current models.
clean()Clear out the current Sherpa session.
conf(*args)Estimate parameter confidence intervals using the confidence method.
confidence(*args)Estimate parameter confidence intervals using the confidence method.
contour(*args, **kwargs)Create a contour plot for an image data set.
contour_data([id, replot, overcontour])Contour the values of an image data set.
contour_fit([id, replot, overcontour])Contour the fit to a data set.
contour_fit_resid([id, replot, overcontour])Contour the fit and the residuals to a data set.
contour_kernel([id, replot, overcontour])Contour the kernel applied to the model of an image data set.
contour_model([id, replot, overcontour])Create a contour plot of the model.
contour_psf([id, replot, overcontour])Contour the PSF applied to the model of an image data set.
contour_ratio([id, replot, overcontour])Contour the ratio of data to model.
contour_resid([id, replot, overcontour])Contour the residuals of the fit.
contour_source([id, replot, overcontour])Create a contour plot of the unconvolved spatial model.
copy_data(fromid, toid)Copy a data set, creating a new identifier.
covar(*args)Estimate parameter confidence intervals using the covariance method.
covariance(*args)Estimate parameter confidence intervals using the covariance method.
create_model_component([typename, name])Create a model component.
dataspace1d(start, stop[, step, numbins, ...])Create the independent axis for a 1D data set.
dataspace2d(dims[, id, dstype])Create the independent axis for a 2D data set.
delete_data([id])Delete a data set by identifier.
delete_model([id])Delete the model expression for a data set.
delete_model_component(name)Delete a model component.
delete_psf([id])Delete the PSF model for a data set.
fake([id, method])Simulate a data set.
fit([id])Fit a model to one or more data sets.
freeze(*args)Fix model parameters so they are not changed by a fit.
Return the data used to plot the last CDF.
get_chisqr_plot([id, recalc])Return the data used by plot_chisqr.
get_conf()Return the confidence-interval estimation object.
get_conf_opt([name])Return one or all of the options for the confidence interval method.
Return the results of the last
confrun.Return the results of the last
confrun.
get_contour_prefs(contourtype[, id])Return the preferences for the given contour type.
Return the covariance estimation object.
get_covar_opt([name])Return one or all of the options for the covariance method.
Return the results of the last
covarrun.Return the results of the last
covarrun.
get_data([id])Return the data set by identifier.
get_data_contour([id, recalc])Return the data used by contour_data.
Return the preferences for contour_data.
get_data_image([id])Return the data used by image_data.
get_data_plot([id, recalc])Return the data used by plot_data.
get_data_plot_prefs([id])Return the preferences for plot_data.
Return the default data set identifier.
get_delchi_plot([id, recalc])Return the data used by plot_delchi.
get_dep([id, filter])Return the dependent axis of a data set.
get_dims([id, filter])Return the dimensions of the data set.
get_draws([id, otherids, niter, covar_matrix])Run the pyBLoCXS MCMC algorithm.
get_error([id, filter])Return the errors on the dependent axis of a data set.
get_filter([id, format, delim])Return the filter expression for a data set.
get_fit_contour([id, recalc])Return the data used by contour_fit.
get_fit_plot([id, recalc])Return the data used to create the fit plot.
Return the results of the last fit.
Return the functions provided by Sherpa.
get_indep([id])Return the independent axes of a data set.
get_int_proj([par, id, otherids, recalc, ...])Return the interval-projection object.
get_int_unc([par, id, otherids, recalc, ...])Return the interval-uncertainty object.
Return the name of the iterative fitting scheme.
get_iter_method_opt([optname])Return one or all options for the iterative-fitting scheme.
get_kernel_contour([id, recalc])Return the data used by contour_kernel.
get_kernel_image([id])Return the data used by image_kernel.
get_kernel_plot([id, recalc])Return the data used by plot_kernel.
get_method([name])Return an optimization method.
Return the name of current Sherpa optimization method.
get_method_opt([optname])Return one or all of the options for the current optimization method.
get_model([id])Return the model expression for a data set.
Return the method used to create model component identifiers.
get_model_component(name)Returns a model component given its name.
get_model_component_image(id[, model])Return the data used by image_model_component.
get_model_component_plot(id[, model, recalc])Return the data used to create the model-component plot.
Return the data used by plot_model_components.
get_model_contour([id, recalc])Return the data used by contour_model.
Return the preferences for contour_model.
get_model_image([id])Return the data used by image_model.
get_model_pars(model)Return the names of the parameters of a model.
get_model_plot([id, recalc])Return the data used to create the model plot.
get_model_plot_prefs([id])Return the preferences for plot_model.
get_model_type(model)Describe a model expression.
get_num_par([id])Return the number of parameters in a model expression.
get_num_par_frozen([id])Return the number of frozen parameters in a model expression.
get_num_par_thawed([id])Return the number of thawed parameters in a model expression.
get_par(par)Return a parameter of a model component.
Return the data used to plot the last PDF.
get_plot_prefs(plottype[, id])Return the preferences for the given plot type.
get_prior(par)Return the prior function for a parameter (MCMC).
get_proj()Return the confidence-interval estimation object.
get_proj_opt([name])Return one or all of the options for the confidence interval method.
Return the results of the last
projrun.Return the results of the last
projrun.
get_psf([id])Return the PSF model defined for a data set.
get_psf_contour([id, recalc])Return the data used by contour_psf.
get_psf_image([id])Return the data used by image_psf.
get_psf_plot([id, recalc])Return the data used by plot_psf.
get_pvalue_plot([null_model, alt_model, ...])Return the data used by plot_pvalue.
Return the data calculated by the last plot_pvalue call.
get_ratio_contour([id, recalc])Return the data used by contour_ratio.
get_ratio_image([id])Return the data used by image_ratio.
get_ratio_plot([id, recalc])Return the data used by plot_ratio.
get_reg_proj([par0, par1, id, otherids, ...])Return the region-projection object.
get_reg_unc([par0, par1, id, otherids, ...])Return the region-uncertainty object.
get_resid_contour([id, recalc])Return the data used by contour_resid.
get_resid_image([id])Return the data used by image_resid.
get_resid_plot([id, recalc])Return the data used by plot_resid.
get_rng()Return the RNG generator in use.
Return the current MCMC sampler options.
Return the name of the current MCMC sampler.
get_sampler_opt(opt)Return an option of the current MCMC sampler.
Return the data used to plot the last scatter plot.
get_source([id])Return the source model expression for a data set.
get_source_component_image(id[, model])Return the data used by image_source_component.
get_source_component_plot(id[, model, recalc])Return the data used by plot_source_component.
Return the data used by plot_source_components.
get_source_contour([id, recalc])Return the data used by contour_source.
get_source_image([id])Return the data used by image_source.
get_source_plot([id, recalc])Return the data used to create the source plot.
Return the plot attributes for displays with multiple plots.
get_stat([name])Return the fit statisic.
Return the statistic values for the current models.
Return the name of the current fit statistic.
get_staterror([id, filter])Return the statistical error on the dependent axis of a data set.
get_syserror([id, filter])Return the systematic error on the dependent axis of a data set.
Return the data used to plot the last trace.
guess([id, model, limits, values])Estimate the parameter values and ranges given the loaded data.
ignore([lo, hi])Exclude data from the fit.
ignore_id(ids[, lo, hi])Exclude data from the fit for a data set.
Close the image viewer.
image_data([id, newframe, tile])Display a data set in the image viewer.
Delete all the frames open in the image viewer.
image_fit([id, newframe, tile, deleteframes])Display the data, model, and residuals for a data set in the image viewer.
image_getregion([coord])Return the region defined in the image viewer.
image_kernel([id, newframe, tile])Display the 2D kernel for a data set in the image viewer.
image_model([id, newframe, tile])Display the model for a data set in the image viewer.
image_model_component(id[, model, newframe, ...])Display a component of the model in the image viewer.
Start the image viewer.
image_psf([id, newframe, tile])Display the 2D PSF model for a data set in the image viewer.
image_ratio([id, newframe, tile])Display the ratio (data/model) for a data set in the image viewer.
image_resid([id, newframe, tile])Display the residuals (data - model) for a data set in the image viewer.
image_setregion(reg[, coord])Set the region to display in the image viewer.
image_source([id, newframe, tile])Display the source expression for a data set in the image viewer.
image_source_component(id[, model, ...])Display a component of the source expression in the image viewer.
image_xpaget(arg)Return the result of an XPA call to the image viewer.
image_xpaset(arg[, data])Return the result of an XPA call to the image viewer.
int_proj(par[, id, otherids, replot, fast, ...])Calculate and plot the fit statistic versus fit parameter value.
int_unc(par[, id, otherids, replot, min, ...])Calculate and plot the fit statistic versus fit parameter value.
link(par, val)Link a parameter to a value.
List the identifiers for the loaded data sets.
list_functions([outfile, clobber])Display the functions provided by Sherpa.
List the iterative fitting schemes.
List the optimization methods.
List the names of all the model components.
List of all the data sets with a source expression.
list_models([show])List the available model types.
Return the priors set for model parameters, if any.
List of all the data sets with a PSF.
List the MCMC samplers.
List the fit statistics.
load_arrays(id, *args)Create a data set from array values.
load_conv(modelname, filename_or_model, ...)Load a 1D convolution model.
load_data(id[, filename, ncols, colkeys, ...])Load a data set from an ASCII file.
load_filter(id[, filename, ignore, ncols])Load the filter array from an ASCII file and add to a data set.
load_psf(modelname, filename_or_model, ...)Create a PSF model.
load_staterror(id[, filename, ncols])Load the statistical errors from an ASCII file.
load_syserror(id[, filename, ncols])Load the systematic errors from an ASCII file.
load_table_model(modelname, filename[, ...])Load ASCII tabular data and use it as a model component.
load_template_interpolator(name, ...)Set the template interpolation scheme.
load_template_model(modelname, templatefile)Load a set of templates and use it as a model component.
load_user_model(func, modelname[, filename, ...])Create a user-defined model.
load_user_stat(statname, calc_stat_func[, ...])Create a user-defined statistic.
normal_sample([num, sigma, correlate, id, ...])Sample the fit statistic by taking the parameter values from a normal distribution.
notice([lo, hi])Include data in the fit.
notice_id(ids[, lo, hi])Include data from the fit for a data set.
paramprompt([val])Should the user be asked for the parameter values when creating a model?
plot(*args, **kwargs)Create one or more plot types.
plot_cdf(points[, name, xlabel, replot, ...])Plot the cumulative density function of an array of values.
plot_chisqr([id, replot, overplot, clearwindow])Plot the chi-squared value for each point in a data set.
plot_data([id, replot, overplot, clearwindow])Plot the data values.
plot_delchi([id, replot, overplot, clearwindow])Plot the ratio of residuals to error for a data set.
plot_fit([id, replot, overplot, clearwindow])Plot the fit results (data, model) for a data set.
plot_fit_delchi([id, replot, overplot, ...])Plot the fit results, and the residuals, for a data set.
plot_fit_ratio([id, replot, overplot, ...])Plot the fit results, and the ratio of data to model, for a data set.
plot_fit_resid([id, replot, overplot, ...])Plot the fit results, and the residuals, for a data set.
plot_kernel([id, replot, overplot, clearwindow])Plot the 1D kernel applied to a data set.
plot_model([id, replot, overplot, clearwindow])Plot the model for a data set.
plot_model_component(id[, model, replot, ...])Plot a component of the model for a data set.
plot_model_components([id, overplot, ...])Plot all the components of a model.
plot_pdf(points[, name, xlabel, bins, ...])Plot the probability density function of an array of values.
plot_psf([id, replot, overplot, clearwindow])Plot the 1D PSF model applied to a data set.
plot_pvalue(null_model, alt_model[, ...])Compute and plot a histogram of likelihood ratios by simulating data.
plot_ratio([id, replot, overplot, clearwindow])Plot the ratio of data to model for a data set.
plot_resid([id, replot, overplot, clearwindow])Plot the residuals (data - model) for a data set.
plot_scatter(x, y[, name, xlabel, ylabel, ...])Create a scatter plot.
plot_source([id, replot, overplot, clearwindow])Plot the source expression for a data set.
plot_source_component(id[, model, replot, ...])Plot a component of the source expression for a data set.
plot_source_components([id, overplot, ...])Plot all the components of a source.
plot_trace(points[, name, xlabel, replot, ...])Create a trace plot of row number versus value.
proj(*args)Estimate parameter confidence intervals using the projection method.
projection(*args)Estimate parameter confidence intervals using the projection method.
reg_proj(par0, par1[, id, otherids, replot, ...])Plot the statistic value as two parameters are varied.
reg_unc(par0, par1[, id, otherids, replot, ...])Plot the statistic value as two parameters are varied.
reset([model, id])Reset the model parameters to their default settings.
restore([filename])Load in a Sherpa session from a file.
save([filename, clobber])Save the current Sherpa session to a file.
save_arrays(filename, args[, fields, ...])Write a list of arrays to an ASCII file.
save_data(id[, filename, fields, sep, ...])Save the data to a file.
save_delchi(id[, filename, clobber, sep, ...])Save the ratio of residuals (data-model) to error to a file.
save_error(id[, filename, clobber, sep, ...])Save the errors to a file.
save_filter(id[, filename, clobber, sep, ...])Save the filter array to a file.
save_model(id[, filename, clobber, sep, ...])Save the model values to a file.
save_resid(id[, filename, clobber, sep, ...])Save the residuals (data-model) to a file.
save_source(id[, filename, clobber, sep, ...])Save the model values to a file.
save_staterror(id[, filename, clobber, sep, ...])Save the statistical errors to a file.
save_syserror(id[, filename, clobber, sep, ...])Save the statistical errors to a file.
set_conf_opt(name, val)Set an option for the confidence interval method.
set_covar_opt(name, val)Set an option for the covariance method.
set_data(id[, data])Set a data set.
set_default_id(id)Set the default data set identifier.
set_dep(id[, val])Set the dependent axis of a data set.
set_filter(id[, val, ignore])Set the filter array of a data set.
set_full_model(id[, model])Define the convolved model expression for a data set.
set_iter_method(meth)Set the iterative-fitting scheme used in the fit.
set_iter_method_opt(optname, val)Set an option for the iterative-fitting scheme.
set_method(meth)Set the optimization method.
set_method_opt(optname, val)Set an option for the current optimization method.
set_model(id[, model])Set the source model expression for a data set.
set_model_autoassign_func([func])Set the method used to create model component identifiers.
set_par(par[, val, min, max, frozen])Set the value, limits, or behavior of a model parameter.
set_plot_backend(backend)Change the plot backend.
set_prior(par, prior)Set the prior function to use with a parameter.
set_proj_opt(name, val)Set an option for the projection method.
set_psf(id[, psf])Add a PSF model to a data set.
set_rng(rng)Set the RNG generator.
set_sampler(sampler)Set the MCMC sampler.
set_sampler_opt(opt, value)Set an option for the current MCMC sampler.
set_source(id[, model])Set the source model expression for a data set.
set_stat(stat)Set the statistical method.
set_staterror(id[, val, fractional])Set the statistical errors on the dependent axis of a data set.
set_syserror(id[, val, fractional])Set the systematic errors on the dependent axis of a data set.
set_xlinear([plottype])New plots will display a linear X axis.
set_xlog([plottype])New plots will display a logarithmically-scaled X axis.
set_ylinear([plottype])New plots will display a linear Y axis.
set_ylog([plottype])New plots will display a logarithmically-scaled Y axis.
show_all([id, outfile, clobber])Report the current state of the Sherpa session.
show_conf([outfile, clobber])Display the results of the last conf evaluation.
show_covar([outfile, clobber])Display the results of the last covar evaluation.
show_data([id, outfile, clobber])Summarize the available data sets.
show_filter([id, outfile, clobber])Show any filters applied to a data set.
show_fit([outfile, clobber])Summarize the fit results.
show_kernel([id, outfile, clobber])Display any kernel applied to a data set.
show_method([outfile, clobber])Display the current optimization method and options.
show_model([id, outfile, clobber])Display the model expression used to fit a data set.
show_proj([outfile, clobber])Display the results of the last proj evaluation.
show_psf([id, outfile, clobber])Display any PSF model applied to a data set.
show_source([id, outfile, clobber])Display the source model expression for a data set.
show_stat([outfile, clobber])Display the current fit statistic.
simulfit([id])Fit a model to one or more data sets.
t_sample([num, dof, id, otherids, numcores])Sample the fit statistic by taking the parameter values from a Student's t-distribution.
thaw(*args)Allow model parameters to be varied during a fit.
uniform_sample([num, factor, id, otherids, ...])Sample the fit statistic by taking the parameter values from an uniform distribution.
unlink(par)Unlink a parameter value.
unpack_arrays(*args)Create a sherpa data object from arrays of data.
unpack_data(filename[, ncols, colkeys, ...])Create a sherpa data object from an ASCII file.