STScI Logo

analoglin stsdas.hst_calib.hsp



analoglin -- Calibrate HSP analog linearity.


analoglin intable outtable ref_flux


This task calculates analog linearity for up to 2,000 targets. The analog linearity is calculated by fitting a straight line between observed analog measurements (corrected for current to voltage converter (CVC) offset, dark signal, gain factor, high voltage factor, pre-amp noise, and relative sensitivity--see below) of standard targets and the corresponding known flux densities (integrated over the specified filter's bandpass, and weighted by the filter's transmission curve). This routine also checks the instrument mode of each observation. If it has a simultaneous sky measurement, the sky (which is also corrected for dark signal, etc.) is subtracted from the target measurement, otherwise the observed count rate is not changed.

The raw, analog digital numbers (DN) are corrected for CVC offset, dark, pre-amp noise, high voltage factor, sensitivity, and gain factor, according to the following formula:

        scaled analog count rate = ((raw digital count rate -
            CVC offset) / gain factor - pre-amplifier noise -
            dark signal) / (high voltage factor * relative sensitivity)

A least squares scheme is used to perform the straight line fitting, and the linearity can be evaluated from chi-squared. Graphics tasks in STSDAS can also be used to display raw data and the straight line on terminal screen to determine the goodness of analog linearity.


intable [file name]
Name of input table. The following columns are needed:

'DETECTOB'      Object detector ID (int).
'APERTOBJ'      Object aperture name (char*10).
'VOLTAGE'       High voltage setting (real).
'VGAIND'        Gain setting (real).
'THRESH'        Discriminator setting (real).
'DET_TEMP'      Detector temperature (real).
'DEA_TEMP'      DEA temperature (real).
'EPOCH'         Epoch of observation (double).
'PTSRCFLG'      Point source flag (char*1).

We also need the following columns:

'AOBJ'          Observed analog DN (real).
'AOBJ_ERR'      Error of the observed analog DN (real).
'ASKY'          Sky's analog DN (real).
'MODE'          Instrument mode (i.e., SCP, SSP, or ARS) (char*3).
'TRGTNAME'      Target name (char*20).
outtable [file name]
Name of the output table, which consists of the following columns:

'A0', 'A1',     The two coefficients of the fitting straight
                line, i.e. observed analog count rate =
                A0 + A1 * known flux (real).
'CHISQ'         Chi-squared per degree of freedom of the
                polynomial fit (real).
'WEIGHT'        Weighting flag of the analog count rate (real).
'FLUXMIN'       Lower limit of the flux range (real).
'FLUXMAX'       Upper limit of the flux range (real).
'EPOCHMIN'      Minimum value of epoch (double).
'EPOCHMAX'      Maximum value of epoch (double).
'EPOCHAVE'      Average value of epoch (double).
'NPOINTS'       Number of input data points (int).
ref_flux [file name]
Reference flux density table name. It has the following columns:

'OBJ_NAME_i'    Name(s) of the object, where "i" is an integer 
		between 1 and 5 (char*20).
'FILTER_NAME'   Filter name, e.g., F551 (char*4).
'DET_NUM'       Detector ID (int).
'FLUX'          Flux density (integrated over the filter's
                bandpass) of the target; density should be in
                units of erg/sec/sq cm (real).
(cal_tables = "") [string]
Pset name for calibration file parameters. Parameters can be individually changed from the command line or can be edited as a group using :e from eparam or from the cl, eparam cal_tables or simply cal_tables. Details about these parameters are available by typing "help cal_tables".
(save = no) [boolean]
Save scratch tables containing intermediate calibration corrections? If save = yes, a message will be sent to the terminal and the logfile. When this flag is set to "yes", consecutive executions of this task should be avoided because one of the scratch table will accumulate input data and therefore may produce incorrect results.
(temp_key = "DET_TEMP") [string]
Column name of the temperature in the output table.


1. Calculate analog linearity from the input data table xanaloglin$input and put results in the output table yanaloglin$output while saving the intermediate result in another local table whose name will be announced to the user. The reference flux density table to be used is xabssenv$ref_flux.

hs> analoglin "xanaloglin$input" "yanaloglin$output" "xabssenv$ref_flux" 




Source Code · Package Help · Search Form · STSDAS