SUBROUTINE VHVEVL ( * * inputs: * : OBSID, DET, HV, TYPE, TEMP, EPOCH, : DET0, HV0, TYPE0, BASE0, COEFF0, TEMP0, : EPOCH0, NROWS, * * outputs: * : CORR, STATUS) * * Module Number: * * Module Name: CALHSP * * Keyphrase: * ---------- * Calculate high voltage factor corrections * * Description: * ------------ * Evaluate the 16 polynomial coefficients for high voltage factor * * FORTRAN Name: VHVEVL.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 *------------------------------------------------------------------------------- * *== inputs: * --detector ID of input data INTEGER DET, * --detector ID in the calibration table : DET0(1), * --number of rows of the calibration table : NROWS * --observation Id CHARACTER*(*) OBSID, * --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 in the * --calibration table : 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 * --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. : HV .EQ. HV0(K) .AND. : TYPE(1:4) .EQ. TYPE0(K)(1:4)) GO TO 20 10 CONTINUE * * exit if attributes are not found * STATUS = ERRNUM(1) CALL UUITOC (DET, 1, CHAR1, STATOK) CALL UUITOC (NINT(HV), 5, CHAR5, STATOK) CONTXT = 'DETECTOR = ' // CHAR1 // ' VHIVOLT = ' : // CHAR5 // ' DATA_TYP = ' // TYPE(1:4) : // ' not found in high voltage factor table' GO TO 999 20 CONTINUE * * evaluate polynomial function of the correction * DO 30 I = 1, 16 COEFF((I-1)/4 + 1, MOD(I-1, 4) + 1) = COEFF0(I, K) 30 CONTINUE * CALL CDPVAL (TEMP, EPOCH, BASE0(K), COEFF, TEMP0(K), : EPOCH0(K), CORR) * STATUS = OK GO TO 1000 * * write error message * 999 MESS = OBSID // ' VHVEVL: ' // CONTXT CALL UMSPUT (MESS, DEST, PRIO, STATOK) * 1000 RETURN END