| 
 
Performs background subtraction.
 
sherpa> SUBTRACT [<dataset range> | ALLSETS]
where <dataset range> = #, or more generally #:#,#:#,..., such that #
specifies a dataset number, and #:# represents an inclusive range of
datasets; one may specify multiple inclusive ranges by separating them
with commas. The default dataset is dataset 1. 
The SUBTRACT performs background subtraction 
on a channel-by-channel basis:
 S'(i) = S(i) - ((beta_S * t_S) / (beta_B * t_B )) * B(i) ,
where 
S(i)
is the source datum in bin 
i,
B(i)
is the background datum in bin 
i,
t_S and t_B are the
source and background exposure times respectively, and
beta_S and beta_B
are the source and background ``backscales"
(i.e.,
the value of the BACKSCAL header keyword value in a PHA file)
respectively.
BACKSCAL is typically
defined as the ratio of data extraction area to total detector area.
This equation is easily generalized if there are multiple background
datasets per source dataset.
 
The SUBTRACT command may only be used when:
 
the input source and background datasets are of the same size; or
the source dataset is grouped and the background dataset is ungrouped;
Sherpa will automatically group the background dataset 
to match the source dataset before doing the subtraction.
 
Unless the user specifies errors for the background-subtracted data,
the errors are computed automatically by propagating the errors for
source and background data.
 
To undo background subtraction, use the command 
UNSUBTRACT.
 
Alternative means of subtracting and
unsubtracting involve using the
Sherpa/S-Lang module functions 
set_subtract and
set_unsubtract.
 
Note that while XSPEC automatically performs background
subtraction, in Sherpa one must directly issue
the command SUBTRACT.
 
Read in source and background data, then subtract.
 
sherpa> DATA example2.pha
...
Background data are being input from:
  <directory_path>/example2_bkg.pha
sherpa> PLOTY COUNTS
sherpa> WRITE DATA
Write X-Axis: Energy (keV)  Y-Axis: Flux (Counts)
...
     0.4286         13
     0.4573         15
     0.5002         25
     0.5575         21
...
sherpa> SUBTRACT
Write X-Axis: Energy (keV)  Y-Axis: Flux (Counts)
...
     0.4286     5.2974
     0.4573     6.9893
     0.5002    10.8273
     0.5575     6.2111
...
sherpa> UNSUBTRACT
Write X-Axis: Energy (keV)  Y-Axis: Flux (Counts)
...
     0.4286         13
     0.4573         15
     0.5002         25
     0.5575         21
...
 
chandra
guide
sherpa
autoest,
back,
berrors,
bsyserrors,
coord,
data,
dataspace,
fakeit,
feffile,
group,
guess,
is_subtracted,
load,
load_arf,
load_ascii,
load_back_from,
load_backset,
load_dataset,
load_fitsbin,
load_image,
load_inst,
load_inst_from,
load_pha,
load_pha2,
load_rmf,
read,
set_analysis,
set_axes,
set_backscale,
set_coord,
set_data,
set_exptime,
set_subtract,
set_weights,
setback,
setdata,
ungroup,
unsubtract,
use
 |