SUBROUTINE VDTEVL ( * * inputs: * : OBSID, DET, HV, DISCR, TEMP, : DET0, HV0, DISCR0, BASE0, COEFF0, TEMP0, NROWS, * * outputs: * : CORR, STATUS) * * Module Number: * * Module Name: CALHSP * * Keyphrase: * ---------- * Find deadtime for the input attribute combination * * Description: * ------------ * * FORTRAN Name: VDTEVL.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 08-11-89 J.-C. Hsu new temperature dependent dead time *------------------------------------------------------------------------------- * *== inputs: * --observation ID CHARACTER*(*) OBSID * --detector ID of input data INTEGER DET, * --detector ID in the calibration table : DET0(1), * --number of rows of the calibration table : NROWS * --high voltage setting of input data REAL HV, * --high voltage settings in the * --calibration table : HV0(1), * --discriminator setting of input data : DISCR, * --input temperature : TEMP, * --discriminator settings in the * --calibration table : DISCR0(1), * --deadtime base values in the * --calibration table : BASE0(1), * --deadtime temperature dependence * --coefficients in the calibration table : COEFF0(1), * --base temperature in the calibration * --table : TEMP0(1) * *==outputs: * --final calibration correction REAL CORR * --error status INTEGER STATUS * *==local: * --loop indices INTEGER K, * --error status : STATOK CHARACTER*1 CHAR1 CHARACTER*4 CHAR4 CHARACTER*5 CHAR5 * --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=========================================== *------------------------------------------------------------------------------- * * find indices of the attribute combination * DO 10 K = 1, NROWS IF (DET .EQ. DET0(K) .AND. : DISCR .EQ. DISCR0(K) .AND. : HV .EQ. HV0(K)) GO TO 20 10 CONTINUE * * exit if attributes are not found * CALL UUITOC (DET, 1, CHAR1, STATOK) CALL UUITOC (NINT(HV), 5, CHAR5, STATOK) CALL UUITOC (NINT(DISCR), 4, CHAR4, STATOK) STATUS = ERRNUM(1) CONTXT = 'DETECTOR = ' // CHAR1 // ', VHIVOLT = ' // CHAR5 : // ', VPADTHR = ' // CHAR4 : // ' not found in deadtime table' GO TO 999 20 CONTINUE * CORR = BASE0(K) + COEFF0(K) * (TEMP - TEMP0(K)) * STATUS = OK GO TO 1000 * * write error message * 999 MESS = OBSID // ' VDTEVL: ' // CONTXT CALL UMSPUT (MESS, DEST, PRIO, STATOK) * 1000 RETURN END