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 2006

URL: http://cxc.harvard.edu/ciao3.4/back.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 back Context: sherpa

Synopsis

Inputs the contents of one or more background data files.

Syntax

sherpa> BACK [# [ID]] <filespec> [,[# [ID]] <filespec>,...]

where # specifies the number of the dataset to be associated with this
background data file (default dataset number is 1). The ID modifier is
used if and only if the Sherpa state object variable multiback is set
to 1, i.e., if more than one background dataset is to be associated
with a single source dataset. The ID modifier may be any unreserved
string (e.g., A, foo, etc.), i.e., a string that is not a parsable
command.

Description

Alternative means of reading in background datasets involve using the load functions of the Sherpa/S-Lang module (e.g., load_bpha).

The help file for the READ command explains the <filespec> definition and has a listing of allowed file types; see also the related commands BACKGROUND, BACKERRORS, and SETBACK.

A few things to note:

  • If the source data are read in after the background data are read in, the background data are deleted. Always read in the source data first!
  • To perform background subtraction in Sherpa, the command SUBTRACT must be issued; this is in contrast to XSPEC, which performs background subtraction automatically.
  • Input source and background datasets do not need to be the same size unless you wish to subtract the background. The SUBTRACT command may only be used when the input source and background datasets are the same size. (More specifically, for the case of PHA datasets, the source and background datasets must have the same size when ungrouped; if the input source dataset is grouped and the input background dataset is ungrouped, Sherpa will automatically group the background data before subtraction.)
  • In CIAO 3.1 the definition of INSTRUMENT BACK is required for both filtering and fitting of PHA data if either background file or background models have been defined. INSTRUMENT BACK is set automatically when the PHA source file is input to Sherpa, however it is deleted if the NEW background file is input for a given data set, thus the new INSTRUMENT BACK has to defined on the command line before filtering and fitting the data with the new background file.

Using Data Model Filters

This command is able to take any Data Model virtual file specification (see "ahelp dmsyntax"). If you can do

unix% dmcopy "infile.fits[spec 1][spec 2]" outfile.fits

you can also do

sherpa> back "infile.fits[spec 1][spec 2]"

This is especially useful when working with very large files. For example:

sherpa> back "evt.fits[bin sky=4][opt mem=100]"

bins the event file by a factor of four and allocates additional memory. A similar command (omitting the binning factor) can be used to read in an image.

Example 1

Input 2-D FITS image data and background files; subtract and unsubtract background data:

sherpa> DATA 3 example_img.fits FITS
sherpa> BACK 3 example_img_bkg.fits FITS
sherpa> SUBTRACT 3
sherpa> UNSUBTRACT 3

The first command, DATA 3 example_img.fits FITS, reads the FITS image example_img.fits, as dataset number 3. The second command reads the background FITS image for this dataset. The third command, SUBTRACT 3, performs the background subtraction for dataset number 3. The final command, UNSUBTRACT 3, restores dataset number 3 to its original unsubtracted state.

Example 2

Input IMH image data and background files, then subtract the background:

sherpa> DATA example.imh
sherpa> BACK example_bkg.imh
sherpa> SUBTRACT

The first two commands read in the image and background image, respectively, for dataset 1. SUBTRACT subtracts the background from the data.

Bugs

See the Sherpa bug pages online for an up-to-date listing of known bugs.

Hardcopy (PDF): A4 | Letter
Last modified: December 2006



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.