Debian Codegraph @

stdred/optopus/proc/startopto.prg

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