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/set_subtract.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 set_subtract Context: sherpa

Synopsis

Module functions to subtract background from a source dataset, or to undo subtraction.

Syntax

Integer_Type set_subtract([Integer_Type])
Integer_Type set_unsubtract([Integer_Type])

Success/Error Return Values: 1/0

Arguments:

(1) Dataset number (default 1)

Description

These functions return 1 if successful, and 0 if the (un)subtraction cannot be done (because, e.g., background already have been subtracted before a call to set_subtract).

See the related Sherpa commands SUBTRACT and UNSUBTRACT for more information.

Example

Subtract the background from dataset 1; then add it back in:

sherpa> DATA example.pha
The inferred file type is PHA.  If this is not what you want, please 
specify the type explicitly in the data command.
WARNING: using systematic errors specified in the PHA file.
RMF is being input from:
  <directory_path>/example2.rmf
ARF is being input from:
  <directory_path>/example2.arf
Background data are being input from:
  <directory_path>/example2_bkg.pha
sherpa> is_subtracted
0
sherpa> set_subtract
1
sherpa> is_subtracted(1)
1
sherpa> set_unsubtract()
1
sherpa> is_subtracted(1)
0

The 0 returned from the first call indicates that no, dataset 1 is not yet background subtracted. (Unlike XSPEC, Sherpa does not automatically subtract background data upon input.) The 1 returned from the third call, issued after the call to the set_subtract function, indicates that yes, dataset 1 is now background-subtracted. Similarly, the 0 returned from the last call to is_subtracted indicates that the call to set_unsubtract was successful.

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.