SUBROUTINE CDPPA ( * * outputs * : FILTER, PADIFF, NPTS, : STATUS) * * Module Number: * * Module Name: * * Keyphrase: * ---------- * Read the table containing position angle offsets * * Description: * ------------ * Get position angle offsets of all 4 filters of the polarimetry detector * * FORTRAN Name: CDPPA.FOR * * Keywords of Accessed Files and Tables: * -------------------------------------- * Name I/O Description / Comments * * keyword input from PAR file: * * 'pa_offset' I SDAS table containing position angle * offsets * * Column names in PA_OFFSET: * * 'FILTER_NAME' I filter name * 'POS_ANG_DIFF' I position angle offset * * Subroutines Called: * ------------------- * CDBS: * CDTIN * SDAS: * UCLGST, UTRGTR, UTRGTT, UTTCLO, UMSPUT * OTHERS: * None * * History: * -------- * Version Date Author Description * 1 07-15-86 J.-C. Hsu Design and coding * 2 10-05-87 J.-C. Hsu F77 standard *------------------------------------------------------------------------------- * *== output: * --filter names CHARACTER*(*) FILTER(1) * --polarization position angle offsets REAL PADIFF(1) * --number of entries of input table INTEGER NPTS, * --error status : STATUS * *== local: * --loop index INTEGER I, J, * --number of rows and columns : NROWS, NCOLS, * --error status : STAT(10), STATOK, * --table pointer and column ID : TP, COLIDN(10) LOGICAL NULMSK(10) CHARACTER*5 CHAR5 * --column names CHARACTER*16 COLNAM(10) * --table name CHARACTER*128 TBNAME * --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=========================================== *------------------------------------------------------------------------------- * * initialization * NPTS = 0 * * define column names * NCOLS = 2 COLNAM(1) = 'FILTER_NAME' COLNAM(2) = 'POS_ANG_DIFF' * * set up position angle offset table * CALL UCLGST ('pa_offset', TBNAME, STATUS) IF (STATUS .NE. OK) THEN CONTXT = 'cannot get position angle offset table ' : // 'keyword name' GO TO 999 END IF * CALL CDTIN (TBNAME, COLNAM, NCOLS, : TP, COLIDN, NROWS, STATUS) IF (STATUS .NE. OK) THEN CONTXT = 'cannot set up position angle offset table' GO TO 999 END IF * * read position angle offset table * DO 30 I = 1, NROWS CALL UTRGTT (TP, COLIDN(1), 1, I, : FILTER(I), NULMSK(1), STAT(1)) CALL UTRGTR (TP, COLIDN(2), 1, I, : PADIFF(I), NULMSK(2), STAT(2)) * STATOK = ABS(STAT(1) - OK) + ABS(STAT(2) - OK) + OK * DO 10 J = 1, NCOLS IF (NULMSK(J)) THEN STATOK = ERRNUM(1) GO TO 20 END IF 10 CONTINUE * 20 IF (STATOK .NE. OK) THEN WRITE (CHAR5, '(I5)') I CONTXT = 'cannot read data entry #' // CHAR5 CALL UMSPUT (CONTXT, DEST, PRIO, STATOK) ELSE NPTS = NPTS + 1 FILTER(NPTS) = FILTER(I) PADIFF(NPTS) = PADIFF(I) END IF 30 CONTINUE * * close table * CALL UTTCLO (TP, STATUS) IF (STATUS .NE. OK) THEN CONTXT = 'cannot close position angle offset table' GO TO 999 END IF * STATUS = OK GO TO 1000 * * write error message * 999 MESS = 'CDPPA: ' // CONTXT CALL UMSPUT (MESS, DEST, PRIO, STATOK) * 1000 RETURN END