~ubuntu-branches/debian/jessie/eso-midas/jessie

« back to all changes in this revision

Viewing changes to stdred/feros/proc/ferosdemo.prg

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
! @(#)ferosdemo.prg     19.1 (ESO-DMD) 02/25/03 14:22:01
 
2
 
3
! ferosdemo.prg 
 
4
!
 
5
 
 
6
  define/local reply/I/1/1 1
 
7
  define/local answer/c/1/1 n
 
8
 
 
9
WRITE/OUT " "
 
10
WRITE/OUT "This tutorial requires a number of frames and tables"
 
11
WRITE/OUT " "
 
12
WRITE/OUT "It works only, when you have the necessary demo"
 
13
WRITE/OUT "and calibration frames installed on your system"
 
14
WRITE/OUT " "
 
15
WRITE/OUT "You also need sufficient disk space: about 250 MB!..."
 
16
WRITE/OUT " "
 
17
 
 
18
!---------------------------------------------------------------------------
 
19
! copy guess and calibration data to current directory
 
20
!---------------------------------------------------------------------------
 
21
 
 
22
INQUIRE/KEY answer "Copy frames/tables needed by tutorial? [y/n]"
 
23
 
 
24
if "{answer(1:1)}" .eq. "y" then
 
25
 
 
26
  WRITE/OUT " *** Copy data to default directory, this may take some time ..."
 
27
  !
 
28
  if aux_mode .le. 1 then                   !in VMS
 
29
    -COPY MID_FEROS:*.* []
 
30
    -COPY MID_TEST:fero*.BDF []
 
31
  else                                      !in UNIX
 
32
    -COPY MID_FEROS:* ./
 
33
    -COPY MID_TEST:fero* ./
 
34
  endif
 
35
 
 
36
  !
 
37
 
 
38
  indisk/fits ferosFF.fits ferosFF
 
39
  indisk/fits ferosThAr.fits ferosThAr
 
40
  indisk/fits ferosHD5980.fits  ferosHD5980
 
41
  indisk/fits BLAZE.tfits BLAZE.tbl
 
42
  indisk/fits GUESS_GORDER.tfits GUESS_GORDER.tbl
 
43
  indisk/fits GUESS_INIT.tfits GUESS_INIT.tbl
 
44
  indisk/fits GUESS_LINE1.tfits GUESS_LINE1.tbl
 
45
  indisk/fits GUESS_LINE2.tfits GUESS_LINE2.tbl
 
46
  indisk/fits GUESS_ORDER.tfits GUESS_ORDER.tbl
 
47
  indisk/fits GUESS_TEMPLATE.fits GUESS_TEMPLATE.bdf
 
48
  indisk/fits GUESS_WLC1.tfits GUESS_WLC1.tbl
 
49
  indisk/fits GUESS_WLC2.tfits GUESS_WLC2.tbl
 
50
  indisk/fits IDTAB_REF.tfits IDTAB_REF.tbl
 
51
  indisk/fits THAR_REF.fits  THAR_REF.bdf
 
52
  indisk/fits ThAr50000.tfits ThAr50000.tbl
 
53
 
 
54
else
 
55
 
 
56
  WRITE/OUT " "
 
57
  INQUIRE/KEY answer "Do you want to continue with existing data? [y/n]"
 
58
 
 
59
  IF "{answer(1:1)}" .EQ. "n" THEN
 
60
    return/exit
 
61
  endif
 
62
 
 
63
endif
 
64
 
 
65
!------------------------------------------------------------------------------
 
66
! initialize displays
 
67
!------------------------------------------------------------------------------
 
68
 
 
69
RESET/DISPLAY
 
70
CREA/DISP 0 512,564,756,406
 
71
CREA/GRA 0 625,425,44,129
 
72
LOAD/LUT idl4
 
73
SET/GRA pmode=1
 
74
 
 
75
!------------------------------------------------------------------------------
 
76
! initialize parameters
 
77
!------------------------------------------------------------------------------
 
78
init:
 
79
 
 
80
WRITE/OUT " "
 
81
WRITE/OUT "*** Initialize keywords..."
 
82
WRITE/OUT " "
 
83
ECHO/ON
 
84
INIT/FEROS GUESS
 
85
SET/FEROS RAW_IMG=ferosFF
 
86
SET/FEROS GUESS_TBL=orders CENTER_TBL=centers
 
87
SET/FEROS STRAIGHT_IMG=str EXT_IMG=extr COEF_COP=cop_coeffs
 
88
ECHO/OFF
 
89
 
 
90
!*************************************FF*****************************
 
91
 
 
92
!------------------------------------------------------------------------------
 
93
! locate orders
 
94
!------------------------------------------------------------------------------
 
95
locate:
 
96
 
 
97
WRITE/OUT " "
 
98
WRITE/OUT "*** search orders..."
 
99
WRITE/OUT " "
 
100
 
 
101
ECHO/ON
 
102
LOAD/IMA {RAW_IMG} sc=-2,-2 center=0,0 cuts=0,8000
 
103
DEFINE/FEROS >Null
 
104
ECHO/OFF
 
105
 
 
106
WRITE/OUT " "
 
107
WRITE/OUT "*** load order definition table..."
 
108
WRITE/OUT " "
 
109
 
 
110
ECHO/ON
 
111
load/tab {CENTER_TBL} :fit_pos :ypos
 
112
ECHO/OFF
 
113
 
 
114
IF P1(1:1) .NE. "A" THEN
 
115
  
 
116
  WRITE/OUT " "
 
117
  WRITE/OUT "Next step is reduction of FF spectrum"
 
118
  WRITE/OUT " "
 
119
 
 
120
  INQUIRE/KEY reply "Press return to continue ; -1 to stop " ? 
 
121
  IF {reply} .LT. 0 @s ferosdemo,finish
 
122
ENDIF
 
123
 
 
124
cl/ch over
 
125
 
 
126
!------------------------------------------------------------------------------
 
127
! background continuous spectrum image
 
128
!------------------------------------------------------------------------------
 
129
backgroundflat:
 
130
 
 
131
WRITE/OUT " "
 
132
WRITE/OUT "*** determine and subtract background from FF spectrum..."
 
133
WRITE/OUT " "
 
134
 
 
135
ECHO/ON
 
136
SET/FEROS FLAT_IMG=FFback
 
137
BACKGR/FEROS {RAW_IMG}
 
138
ECHO/OFF
 
139
 
 
140
!------------------------------------------------------------------------------
 
141
! straighten orders in FF spectrum
 
142
!------------------------------------------------------------------------------
 
143
rectifyflat:
 
144
 
 
145
WRITE/OUT " "
 
146
WRITE/OUT "*** rectify orders in FF spectrum..."
 
147
WRITE/OUT " "
 
148
 
 
149
ECHO/ON
 
150
RECTIFY/FEROS
 
151
ECHO/OFF
 
152
 
 
153
!------------------------------------------------------------------------------
 
154
! extract FF spectra
 
155
!------------------------------------------------------------------------------
 
156
stdext:
 
157
 
 
158
WRITE/OUT " "
 
159
WRITE/OUT "*** optimum extraction for both fibers..."
 
160
WRITE/OUT "*** this is needed for cross-order profile determination"
 
161
WRITE/OUT "*** and may take some time..."
 
162
WRITE/OUT " "
 
163
 
 
164
ECHO/ON
 
165
EXTRACT/FEROS ? extr GOYN >Null
 
166
!EXTRACT/FEROS ? extr GOYN
 
167
ECHO/OFF
 
168
 
 
169
WRITE/OUT " "
 
170
WRITE/OUT "*** standard extraction for both fibers..."
 
171
WRITE/OUT " "
 
172
 
 
173
ECHO/ON
 
174
EXTRACT/FEROS ? ff_extr GSNN >Null
 
175
!EXTRACT/FEROS ? ff_extr GSNN
 
176
ECHO/OFF
 
177
 
 
178
IF P1(1:1) .NE. "A" THEN
 
179
  
 
180
  WRITE/OUT " "
 
181
  WRITE/OUT "Next step is reduction of ThAr spectrum"
 
182
  WRITE/OUT " "
 
183
 
 
184
  INQUIRE/KEY reply "Press return to continue ; -1 to stop " ? 
 
185
  IF {reply} .LT. 0 @s ferosdemo,finish
 
186
ENDIF
 
187
 
 
188
!*************************************ThAr*****************************
 
189
 
 
190
LOAD/IMA ferosThAr sc=-2 cuts=0,1000
 
191
!------------------------------------------------------------------------------
 
192
! background and extract ThAr spectrum image
 
193
!------------------------------------------------------------------------------
 
194
backgroundthar:
 
195
 
 
196
WRITE/OUT " "
 
197
WRITE/OUT "*** determine and subtract background form ThAr spectrum..."
 
198
WRITE/OUT " "
 
199
 
 
200
ECHO/ON
 
201
SET/FEROS FLAT_IMG=ThArback
 
202
BACKGR/FEROS ferosThAr
 
203
RECTIFY/FEROS ? str
 
204
SET/FEROS STRAIGHT_IMG=str 
 
205
EXTRACT/FEROS ? thar_extr  GSNN >Null
 
206
ECHO/OFF
 
207
 
 
208
IF P1(1:1) .NE. "A" THEN
 
209
  
 
210
  WRITE/OUT " "
 
211
  WRITE/OUT "Next step is wavelength calibration"
 
212
  WRITE/OUT " "
 
213
 
 
214
  INQUIRE/KEY reply "Press return to continue ; -1 to stop " ? 
 
215
  IF {reply} .LT. 0 @s ferosdemo,finish
 
216
ENDIF
 
217
 
 
218
!------------------------------------------------------------------------------
 
219
! search for emission lines in ThAr spectrum
 
220
!------------------------------------------------------------------------------
 
221
 
 
222
searchline:
 
223
 
 
224
WRITE/OUT " "
 
225
WRITE/OUT "*** search for emission lines in ThAr spectrum..."
 
226
WRITE/OUT " "
 
227
 
 
228
ECHO/ON
 
229
SET/FEROS LINE_POS_TBL=linepos
 
230
SEARCH/FEROS thar_extr >Null
 
231
ECHO/OFF
 
232
 
 
233
 
 
234
!------------------------------------------------------------------------------
 
235
! wavelength calibration, check it
 
236
!------------------------------------------------------------------------------
 
237
calibrate:
 
238
 
 
239
WRITE/OUT " "
 
240
WRITE/OUT "*** wavelength calibration..."
 
241
WRITE/OUT " "
 
242
 
 
243
ECHO/ON
 
244
CALIBRATE/FEROS >Null
 
245
set/gra xa ya=-0.02,0.02 colo
 
246
plo/tab {LINE_POS_TBL}1 :wave :residual
 
247
ECHO/OFF
 
248
 
 
249
IF P1(1:1) .NE. "A" THEN
 
250
  
 
251
  WRITE/OUT " "
 
252
  WRITE/OUT "Next step is reduction of object spectrum"
 
253
  WRITE/OUT " "
 
254
 
 
255
  INQUIRE/KEY reply "Press return to continue ; -1 to stop " ? 
 
256
  IF {reply} .LT. 0 @s ferosdemo,finish
 
257
ENDIF
 
258
 
 
259
 
 
260
!*************************************object*****************************
 
261
 
 
262
LOAD/IMA ferosHD5980 sc=-2 cuts=0,1000
 
263
 
 
264
!------------------------------------------------------------------------------
 
265
! background stellar spectrum image
 
266
!------------------------------------------------------------------------------
 
267
 
 
268
WRITE/OUT " "
 
269
WRITE/OUT "*** determine and subtract background from stellar spectrum..."
 
270
WRITE/OUT " "
 
271
 
 
272
ECHO/ON
 
273
SET/FEROS RAW_IMG=ferosHD5980 FLAT_IMG=HD5980back
 
274
BACKGR/FEROS {RAW_IMG}
 
275
RECTIFY/FEROS
 
276
ECHO/OFF
 
277
 
 
278
WRITE/OUT " "
 
279
WRITE/OUT "*** optimum extraction for both fibers..."
 
280
WRITE/OUT "*** this may take some time..."
 
281
WRITE/OUT " "
 
282
 
 
283
ECHO/ON
 
284
EXTRACT/FEROS ? opt_extr GONN >Null
 
285
ECHO/OFF
 
286
 
 
287
WRITE/OUT " "
 
288
WRITE/OUT "*** standard extraction for both fibers..."
 
289
WRITE/OUT " "
 
290
 
 
291
ECHO/ON
 
292
EXTRACT/FEROS ? std_extr GSNN >Null
 
293
ECHO/OFF
 
294
 
 
295
IF P1(1:1) .NE. "A" THEN
 
296
  
 
297
  WRITE/OUT " "
 
298
  WRITE/OUT "Next step is flat-fielding and wavelength calibration"
 
299
  WRITE/OUT " "
 
300
 
 
301
  INQUIRE/KEY reply "Press return to continue ; -1 to stop " ? 
 
302
  IF {reply} .LT. 0 @s ferosdemo,finish
 
303
ENDIF
 
304
 
 
305
!------------------------------------------------------------------------------
 
306
! flat-field stellar spectrum 
 
307
!------------------------------------------------------------------------------
 
308
 
 
309
WRITE/OUT " "
 
310
WRITE/OUT "*** flat-fielding stellar spectrum..."
 
311
WRITE/OUT " "
 
312
 
 
313
ECHO/ON
 
314
SET/FEROS UNBLAZED_IMG=std_unbl
 
315
FLAT/FEROS std_extr ff_extr
 
316
SET/FEROS UNBLAZED_IMG=opt_unbl
 
317
FLAT/FEROS opt_extr ff_extr
 
318
ECHO/OFF
 
319
 
 
320
!------------------------------------------------------------------------------
 
321
! rebin stellar spectrum 
 
322
!------------------------------------------------------------------------------
 
323
 
 
324
rebinlin:
 
325
 
 
326
WRITE/OUT " "
 
327
WRITE/OUT "*** rebinning stellar spectrum to constant steps in lambda..."
 
328
WRITE/OUT " "
 
329
 
 
330
ECHO/ON
 
331
REBIN/FEROS std_unbl ? std_reb I 0.05
 
332
REBIN/FEROS opt_unbl ? opt_reb I 0.05
 
333
ECHO/OFF
 
334
 
 
335
!------------------------------------------------------------------------------
 
336
! merge orders
 
337
!------------------------------------------------------------------------------
 
338
 
 
339
!mergeorders:
 
340
 
 
341
WRITE/OUT " "
 
342
WRITE/OUT "*** merge orders..."
 
343
WRITE/OUT " "
 
344
 
 
345
ECHO/ON
 
346
SET/FEROS REBIN_STEP=0.05
 
347
MERGE/FEROS std_reb std_mer ? SINC
 
348
MERGE/FEROS opt_reb opt_mer ? SINC
 
349
MERGE/FEROS opt_reb ? 1,39 NOAVER >Null
 
350
ECHO/OFF
 
351
 
 
352
!------------------------------------------------------------------------------
 
353
! check overlap
 
354
!------------------------------------------------------------------------------
 
355
 
 
356
WRITE/OUT " "
 
357
WRITE/OUT "*** check overlapping of orders..."
 
358
WRITE/OUT " "
 
359
 
 
360
set/gra xa=5300,6000 ya=0,0.15
 
361
SET/GRAP colo=1
 
362
plo merged10023
 
363
set/gra colo=2
 
364
ove merged10022
 
365
ove merged10024
 
366
ove merged10026
 
367
set/gra colo=1 
 
368
ove merged10021
 
369
ove merged10025
 
370
set/gra xa ya
 
371
 
 
372
IF P1(1:1) .NE. "A" THEN
 
373
  
 
374
  WRITE/OUT " "
 
375
  WRITE/OUT "Next step is check of optimum extraction"
 
376
  WRITE/OUT " "
 
377
 
 
378
  INQUIRE/KEY reply "Press return to continue ; -1 to stop " ? 
 
379
  IF {reply} .LT. 0 @s ferosdemo,finish
 
380
ENDIF
 
381
 
 
382
!------------------------------------------------------------------------------
 
383
! check optimum extraction
 
384
!------------------------------------------------------------------------------
 
385
 
 
386
WRITE/OUT " "
 
387
WRITE/OUT "*** check optimum extraction..."
 
388
WRITE/OUT " "
 
389
 
 
390
set/gra xa=4200,4500 ya=0,0.15
 
391
SET/GRAP colo=1
 
392
plo std_mer1
 
393
SET/GRAP colo=2
 
394
ove opt_mer1 ? ? -0.02
 
395
set/gra colo=1 xa ya
 
396
 
 
397
@s ferosdemo,finish
 
398
 
 
399
 
 
400
!------------------------------------------------------------------------------
 
401
! finish
 
402
!------------------------------------------------------------------------------
 
403
 
 
404
ENTRY finish
 
405
ECHO/OFF
 
406
 
 
407
WRITE/OUT " "
 
408
WRITE/OUT "*** End of Tutorial ***"
 
409
WRITE/OUT " "
 
410
 
 
411
RETURN/EXIT
 
412