| AHELP for CIAO 4.5 Sherpa v1 | show_bkg_source |
Context: info |
Synopsis
Display the background unconvolved model
Syntax
show_bkg_source([id=None, bkg_id=None, outfile=None, clobber=False] )
Description
The show_bkg_source() function displays the details of the unconvolved source models assigned to PHA background data sets which have been loaded into Sherpa, by data set ID. For each model, the current parameter values are returned (including minimum and maximum values), along with parameter type (thawed or frozen) and units. This information can be saved in a text file by specifying a filename in the 'outfile' argument.
- id - the id of the source data set to use; default is to show information for all available data sets.
- bkg_id - the id of the background data set to use (e.g., bkg_id=1 represents the first background data set loaded in association with the source data set specified in the 'id' argument); default is bkg_id=1 for id=1.
- outfile - name of the file to which to save the output of the function
- clobber - a Boolean switch which indicates whether or not the 'outfile' should be overwritten, if the file already exists; default=False
The command output looks like:
Background Source: 1:1 const1d.c1 Param Type Value Min Max Units ----- ---- ----- --- --- ----- c1.c0 thawed 1 0 3.40282e+38 Background Source: 2:1 const1d.c2 Param Type Value Min Max Units ----- ---- ----- --- --- ----- c2.c0 thawed 1 0 3.40282e+38
The behavior of the screen output is determined by the user's $PAGER environment variable setting, which is usually a variant of "more." If PAGER is not found, '/usr/bin/more' is attempted before error. To disable paging within show_bkg_source() - i.e. print the entire contents, even if it scrolls offscreen - change this setting to "cat" before starting Sherpa:
unix% setenv PAGER cat unix% sherpa
Example 1
sherpa> show_bkg_source()
The function show_bkg_source() can be called with no arguments, in which case the details of all unconvolved background models assigned to background data sets will be displayed.
Example 2
sherpa> show_bkg_source(2, 1)
The data set id arguments are used to specify that the unconvolved model assigned to the first background data set loaded in association with source data set 2 should be displayed (id=2, bkg_id=1). If only the source data set id "2" had been entered, without specifying a background id, all unconvolved background models associated with data set 2 would be returned.
Example 3
sherpa> show_bkg_source(2, "unc_model.bkg", True)
Here, the outfile argument is used to save the unconvolved model information for all background data sets loaded with source data set 2 in the file 'unc_model.bkg'. This file will be overwritten if it already exists in the current working directory, since 'clobber' is set to True.
See Also
- data
- get_bkg, get_bkg_plot, set_bkg, subtract, unsubtract
- filtering
- show_filter
- info
- list_bkg_ids, list_functions, list_model_ids, show_all, show_bkg_model, show_conf, show_covar, show_data, show_fit, show_method, show_model, show_proj, show_source, show_stat
- modeling
- add_model, add_user_pars, clean, create_model_component, delete_bkg_model, delete_model, delete_model_component, get_model, get_model_autoassign_func, 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_source, get_source_component_image, get_source_component_plot, image_model, image_model_component, image_source, image_source_component, integrate, integrate1d, link, load_table_model, load_template_model, load_user_model, normal_sample, reset, save_model, save_source, set_bkg_model, set_full_model, set_model_autoassign_func, set_pileup_model, set_source, set_xsabund, set_xscosmo, set_xsxsect, set_xsxset, t_sample, uniform_sample
- plotting
- get_lrt_plot, get_lrt_results, get_pvalue_plot, get_pvalue_results, plot_bkg, plot_cdf, plot_lrt, plot_model, plot_model_component, plot_pdf, plot_pvalue, plot_scatter, plot_source, plot_source_component, plot_trace
- psfs
- delete_psf, load_conv
- saving
- save_delchi, save_resid
- utilities
- calc_chisqr, calc_energy_flux, calc_model_sum, calc_photon_flux, calc_source_sum, calc_stat, eqwidth
- visualization
- contour_model, contour_ratio, contour_resid, get_ratio, get_resid

![[Sherpa Logo]](../imgs/sherpa_logo_navbar.gif)