This task calculates the area of a source region used to make a spectral file. The area is written into the header of the SPECTRUM table of the file in the keyword BACKSCAL.
The final value is:
area = geometric_area - ccd_gaps - bad_pixels
In normal use only pixels which lie within the CCD boundaries and not on bad pixels contribute to the total area. The units of area are detector pixels which are square pixels of side 0.05 arcseconds.
If the parameter withbadpixcorr is set false then the pure geometric area will be calculated regardless of where the source region lies. If withbadpixcorr is true then pixels lying off the edges of all the CCDs will be subtracted from the total area. If withbadpixcorr is true and badpixlocation is set to a file containing bad pixel extensions (typically the input event file) then bad pixels lying within the source region area are also subtracted from the total area.