SUBROUTINE VFCGT ( * * outputs * : COUNT, DCOUNT, FOCUS, TEMP, EPOCH, APER, TARGET, : NPTS, REJECT, OFILE, STATUS) * * Module number: 15.2.1.1 * * Module name: focusv * * Keyphrase: * ---------- * Input parameters and data needed for VFOCUS * * Description: * ------------ * * FORTRAN name: VFCGT.FOR * * Keywords of accessed files and tables: * -------------------------------------- * Name I/O Description / Comments * 'intable' I input table name * 'outtable' I output table name * 'count_key' I column name of the count rate * 'counterr_key' I column name of count rate's standard dev * 'focus_key' I column name of the focus setting * 'temp_key' I column name of temperature * 'reject' I specified fraction of top count rate * points below it will be rejected * * input table column names: * * (count_key) I count rate as passed from COUNT_KEY * (counterr_key) I count rate's standard deviation as * passed from COUNTERR_KEY * (focus_key) I focus seting as passed from FOCUS_KEY * (temp_key) I the temperature as passed from TEMP_KEY * 'EPOCH' I observation epoch * 'TRGTNAME' I target name * 'APERTOBJ' I aperture name * * Subroutines Called: * ------------------- * CDBS: * CDTIN * SDAS: * UCLGSR, UCLGST, UTRGTR, UTRGTD, UTRGTT, UTTCLO, UMSPUT * Others: * None * * History: * -------- * Version Date Author Description * 1 05-22-87 J.-C. HSU design and coding * 2 11-20-87 J.-C. HSU F77 standard *------------------------------------------------------------------------------- * *== output: * --count rate and its standard deviation REAL COUNT(1), DCOUNT(1), * --focus setting, and temperature : FOCUS(1), TEMP(1) * --epoch DOUBLE PRECISION EPOCH(1) * --target name, and aperture name CHARACTER*(*) TARGET(1), APER(1) * --total number of valid input data points INTEGER NPTS * --rejection level REAL REJECT * --output file name CHARACTER*(*) OFILE * --error status INTEGER STATUS * *== local: * --number of data points INTEGER NROWS, * --pointer of table descripter and column * --identifier : TP, COLIDN(10), * --loop indices, number of input columns : I, J, NCOLS, * --status : STAT(20), STATOK * --data buffer REAL COLBUF(10) * --column names CHARACTER*16 COLNAM(10) * --null flag in UTRGTR LOGICAL NULMSK(30) * --input file name CHARACTER*128 IFILE * --error message context CHARACTER*130 CONTXT CHARACTER*5 CHAR5 *=========================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=========================================== *------------------------------------------------------------------------------ * * input input- and output- file names, rejection level, and column names of * count rate, its standard deviation, focus setting, and temperature * CALL UCLGST ('intable', IFILE, STAT(1)) CALL UCLGST ('outtable', OFILE, STAT(2)) CALL UCLGSR ('reject', REJECT, STAT(3)) CALL UCLGST ('count_key', COLNAM(1), STAT(4)) CALL UCLGST ('counterr_key', COLNAM(2), STAT(5)) CALL UCLGST ('focus_key', COLNAM(3), STAT(6)) CALL UCLGST ('temp_key', COLNAM(4), STAT(7)) * DO 10 I = 1, 7 IF (STAT(I) .NE. OK) THEN STATUS = ERRNUM(1) CONTXT = 'can not get CL parameter(s)' GO TO 999 END IF 10 CONTINUE * * input the following: count rate and its standard deviation, focus setting, * temperature, epoch, target name, and aperture name from input table * * define the rest of input table column names * NCOLS = 7 COLNAM(5) = 'EPOCH' COLNAM(6) = 'TRGTNAME' COLNAM(7) = 'APERTOBJ' * CALL CDTIN (IFILE, COLNAM, NCOLS, : TP, COLIDN, NROWS, STATUS) IF (STATUS .NE. OK) THEN CONTXT = 'error setting up input table' GO TO 999 END IF * NPTS = 0 DO 40 I = 1, NROWS CALL UTRGTR (TP, COLIDN, 4, I, : COLBUF, NULMSK, STAT(1)) CALL UTRGTD (TP, COLIDN(5), 1, I, : EPOCH(I), NULMSK(5), STAT(2)) CALL UTRGTT (TP, COLIDN(6), 1, I, : TARGET(I), NULMSK(6), STAT(3)) CALL UTRGTT (TP, COLIDN(7), 1, I, : APER(I), NULMSK(7), STAT(4)) * STATOK = ABS(STAT(1) - OK) + ABS(STAT(2) - OK) + : ABS(STAT(3) - OK) + ABS(STAT(4) - OK) + OK DO 20 J = 1, NCOLS IF (NULMSK(J)) THEN STATOK = ERRNUM(3) GO TO 30 END IF 20 CONTINUE * * if error in UTRGTR, put an error message and do NOT increment the data array * index * 30 CONTINUE IF (STATOK .NE. OK) THEN WRITE(CHAR5, '(I5)') I CONTXT = 'can not read input table row #' // CHAR5 CALL UMSPUT (CONTXT, DEST, PRIO, STATOK) ELSE NPTS = NPTS + 1 COUNT(NPTS) = COLBUF(1) DCOUNT(NPTS) = COLBUF(2) FOCUS(NPTS) = COLBUF(3) TEMP(NPTS) = COLBUF(4) EPOCH(NPTS) = EPOCH(I) TARGET(NPTS) = TARGET(I) APER(NPTS) = APER(I) END IF 40 CONTINUE * * close the input table * CALL UTTCLO (TP, STATUS) IF (STATUS .NE. OK) THEN CONTXT = 'cannot close input table' GO TO 999 END IF * IF (NPTS .LE. 0) THEN STATUS = ERRNUM(5) CONTXT = 'no input data been successfully read' GO TO 999 END IF * STATUS = OK GO TO 1000 * * write error message * 999 CALL UMSPUT ('VFCGT: ' // CONTXT, DEST, PRIO, STATOK) * 1000 RETURN END