SUBROUTINE VDKEVL ( * * inputs: * : OBSID, DET, APERT, HV, TYPE, TEMP, EPOCH, : APERT0, HV0, TYPE0, BASE0, COEFF0, TEMP0, : EPOCH0, NROWS, : APNAME, DKDET, DKNAME, NDKAP, * * outputs: * : CORR, STATUS) * * Module Number: * * Module Name: CALHSP * * Keyphrase: * ---------- * Calculate dark signal corrections * * Description: * ------------ * Evaluate the 16 polynomial coefficients for dark signal * * FORTRAN Name: VDKEVL.FOR * * Keywords of Accessed Files and Tables: * -------------------------------------- * Name I/O Description / Comments * * Subroutines Called: * ------------------- * CDBS: * CDPVAL * SDAS: * UUITOC, UMSPUT * OTHERS: * None * * History: * -------- * Version Date Author Description * 1 08-01-88 J.-C. Hsu Design and coding * 2 07-20-89 J.-C. Hsu add detector ID in dark aperture *------------------------------------------------------------------------------- * *== inputs: * --number of rows of the calibration table INTEGER NROWS, * --detector ID of input data : DET, * --detector ID in the dark aperture table : DKDET(1), * --number of rows in dark aperture * --translation table : NDKAP * --observation ID CHARACTER*(*) OBSID, * --aperture ID of input data : APERT, * --aperture names and dark aperture names * --in the dark aperture translation table : APNAME(1), DKNAME(1), * --aperture names in the calibration table : APERT0(1), * --data type of input data : TYPE, * --data types in the calibration table : TYPE0(1) * --high voltage setting of input data REAL HV, * --high voltage settings in the calibration * --table : HV0(1), * --base values in the calibration table : BASE0(1), * --polynominal coefficients of calibration : COEFF0(16, 1), * --temperature of input data : TEMP, * --zero points of temperature in the * --calibration table : TEMP0(1) * --epoch of input data DOUBLE PRECISION EPOCH, * --zero points of epoch in the * --calibration table : EPOCH0(1) * *==outputs: * --final calibration correction REAL CORR * --error status INTEGER STATUS * *==local: * --loop indices INTEGER I, K, * --error status : STATOK * --buffer coefficients REAL COEFF(4, 4) CHARACTER*1 CHAR1 CHARACTER*5 CHAR5 * --dark aperture name corresponding to * --the aperture of the input data CHARACTER*10 DKAP * --error message context CHARACTER*130 CONTXT, MESS *=========================begin hsp.inc========================================= * --status return code INTEGER OK, ERRNUM(20) INTEGER DEST, PRIO DATA OK /0/ DATA ERRNUM /701, 702, 703, 704, 705, 706, 707, 708, 709, 710, : 711, 712, 713, 714, 715, 716, 717, 718, 719, 720/ * --message destination and priority DATA DEST, PRIO /1, 0/ *=========================end hsp.inc=========================================== *------------------------------------------------------------------------------- * * translate regular aperture name to "dark" aperture name * DO 10 K = 1, NDKAP IF (APERT(1:10) .EQ. APNAME(K)(1:10) .AND. : DET .EQ. DKDET(K)) GO TO 20 10 CONTINUE * STATUS = ERRNUM(1) CALL UUITOC (DET, 1, CHAR1, STATOK) CONTXT = 'aperture = ' // APERT(1:10) // ', DETECTOR = ' : // CHAR1 // ' not found in dark aperture ' : // 'translation table' GO TO 999 20 DKAP = DKNAME(K) * * find indices of the attribute combination * DO 30 K = 1, NROWS IF (DKAP(1:10) .EQ. APERT0(K)(1:10) .AND. : NINT(HV) .EQ. NINT(HV0(K)) .AND. : TYPE(1:4) .EQ. TYPE0(K)(1:4)) GO TO 40 30 CONTINUE * * exit if attributes are not found * STATUS = ERRNUM(2) CALL UUITOC (NINT(HV), 5, CHAR5, STATOK) CONTXT = 'dark aperture = ' // DKAP(1:10) // ', VHIVOLT = ' : // CHAR5 // ', DATA_TYP = ' // TYPE(1:4) : // ' not found in dark signal table ' GO TO 999 40 CONTINUE * * evaluate polynomial function of the correction * DO 50 I = 1, 16 COEFF((I-1)/4 + 1, MOD(I-1, 4) + 1) = COEFF0(I, K) 50 CONTINUE * CALL CDPVAL (TEMP, EPOCH, BASE0(K), COEFF, TEMP0(K), : EPOCH0(K), CORR) * STATUS = OK GO TO 1000 * * write error message * 999 MESS = OBSID // ' VDKEVL: ' // CONTXT CALL UMSPUT (MESS, DEST, PRIO, STATOK) * 1000 RETURN END