Debian Codegraph @

stdred/optopus/proc/initopto.prg

raw
1 ! @(#)initopto.prg 19.1 (ES0-DMD) 02/25/03 14:27:38
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 !.VERSION: 910618 AG Modified to include computation of precession
10 !.VERSION: 910826 AG Modified to separate creation of the table from
11 !. computation of precession. Routine TBLSER also
12 !. included.
13 !.VERSION: 920722 Roland den Hartog, Sterrewacht Leiden:
14 !. combined with precessopto, for convenience
15 !------------------------------------------------------------------------------
16 DEFINE/PARAM P1 ? C "Enter input file: "
17 DEFINE/PARAM P2 opto1.tbl T "Enter output table [Default=opto1.tbl]: "
18 DEFINE/PARAM P3 copy C "Enter format file [Default=opto.fmt]: "
19 DEFINE/PARAM P4 {EQUINOX(1)} N "Enter equinox of coordinates: "
20 DEFINE/LOCAL INDX/I/1/1 0
21 DEFINE/LOCAL CIRTAB/C/1/80 "circle.tbl"
22 DEFINE/LOCAL TABEQUI/D/1/1 1950
23 !
24 COMPUTE/KEYW INDX = M$INDEX(P2,".tbl")
25 IF INDX .EQ. 0 THEN
26 WRITE/KEYW OUTPUTF/C/1/50 {P2}.tbl
27 ELSE
28 WRITE/KEYW OUTPUTF/C/1/50 {P2}
29 ENDIF
30 !
31 WRITE/KEYW INPUTFI {P1}
32 !
33 ! do some checks
34 !
35 IF {P4} .LT. 1800. THEN
36 WRITE/OUT "*** FATAL: Value of EQUINOX not allowed !!"
37 RETURN
38 ELSEIF {P4} .GT. 2100. THEN
39 WRITE/OUT "*** FATAL: Value of EQUINOX not allowed !!"
40 RETURN
41 ENDIF
42 !
43 ! copy the format file from the optopus include directory
44 !
45 IF P3 .EQ. "copy" THEN
46 IF AUX_MODE(1) .LE. 1 THEN ! VMS
47 define/local optodir/c/1/60 -
48 "MID_DISK:[&MIDASHOME.&MIDVERS.STDRED.OPTOPUS.INCL]"
49 IF M$EXIST("opto.fmt") .EQ. 0 THEN
50 $ COPY {optodir}opto.fmt []
51 $ SET PROT=(O:RWED) opto.fmt
52 ELSE
53 WRITE/OUT "*** INFO: Format file opto.fmt already available"
54 WRITE/OUT " Existing opto.fmt format file will be used"
55 ENDIF
56 ELSE ! UNIX
57 define/local optodir/c/1/60 "$MIDASHOME/$MIDVERS/stdred/optopus/incl/"
58 IF M$EXIST("opto.fmt") .EQ. 0 THEN
59 $ cp {optodir}opto.fmt `pwd`
60 $ chmod 644 opto.fmt
61 ELSE
62 WRITE/OUT "*** INFO: Format file opto.fmt already available"
63 WRITE/OUT " Existing opto.fmt file format will be used"
64 ENDIF
65 ENDIF
66 WRITE/KEYW P3/C/1/8 opto.fmt
67 ENDIF
68 !
69 ! create MIDAS table
70 !
71 CREATE/TABLE {OUTPUTF} 9 100 {P1} {P3}
72 !
73 SET/FORMAT F10.5
74 IF {P4} .EQ. {EQUINOX(1)} THEN
75 WRITE/DESCR {OUTPUTF} TABEQUI/D/1/1 {EQUINOX(1)}
76 ELSE
77 WRITE/DESCR {OUTPUTF} TABEQUI/D/1/1 {P4}
78 WRITE/KEYW EQUINOX/D/1/1 {P4}
79 ENDIF
80 !
81 RUN STD_EXE:OPTAB
82 !
83 DELETE/COLU {P2} :AHR
84 DELETE/COLU {P2} :AMIN
85 DELETE/COLU {P2} :ASEC
86 DELETE/COLU {P2} :SIGN
87 DELETE/COLU {P2} :DDEG
88 DELETE/COLU {P2} :DMIN
89 DELETE/COLU {P2} :DSEC
90 !
91 ! create table with circle coordinates
92 !
93 CREATE/TABLE {CIRTAB} 2 360 NULL
94 COMPUTE/TABLE {CIRTAB} :XX = 137000.*COS(SEQ)
95 COMPUTE/TABLE {CIRTAB} :YY = 137000.*SIN(SEQ)
96 COMPUTE/TABLE {CIRTAB} :RAX = :XX*0.
97 COMPUTE/TABLE {CIRTAB} :DECY = :YY*0.
98 !
99 !
100 ! *** do the precession
101 WRITE/KEYW INPUTFI/C/1/50 {OUTPUTF}
102 !
103 ! *** do some checks
104 COPY/DK {INPUTFI} TABEQUI/D/1/1 TABEQUI/D/1/1
105 IF {TABEQUI(1)} .EQ. 'EQUINOX(2)' THEN
106 WRITE/OUT "*** FATAL: Table has already been precessed !!"
107 RETURN
108 ENDIF
109 !
110 SET/FORMAT F10.5
111 IF {P5} .EQ. {EQUINOX(2)} THEN
112 WRITE/DESCR {INPUTFI} TABEQUI/D/1/1 'EPOCH(1)'
113 ELSE
114 WRITE/DESCR {INPUTFI} TABEQUI/D/1/1 'P5'
115 WRITE/KEYW EQUINOX/D/2/1 'P5'
116 ENDIF
117 !
118 RUN STD_EXE:PRECESS
119 !
120 NAME/COLU {INPUTFI} :RA :OLDRA
121 NAME/COLU {INPUTFI} :DEC :OLDDEC
122 NAME/COLU {INPUTFI} :PRA :RA
123 NAME/COLU {INPUTFI} :PDEC :DEC
124
125