| 1 |
! @(#)createopto.prg 19.1 (ES0-DMD) 02/25/03 14:27:37 |
| 2 |
!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 3 |
!.IDENTIFICATION: createopto.prg |
| 4 |
!.PURPOSE: Create the input table for HOLES/POSITION command in the |
| 5 |
! requested format. |
| 6 |
!.USE: @s optab inp_file [out_tab] [fmt_file] [Old_equinox] |
| 7 |
!.AUTHOR: Alessandra Gemmo |
| 8 |
!.VERSION: 910615 AG Creation |
| 9 |
! 910618 AG Modified to include computation of precession |
| 10 |
! 910826 AG Modified to separate creation of the table from |
| 11 |
! computation of precession. Routine TBLSER also |
| 12 |
! included. |
| 13 |
!------------------------------------------------------------------------------ |
| 14 |
DEFINE/PARAM P1 ? C "Enter input file: " |
| 15 |
DEFINE/PARAM P2 opto1.tbl T "Enter output table [Default=opto1.tbl]: " |
| 16 |
DEFINE/PARAM P3 copy C "Enter format file [Default=opto.fmt]: " |
| 17 |
DEFINE/PARAM P4 {EQUINOX(1)} N "Enter equinox of coordinates: " |
| 18 |
DEFINE/LOCAL INDX/I/1/1 0 |
| 19 |
DEFINE/LOCAL CIRTAB/C/1/80 "circle.tbl" |
| 20 |
! |
| 21 |
COMPUTE/KEYW INDX = M$INDEX(P2,".tbl") |
| 22 |
IF INDX .EQ. 0 THEN |
| 23 |
WRITE/KEYW OUTPUTF/C/1/50 {P2}.tbl |
| 24 |
ELSE |
| 25 |
WRITE/KEYW OUTPUTF/C/1/50 {P2} |
| 26 |
ENDIF |
| 27 |
! |
| 28 |
WRITE/KEYW INPUTFI {P1} |
| 29 |
! |
| 30 |
! do some checks |
| 31 |
! |
| 32 |
IF {P4} .LT. 1800. THEN |
| 33 |
WRITE/OUT "*** FATAL: Value of EQUINOX not allowed !!" |
| 34 |
RETURN |
| 35 |
ELSEIF {P4} .GT. 2100. THEN |
| 36 |
WRITE/OUT "*** FATAL: Value of EQUINOX not allowed !!" |
| 37 |
RETURN |
| 38 |
ENDIF |
| 39 |
! |
| 40 |
! copy the format file from the optopus include directory |
| 41 |
! |
| 42 |
IF P3 .EQ. "copy" THEN |
| 43 |
IF AUX_MODE(1) .LE. 1 THEN ! VMS |
| 44 |
define/local optodir/c/1/60 - |
| 45 |
"MID_DISK:[&MIDASHOME.&MIDVERS.STDRED.OPTOPUS.INCL]" |
| 46 |
IF M$EXIST("opto.fmt") .EQ. 0 THEN |
| 47 |
$ COPY 'optodir'opto.fmt [] |
| 48 |
$ SET PROT=(O:RWED) opto.fmt |
| 49 |
ELSE |
| 50 |
WRITE/OUT "*** INFO: Format file opto.fmt already available" |
| 51 |
WRITE/OUT " Existing opto.fmt format file will be used" |
| 52 |
ENDIF |
| 53 |
ELSE ! UNIX |
| 54 |
define/local optodir/c/1/60 "$MIDASHOME/$MIDVERS/stdred/optopus/incl/" |
| 55 |
IF M$EXIST("opto.fmt") .EQ. 0 THEN |
| 56 |
$ cp 'optodir'opto.fmt `pwd` |
| 57 |
$ chmod 644 opto.fmt |
| 58 |
ELSE |
| 59 |
WRITE/OUT "*** INFO: Format file opto.fmt already available" |
| 60 |
WRITE/OUT " Existing opto.fmt file format will be used" |
| 61 |
ENDIF |
| 62 |
ENDIF |
| 63 |
WRITE/KEYW P3/C/1/8 opto.fmt |
| 64 |
ENDIF |
| 65 |
! |
| 66 |
! create MIDAS table |
| 67 |
! |
| 68 |
CREATE/TABLE {OUTPUTF} 9 100 {P1} {P3} |
| 69 |
! |
| 70 |
SET/FORMAT F10.5 |
| 71 |
IF {P4} .EQ. {EQUINOX(1)} THEN |
| 72 |
WRITE/DESCR {OUTPUTF} TABEQUI/D/1/1 {EQUINOX(1)} |
| 73 |
ELSE |
| 74 |
WRITE/DESCR {OUTPUTF} TABEQUI/D/1/1 {P4} |
| 75 |
WRITE/KEYW EQUINOX/D/1/1 {P4} |
| 76 |
ENDIF |
| 77 |
! |
| 78 |
RUN STD_EXE:OPTAB |
| 79 |
! |
| 80 |
DELETE/COLU {P2} :AHR |
| 81 |
DELETE/COLU {P2} :AMIN |
| 82 |
DELETE/COLU {P2} :ASEC |
| 83 |
DELETE/COLU {P2} :SIGN |
| 84 |
DELETE/COLU {P2} :DDEG |
| 85 |
DELETE/COLU {P2} :DMIN |
| 86 |
DELETE/COLU {P2} :DSEC |
| 87 |
! |
| 88 |
! create table with circle coordinates |
| 89 |
! |
| 90 |
CREATE/TABLE {CIRTAB} 2 360 NULL |
| 91 |
COMPUTE/TABLE {CIRTAB} :XX = 137000.*COS(SEQ) |
| 92 |
COMPUTE/TABLE {CIRTAB} :YY = 137000.*SIN(SEQ) |
| 93 |
COMPUTE/TABLE {CIRTAB} :RAX = :XX*0. |
| 94 |
COMPUTE/TABLE {CIRTAB} :DECY = :YY*0. |