About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2008

URL: http://cxc.harvard.edu/sherpa4.1/load_bkg.sl.html
AHELP for Sherpa 4.1

load_bkg

Context: sl.sherpa

Synopsis

Load a PHA background spectrum

Syntax

load_bkg( [id], filename|PHACrate; [use_errors=0], [bkg_id=NULL] );

Description

The load_bkg command loads a PHA background spectrum from a FITS file or a PHACrate and assigns it to a source id. The background dataset if its source id is reassigned to a new dataset.

  • id - the id of the dataset to use; if not given, uses the default dataset id (id=1 by default, see "ahelp get_default_id")
  • filename|PHACrate - the name of the file (with path) or PHACrate which contains the PHA data
  • use_errors - read the statistical errors from the PHA file? default=0
  • bkg_id - the id of the background, if the response is a background response; default=NULL

If the input PHA file contains grouping information, the data are automatically grouped. Sherpa also reads any quality information, allowing the user to filter out bad channels.

Loading Background Responses

If the header keywords of the PHA file contain ARF and RMF information, the files are automatically read in and assigned as the background responses. Background response files may also be loaded manually with the load_bkg_arf ("ahelp load_bkg_arf") and load_bkg_rmf ("ahelp load_bkg_rmf") commands.

Example 1

sherpa> load_bkg("back.pha");

A background spectrum is loaded from the file back.pha and assigned to the default dataset.

Example 2

sherpa> load_bkg("src", "3c273_bkg.pi"; use_errors=1, bkg_id="bkg");

Read the background spectrum from 3c273_bkg.pi, give it the id "bkg", and assign it to the dataset "src". The errors are read from the file as well.

Example 3

sherpa> backcr = read_pha("back.pi");
sherpa> load_bkg(backcr);

The background PHA file is read into a PHACrate (named "backcr") from back.pi. The background is then loaded into Sherpa from the crate, using the default options.

Bugs

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

Last modified: December 2008



The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.