The mecalcgain task
calculates the time-dependent energy gain of the two fixed iron calibration
sources inside the SAX MECS1, MECS2 MECS3, and, in addition, monitors the
background count rate outside the detector's FOV. The program requires
raw event list files that comprises all calibration source events. The
computed quantities are stored as Bintable columns in new HK files
of type _hkg whose structure closely resembles the _hkp
type (see [2] for details).
Regarding the nominal flow of operations, three major steps can be
identified:
- Read a SAX/MECS raw events FITS file and select all events originating
from the two Fe calibration sources. This selection is performed with
the aid of two spatial windows whose position and size by default are
retrieved from calibration file, but can be also specified
via command line parameters (see below).
- Divide the total exposure time (= arrival time of last minus arrival
time of first photon) into N equal intervals and subsequently,
for each
interval center, accumulate a PHA spectrum over a time period T.
This step will generate for each calibration source a set of N
spectra (counts vs. PHA channel number) which will be used to define the
time-dependent gain g^j(t_i) := PHA_i^j/PHA_nom^j. g^j(t_i) should
designate the gain at time t_i (i=1,...,N) for calibration source #j,
PHA_i^j is the centroid of the Gaussian curve that has been fitted to
the accumulated spectrum #i for source #j, and PHA_nom^j is the nominal
peak position (in PHA channels) of the Fe line for source #j.
In case of poor statistics, i.e., if an accumulated spectrum is found to
contain less than 25 counts, mecalcgain will not attempt to perform a
Gaussian fit but set all gain related quantities (see below) to the
value INDEF.
- Create new HK FITS files with the name extension _hkg.fits.
The content of this file is identical to the HK file of type
hkp (created with meeng2phys)
that corresponds to the event input file except that 13 columns have
been added to the HK parameter extension. These are:
- PHA1, PHA2 - centroid of Gaussian fitted to PHA spectra
of calibration source #1/#2
- FWHM1, FWHM2 - Full-Width-Half-Maximum value of fitted
Gaussians for sources #1/#2
- CHISQ1, CHISQ2 - reduced Chi^2 values of Gaussian fits
- GAIN1, GAIN2 - gain values as defined above for
calibration sources #1 and #2
- GAIN12 - the ratio GAIN1/GAIN2
- GAIN_AVG - the average of GAIN1 and GAIN2
- CHISQAVG - reduced Chi^2 value corresponding to GAIN_AVG
- BCKGND1, BCKGND2 - the average background count rate
evaluated through event accumulation in two spatial windows outside the FOV.
The HK parameter table contains a HK record for each second, however, changes
in the energy gain will typically occur on timescales longer than 1s.
Thus, for the sake of efficiency the default time granularity for the
gain computation is set to a larger value Tg and filling-up the
new HK table columns is done by repeated usage of the respective
actual values. The effective value for Tg - in other words the
above number N of time intervals - can be specified through a
command line parameter granularity.
The primary output of mecalcgain, i.e., the gain related columns in
the newly created HK file will be used by the
meevelin
task to apply the temporal gain correction
to scientific event list data.