1
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2
! .COPYRIGHT (c) European Southern Observatory
5
!.KEYWORDS tutorial, demo, test, average
7
! MIDAS procedure to demonstrate how
12
!.USAGE Execute as TUTORIAL/AVERAGE
13
!.VERSION 1.0 13-April-1999
17
write/out **********************************************************************
18
write/out This is a tutorial to show you how average/column and average/row work
20
write/out MIDAS command lines will start with: Midas>
21
write/out and have to be confirmed by hitting RETURN
23
write/out Comments are surrounded by: *** comment ***
25
write/out *********************************************************************
27
write/out Please drag your window with your MIDAS session
28
write/out into the lower right corner and hit RETURN once you're ready
29
inquire/key inputi "Ready? (hit RETURN):"
31
! create a display to get the monitor parameters
32
! create/display 0 100,100,0,0
33
! label/display "Tutorial: average" 0.5,0 p5=1
35
! write/out Let us start with a display
36
! calculate the position according to monitor settings
37
create/dis 1 512,512,0,360 p4=no
41
write/out "Please confirm every MIDAS command line you see with RETURN "
42
write/out "to see what happens during a MIDAS session "
44
write/out "*** Create an image called twodim with the MIDAS command: ***"
45
INQUIRE/KEY inputi "Midas> create/image twodim 2,4,2"
46
create/image twodim 2,4,2
49
write/out "*** After its creation the image was filled with different values***"
50
write/out "*** Now load this image: ***"
51
write/image twodim @1,@1,1 2
52
write/image twodim @1,@2,1 -9
53
write/image twodim @2,@1,1 3
54
write/image twodim @2,@2,1 -5
55
write/image twodim @3,@1,1 6
56
write/image twodim @3,@2,1 -4
57
write/image twodim @4,@1,1 7
58
write/image twodim @4,@2,1 -8
60
INQUIRE/KEY INPUTI "Midas> load/image twodim scale=50 cuts=-10,10"
61
load/image twodim scale=50 cuts=-10,10
63
label/display "Our image twodim.bdf" 0.8,0.1 p5=1 white
64
label/display "contains these values:" 0.7,0.1 p5=1 white
65
! careful, if you use label/display, because x and y are here y,x
66
label/display "2" @1,@1,f p5=1 white
67
label/display "-9" @2,@1,f p5=1 white
68
label/display "3" @1,@2,f p5=1 white
69
label/display "-5" @2,@2,f p5=1 white
70
label/display "6" @1,@3,f p5=1 white
71
label/display "-4" @2,@3,f p5=1 white
72
label/display "7" @1,@4,f p5=1 white
73
label/display "-8" @2,@4,f p5=1 white
75
label/display "columns ----->" 0.25,0.3 p5=1 white
76
label/display "No. 1 " 0.3,0.3 p5=1 white
77
label/display "No. 2 " 0.3,0.4 p5=1 white
78
label/display "No. 3 " 0.3,0.5 p5=1 white
79
label/display "No. 4 " 0.3,0.6 p5=1 white
81
label/display "rows" 0.5,0.05 p5=1 white
82
label/display "|" 0.4,0.15 p5=1 white
83
label/display "|" 0.45,0.15 p5=1 white
84
label/display "|" 0.5,0.15 p5=1 white
85
label/display "|" 0.55,0.15 p5=1 white
86
label/display "^" 0.6,0.14 p5=1 white
87
label/display " No. 1 " 0.4,0.15 p5=1 white
88
label/display " No. 2 " 0.5,0.15 p5=1 white
91
write/out "*** average/row: ***"
93
INQUIRE/KEY INPUTI "Midas> average/row onedim_avrow = twodim"
94
average/row onedim_avrow = twodim
96
write/out "***Display 2 shows the result of the MIDAS command average/row***"
97
create/display 2 512,256,0,0 p4=no
98
load/image onedim_avrow scale=50 cuts=-10,10
99
!label/display "Result of" 0.9,0.1 p5=1 white
100
label/display "Midas> average/row onedim_avrow = twodim" 0.8,0.1 p5=1 white
101
label/display "-3.5" 0.55,0.30 p5=1 white
102
label/display "-1" 0.55,0.45 p5=1 white
103
label/display "1" 0.55,0.55 p5=1 white
104
label/display "0.5" 0.55,0.65 p5=1 white
105
label/display "The result is the average over all rows in one column" 0.25,0.1 p5=1 white
108
write/out "*** average/col: ***"
110
INQUIRE/KEY INPUTI "Midas> average/column onedim_avcol = twodim"
111
average/column onedim_avcol = twodim
113
write/out "***Display 3 shows the result of the MIDAS command average/column***"
114
create/display 3 512,316,522,440 p4=no
116
create/image dummy 2,1,2
117
write/image dummy @1,@1,1 5
118
write/image dummy @1,@2,1 6
119
label/display "Midas> average/column onedim_avcol = twodim" 0.8,0.1 p5=1 white
120
label/display "The result is the average over all columns in one row" 0.25,0.1 p5=1 white
121
load/image dummy scale=50 cuts=-10,10
122
label/display "4.5" 0.35,0.50 p5=1 white
123
label/display "-6.5" 0.55,0.50 p5=1 white
124
label/display "and would in principle look like this" 0.20,0.1 p5=1 white
127
label/display "However:" 0.20,0.75 p5=1 white
128
label/display "In MIDAS, one-dimensional images" 0.15,0.1 p5=1 white
129
label/display "are aligned along the x-axis." 0.10,0.1 p5=1 white
132
write/out "*** To see the real result of average/column load the image: ***"
134
INQUIRE/KEY INPUTI "Midas> load/image onedim_avcol scale=50 cuts=-10,10"
135
load/image onedim_avcol scale=50 cuts=-10,10
136
label/display "and would in principle look like this" 0.20,0.1 p5=1 black
137
label/display "However:" 0.20,0.75 p5=1 black
138
label/display "4.5" 0.35,0.50 p5=1 black
139
label/display "Therefore, the result looks like this" 0.7,0.05 p5=1 white
140
label/display "4.5" 0.55,0.45 p5=1 white
142
!write/out "*** and load the real output image: ***"
143
!INQUIRE/KEY INPUTI "Midas> load/image onedim_avcol scale=50 cuts=-10,10"
144
!load/image onedim_avcol scale=50 cuts=-10,10
146
write/out "End of TUTORIAL/AVERAGE"