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

Jump to: Description · Examples · See Also

AHELP for CIAO 4.3 Sherpa v1


Context: info


Display the background convolved model


show_bkg_model([id=None, bkg_id=None, outfile=None, clobber=False] )


The show_bkg_model() function displays the details of the convolved source models assigned to PHA background data sets which have been loaded into Sherpa, by data set ID. For each model, the equation defining the model convolution, with ARF and RMF instrument responses, is shown, along with the current parameter values (including minimum and maximum values), 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 Model: 1:1
apply_rmf(apply_arf((38564.6089269 * const1d.c1)))
   Param        Type          Value          Min          Max      Units
   -----        ----          -----          ---          ---      -----
   c1.c0        thawed            1            0  3.40282e+38           

Background Model: 2:1
apply_rmf(apply_arf((38564.6089269 * 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_model() - 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_model()

The function show_bkg_model() can be called with no arguments, in which case the details of all convolved background models assigned to background data sets will be displayed.

Example 2

sherpa> show_bkg_model(2, 1)

The data set id arguments are used to specify that the convolved 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 convolved background models associated with data set 2 would be returned.

Example 3

sherpa> show_bkg_model(2, "con_model.bkg", True)

Here, the outfile argument is used to save the convolved model information for all background data sets loaded with source data set 2 in the file 'con_model.bkg'. This file will be overwritten if it already exists in the current working directory, since 'clobber' is set to True.

See Also

get_bkg, get_bkg_plot, set_bkg, subtract, unsubtract
list_bkg_ids, list_functions, list_model_ids, show_all, show_bkg_source, show_conf, show_covar, show_data, show_fit, show_method, show_model, show_proj, show_source, show_stat
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, link, load_table_model, load_user_model, 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
plot_bkg, plot_model, plot_model_component, plot_source, plot_source_component
delete_psf, load_conv
save_delchi, save_resid
calc_chisqr, calc_energy_flux, calc_model_sum, calc_photon_flux, calc_source_sum, calc_stat, eqwidth
contour_model, contour_ratio, contour_resid, get_ratio, get_resid

Last modified: December 2010
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-2019. All rights reserved.