
.help calcbgdcor Aug1996 ftools.rosat
.ih
NAME
calcbgdcor --> calculates the background spectra for a given source region with
a given background region, away from source region. 
.ih
USAGE:
calcbgdcor srcfil bckfil arf_srcfil arf_bckfil particle_srcfil particle_bckfil
rmffil expmapfil regfil_sou regfil_bck outfil
.ih
DESCRIPTION:

The usual method for correcting a spectrum, from an imaging detector, for 
background is to extract a spectrum from another part of the image and
subtract that from the source spectrum.  This assumes that the source region
has the same background spectrum as the background region.  However, in
practice, instrument performance often varies across the face of the detector
either due to mirror vignetting or changes in detector efficiency.  
To deal with this correction, the Xray and non-Xray part of background
spectrum are separated.  Then corrections for vignetting, detector 
efficiency and the area scaling are applied to the Xray component.  
This is when added to the non-Xray component of the source gives the 
background spectra for the source.    
This is done using the results of the tasks PCPARPHA, PCARF, PCEXPMAP,
FIXREGION.  Now, CALCBGDCOR collects all this information and returns the
required corrected background spectra for the chosen source region.
CALCBGDCOR supports regions
POINT,  CIRCLE, ELLIPSE,  ANNULUS,  and BOX.   It  does not  support
POLYGON.  

.ih
WARNINGS ON USAGE:

Before  calling  CALCBGDCOR, one has to run FIXREGION to convert the
region files (source  region  and  background  region)  to  the 
appropriate coordinate  system, i.e.  the coordinate frame of the
exposure map.  So, after running PCEXPMAP one has to run  FIXREGION,
since CALCBGDCOR requires the corrected region files as inputs."

Also, before running this task user needs to set the environmental 
variable to CALDB. To do this, one needs to source the caldbinit.unix 
or caldbinit.vms or caldbinit_iraf.unix file depending on the system in use.

.ih
PARAMETERS:
.ls srcfil [character string]
The name of the input FITS file containing the source spectrum. 
.le
.ls bckfil [character string]
The name of the input FITS file containing the background spectrum.
.le
.ls arf_srcfil [character string]
The name of the ARF file for the source.
This is the output from PCARF. 
.le
.ls arf_bckfil [character string]
The name of the ARF file for the background.
This is the output from PCARF. 
.le
.ls particle_srcfil [character string]
The name of the file containing source particle spectrum.  
This is the output from PCPARPHA. 
.le
.ls particle_bckfil [character string]
The name of the file containing background particle spectrum.
This is the output from PCPARPHA. 
.le
.ls rmffil  [character string]
The name of the RMF file. By default, it is CALDB
.le
.ls expmapfil [character string]
The exposure map file.
This is the output from PCEXPMAP. 
.le
.ls regfil_sou [character string]
The converted region file for source
.le
.ls regfil_bck [character string]
The converted region file for background
.le
.ls outfil [character string]
The output file name to contain the background spectra
.le
.ls (chatter = 9) [integer]
Flag to set the chattyness at execution.  Default value is set to 9, 
which gives the user the task version and few warnings.  Lower/higher 
values produces quieter/verbose output on the screen.
.le
.ls (clobber = false) [boolean]
Flag specifying whether or not a pre-existing file with the same name as that
 requested as the output file from this task will be overwritten.
.le
.ih
BUGS:
None known 
.ih
SEE ALSO
.le
help on PCPARPHA, PCARF, PCEXPMAP, FIXREGION 
.ih
LOG OF SIGNIFICANT CHANGES:
.ls v1.0.0 (Aug, 1996)
created
.le
.ls v1.3.0 (Aug, 1999)
Added POINT, ELLIPSE, and ANNULUS to supported regions
.le
.ih
PRIMARY AUTHOR:
.nj
Banashree Mitra Seifert
.br
.nj
HEASARC, NASA/GSFC
.br
.nj
http://heasarc.gsfc.nasa.gov/cgi-bin/ftoolshelp
.br
.nj
(301).286.5307
.ju

.endhelp
