SUBROUTINE VPPGHD ( * * inputs * : INFILE, INMID, SHPID, UDLID, OBSID, * * outputs * : PTFLAG, DETCSW, DEADSW, CNTSW, PHCSW, : TYPE, SMPTM, DET, APERT, STRTTM, STOPTM, DEATMP, : DETTMP, GAIN, HV, THRESH, STATUS) * * Module Number: * * Module Name: CALHSP * * Keyphrase: * ---------- * input header keywords for RSDP (pipeline) processing. * * Description: * ------------ * Input keywords from science file header, SHP header, and UDL header. * * FORTRAN Name: VPPGHD.FOR * * Keywords of Accessed Files and Tables: * -------------------------------------- * Name I/O Description / Comments * * keywords from the input file header (both image file and science * data files): * * 'ROOTNAME' I root name of the observation set * 'DATA_TYP' I data type * 'SAMPTIME' I sample time * 'FPKTTIME' I time of the first packet * 'LPKTTIME' I time of the last packet * * keywords from the input file header (science data file only): * * 'PTSRCFLG' I point source flag * 'DET_CHR' I detector characteristics retrieve switch * 'DEADTIME' I deadtime correction switch * 'TRUE_CNT' I true count rate computation switch * 'TRUE_PHC' I true photocurrent computation switch * 'DETECTOR' I detector used in this file * 'APERTURE' I aperture used * * keywords from the SHP file header: * * 'VTPDEAi' I DEA temperature of detector i * 'VTPDETi' I detector temperature of detector i * * keywords from the UDL file header: * * 'VGAINDi' I gain setting of detector i * 'VHIVOLTi' I high voltage setting of detector i * 'VPADTHRi' I PAD threshold setting of detector i * * Subroutines Called: * ------------------- * CDBS: * None * SDAS: * UHDGST, UHDGSR, UHDGSI, UMSPUT * OTHERS: * None * * History: * -------- * Version Date Author Description * 1 08-01-88 J.-C. Hsu Design and coding * 2 01-11-89 J.-C. Hsu no need for time bias *------------------------------------------------------------------------------- * *== input: * --input file name CHARACTER*(*) INFILE, * --observation ID : OBSID * --input files' pointer ID INTEGER INMID, SHPID, UDLID * *== output: * --point source flag CHARACTER*(*) PTFLAG, * --calibration switches : DETCSW, DEADSW, CNTSW, PHCSW, * --data type : TYPE, * --aperture name : APERT, * --times of first and last packets : STRTTM, STOPTM * --sample time REAL SMPTM, * --DEA and detector temperatures : DEATMP, DETTMP, * --gain, high voltage, and PAD theshold * --settings : GAIN, HV, THRESH * --detector ID INTEGER DET, * --return status : STATUS * *== local: * CHARACTER*1 CHAR1 * --keyword names CHARACTER*8 KEYWD(30) * --error message context CHARACTER*130 CONTXT, MESS * --return status INTEGER STAT(30), STATOK, * --loop indices : I, NPAR *=========================begin hsp.inc========================================= * --status return code INTEGER OK, ERRNUM(20) * --message destination and priority 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/ DATA DEST, PRIO /1, 0/ *=========================end hsp.inc=========================================== *------------------------------------------------------------------------------- KEYWD(1) = 'DATA_TYP' KEYWD(2) = 'SAMPTIME' * KEYWD(3) = 'FPKTTIME' KEYWD(4) = 'LPKTTIME' KEYWD(5) = 'PTSRCFLG' KEYWD(6) = 'DET_CHR' KEYWD(7) = 'DEADTIME' KEYWD(8) = 'TRUE_CNT' KEYWD(9) = 'TRUE_PHC' KEYWD(10) = 'DETECTOR' KEYWD(11) = 'APERTURE' KEYWD(12) = 'VTPDEA' KEYWD(13) = 'VTPDET' KEYWD(14) = 'VGAIND' KEYWD(15) = 'VHIVOLT' KEYWD(16) = 'VPADTHR' * * read keywords common to both image file and science data file * CALL UHDGST (INMID, KEYWD(1), TYPE, STAT(1)) CALL UHDGSR (INMID, KEYWD(2), SMPTM, STAT(2)) * * read group parameters * CALL UHDGST (INMID, KEYWD(3), STRTTM, STAT(3)) CALL UHDGST (INMID, KEYWD(4), STOPTM, STAT(4)) * * read keywords from science data file header * * read calibration flags and indicators * CALL UHDGST (INMID, KEYWD(5), PTFLAG, STAT(5)) * * read calibration switches * CALL UHDGST (INMID, KEYWD(6), DETCSW, STAT(6)) CALL UHDGST (INMID, KEYWD(7), DEADSW, STAT(7)) CALL UHDGST (INMID, KEYWD(8), CNTSW, STAT(8)) CALL UHDGST (INMID, KEYWD(9), PHCSW, STAT(9)) * * read calibration keywords * CALL UHDGSI (INMID, KEYWD(10), DET, STAT(10)) CALL UHDGST (INMID, KEYWD(11), APERT, STAT(11)) * IF (DET .GT. 9 .OR. DET .LT. 0) THEN STATUS = ERRNUM(1) CONTXT = 'invalid DETECTOR keyword value' GO TO 999 END IF * WRITE (CHAR1, '(I1)') DET NPAR = 11 * * read keywords from SHP file header * KEYWD(NPAR+1) = KEYWD(NPAR+1)(1:6) // CHAR1 KEYWD(NPAR+2) = KEYWD(NPAR+2)(1:6) // CHAR1 * CALL UHDGSR (SHPID, KEYWD(NPAR+1), DEATMP, STAT(NPAR+1)) CALL UHDGSR (SHPID, KEYWD(NPAR+2), DETTMP, STAT(NPAR+2)) * * read keywords from UDL file header * KEYWD(NPAR+3) = KEYWD(NPAR+3)(1:6) // CHAR1 KEYWD(NPAR+4) = KEYWD(NPAR+4)(1:7) // CHAR1 KEYWD(NPAR+5) = KEYWD(NPAR+5)(1:7) // CHAR1 * CALL UHDGSR (UDLID, KEYWD(NPAR+3), GAIN, STAT(NPAR+3)) CALL UHDGSR (UDLID, KEYWD(NPAR+4), HV, STAT(NPAR+4)) CALL UHDGSR (UDLID, KEYWD(NPAR+5), THRESH, STAT(NPAR+5)) * NPAR = NPAR + 5 * * check error * 10 CONTINUE DO 20 I = 1, NPAR IF (STAT(I) .NE. OK) THEN STATUS = ERRNUM(1) CONTXT = 'cannot read header keyword ' // KEYWD(I) // : ' of ' // INFILE GO TO 999 END IF 20 CONTINUE * * convert character keywords to upper case * CALL UUUPPC (TYPE, TYPE) CALL UUUPPC (STRTTM, STRTTM) CALL UUUPPC (STOPTM, STOPTM) CALL UUUPPC (PTFLAG, PTFLAG) CALL UUUPPC (DETCSW, DETCSW) CALL UUUPPC (DEADSW, DEADSW) CALL UUUPPC (CNTSW, CNTSW) CALL UUUPPC (PHCSW, PHCSW) CALL UUUPPC (APERT, APERT) * STATUS = OK GO TO 1000 * * write error message * 999 MESS = OBSID // ' VPPGHD: ' // CONTXT CALL UMSPUT (MESS, DEST, PRIO, STATOK) * 1000 RETURN END