| gainfac | stsdas.hst_calib.hsp | gainfac |
gainfac -- Calculate analog gain factors.
gainfac intable outtable setting refhv
This task calculates gain factors for either high gain settings (0, 2, 3) or low gain settings (6, 7). All measurements used in this task must be obtained at the reference high voltage.
For high gain settings, the gain factor, at the observed temperature and epoch, is obtained directly from the ratio between simultaneously obtained analog and digital data. Hence, different rows in the input table can have different attributes and targets.
For low gain settings, the gain factor is calculated by comparing measurements made with two adjacent gain settings. Therefore, the input table must contain sequential "pairs" of rows. Within each pair of rows, the two observations must have the same target, same aperture (therefore same detector), and roughly the same epoch and temperature. The gain factor of the lower setting is then calculated from the ratio of these two (analog) measurements multiplied by the formerly determined gain factor of the higher setting.
Before actually performing the calculations, raw digital count rates must be corrected for the dead time, dark signal, pre-amp noise, and high voltage factor:
scaled digital count rate = (raw digital count rate /
(1. - raw digital count rate * dead time)
- dark signal - pre-amplifier noise) /
digital high voltage factor
Similarly,
scaled analog count rate = (raw analog DN - CVC offset -
gain factor * (dark signal + pre-amplifier noise))
/ analog high voltage factor
The maximum number of rows in the input table is 2,000.
'DETECTOB' Object detector ID (int). 'APERTOBJ' Aperture name (char*10). 'VOLTAGE' High voltage setting (real). 'VGAIND' Gain setting (real). 'THRESH' Discriminator threshold setting (real). 'DET_TEMP' Detector temperature (real). 'DEA_TEMP' DEA temperature (real). 'EPOCH' Epoch of observation (double). 'PTSRCFLG' Point source flag (char*1). 'TRGTNAME' Target name (char*20). For high gain settings, the input table should also have the following columns: 'DOBJ' Digital count rate (real). 'DOBJ_ERR' Mean error of digital count rate (real). 'AOBJ' Analog reading (real). 'AOBJ_ERR' Mean error of analog reading (real). For low settings, the table should have the following columns: 'AOBJ' Analog reading (real). 'AOBJ_ERR' Mean error of analog reading (real).
'DET_NUM' Detector ID (int). 'VGAIND' Gain setting (real). 'GAINFACT' Gain factor (real). 'GAINFACT_ERR' Gain factor's error (real). (temp_key) Temperature; the actual column name will be passed from the 'temp_key' parameter (real). 'EPOCH' Epoch of observation (double). 'VOLTAGE' High voltage setting (real). 'APER_NAME' Aperture name (char*10). 'TRGTNAME' Target name (char*20).
'DET_NUM' Detector ID (int). 'VOLTAGE' Reference high voltage setting (real).
1. Calculate gain factors from the input data table xgainfac$hiinput and put results in the output table ygainfac$output while saving the intermediate result in another local table whose name will be announced to the user. The input data were obtained with high gain settings. The reference high voltage table to be used is xvoltfac$refhv.
hs> gainfac "xgainfac$hiinput" "ygainfac$output" setting = "high"
refhv="xvoltfac$refhv" save=yes temp_key = "DEA_TEMP"