1
! @(#)ferosdemo.prg 19.1 (ESO-DMD) 02/25/03 14:22:01
6
define/local reply/I/1/1 1
7
define/local answer/c/1/1 n
10
WRITE/OUT "This tutorial requires a number of frames and tables"
12
WRITE/OUT "It works only, when you have the necessary demo"
13
WRITE/OUT "and calibration frames installed on your system"
15
WRITE/OUT "You also need sufficient disk space: about 250 MB!..."
18
!---------------------------------------------------------------------------
19
! copy guess and calibration data to current directory
20
!---------------------------------------------------------------------------
22
INQUIRE/KEY answer "Copy frames/tables needed by tutorial? [y/n]"
24
if "{answer(1:1)}" .eq. "y" then
26
WRITE/OUT " *** Copy data to default directory, this may take some time ..."
28
if aux_mode .le. 1 then !in VMS
29
-COPY MID_FEROS:*.* []
30
-COPY MID_TEST:fero*.BDF []
33
-COPY MID_TEST:fero* ./
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
57
INQUIRE/KEY answer "Do you want to continue with existing data? [y/n]"
59
IF "{answer(1:1)}" .EQ. "n" THEN
65
!------------------------------------------------------------------------------
67
!------------------------------------------------------------------------------
70
CREA/DISP 0 512,564,756,406
71
CREA/GRA 0 625,425,44,129
75
!------------------------------------------------------------------------------
76
! initialize parameters
77
!------------------------------------------------------------------------------
81
WRITE/OUT "*** Initialize keywords..."
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
90
!*************************************FF*****************************
92
!------------------------------------------------------------------------------
94
!------------------------------------------------------------------------------
98
WRITE/OUT "*** search orders..."
102
LOAD/IMA {RAW_IMG} sc=-2,-2 center=0,0 cuts=0,8000
107
WRITE/OUT "*** load order definition table..."
111
load/tab {CENTER_TBL} :fit_pos :ypos
114
IF P1(1:1) .NE. "A" THEN
117
WRITE/OUT "Next step is reduction of FF spectrum"
120
INQUIRE/KEY reply "Press return to continue ; -1 to stop " ?
121
IF {reply} .LT. 0 @s ferosdemo,finish
126
!------------------------------------------------------------------------------
127
! background continuous spectrum image
128
!------------------------------------------------------------------------------
132
WRITE/OUT "*** determine and subtract background from FF spectrum..."
136
SET/FEROS FLAT_IMG=FFback
137
BACKGR/FEROS {RAW_IMG}
140
!------------------------------------------------------------------------------
141
! straighten orders in FF spectrum
142
!------------------------------------------------------------------------------
146
WRITE/OUT "*** rectify orders in FF spectrum..."
153
!------------------------------------------------------------------------------
155
!------------------------------------------------------------------------------
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..."
165
EXTRACT/FEROS ? extr GOYN >Null
166
!EXTRACT/FEROS ? extr GOYN
170
WRITE/OUT "*** standard extraction for both fibers..."
174
EXTRACT/FEROS ? ff_extr GSNN >Null
175
!EXTRACT/FEROS ? ff_extr GSNN
178
IF P1(1:1) .NE. "A" THEN
181
WRITE/OUT "Next step is reduction of ThAr spectrum"
184
INQUIRE/KEY reply "Press return to continue ; -1 to stop " ?
185
IF {reply} .LT. 0 @s ferosdemo,finish
188
!*************************************ThAr*****************************
190
LOAD/IMA ferosThAr sc=-2 cuts=0,1000
191
!------------------------------------------------------------------------------
192
! background and extract ThAr spectrum image
193
!------------------------------------------------------------------------------
197
WRITE/OUT "*** determine and subtract background form ThAr spectrum..."
201
SET/FEROS FLAT_IMG=ThArback
202
BACKGR/FEROS ferosThAr
204
SET/FEROS STRAIGHT_IMG=str
205
EXTRACT/FEROS ? thar_extr GSNN >Null
208
IF P1(1:1) .NE. "A" THEN
211
WRITE/OUT "Next step is wavelength calibration"
214
INQUIRE/KEY reply "Press return to continue ; -1 to stop " ?
215
IF {reply} .LT. 0 @s ferosdemo,finish
218
!------------------------------------------------------------------------------
219
! search for emission lines in ThAr spectrum
220
!------------------------------------------------------------------------------
225
WRITE/OUT "*** search for emission lines in ThAr spectrum..."
229
SET/FEROS LINE_POS_TBL=linepos
230
SEARCH/FEROS thar_extr >Null
234
!------------------------------------------------------------------------------
235
! wavelength calibration, check it
236
!------------------------------------------------------------------------------
240
WRITE/OUT "*** wavelength calibration..."
244
CALIBRATE/FEROS >Null
245
set/gra xa ya=-0.02,0.02 colo
246
plo/tab {LINE_POS_TBL}1 :wave :residual
249
IF P1(1:1) .NE. "A" THEN
252
WRITE/OUT "Next step is reduction of object spectrum"
255
INQUIRE/KEY reply "Press return to continue ; -1 to stop " ?
256
IF {reply} .LT. 0 @s ferosdemo,finish
260
!*************************************object*****************************
262
LOAD/IMA ferosHD5980 sc=-2 cuts=0,1000
264
!------------------------------------------------------------------------------
265
! background stellar spectrum image
266
!------------------------------------------------------------------------------
269
WRITE/OUT "*** determine and subtract background from stellar spectrum..."
273
SET/FEROS RAW_IMG=ferosHD5980 FLAT_IMG=HD5980back
274
BACKGR/FEROS {RAW_IMG}
279
WRITE/OUT "*** optimum extraction for both fibers..."
280
WRITE/OUT "*** this may take some time..."
284
EXTRACT/FEROS ? opt_extr GONN >Null
288
WRITE/OUT "*** standard extraction for both fibers..."
292
EXTRACT/FEROS ? std_extr GSNN >Null
295
IF P1(1:1) .NE. "A" THEN
298
WRITE/OUT "Next step is flat-fielding and wavelength calibration"
301
INQUIRE/KEY reply "Press return to continue ; -1 to stop " ?
302
IF {reply} .LT. 0 @s ferosdemo,finish
305
!------------------------------------------------------------------------------
306
! flat-field stellar spectrum
307
!------------------------------------------------------------------------------
310
WRITE/OUT "*** flat-fielding stellar spectrum..."
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
320
!------------------------------------------------------------------------------
321
! rebin stellar spectrum
322
!------------------------------------------------------------------------------
327
WRITE/OUT "*** rebinning stellar spectrum to constant steps in lambda..."
331
REBIN/FEROS std_unbl ? std_reb I 0.05
332
REBIN/FEROS opt_unbl ? opt_reb I 0.05
335
!------------------------------------------------------------------------------
337
!------------------------------------------------------------------------------
342
WRITE/OUT "*** merge orders..."
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
352
!------------------------------------------------------------------------------
354
!------------------------------------------------------------------------------
357
WRITE/OUT "*** check overlapping of orders..."
360
set/gra xa=5300,6000 ya=0,0.15
372
IF P1(1:1) .NE. "A" THEN
375
WRITE/OUT "Next step is check of optimum extraction"
378
INQUIRE/KEY reply "Press return to continue ; -1 to stop " ?
379
IF {reply} .LT. 0 @s ferosdemo,finish
382
!------------------------------------------------------------------------------
383
! check optimum extraction
384
!------------------------------------------------------------------------------
387
WRITE/OUT "*** check optimum extraction..."
390
set/gra xa=4200,4500 ya=0,0.15
394
ove opt_mer1 ? ? -0.02
400
!------------------------------------------------------------------------------
402
!------------------------------------------------------------------------------
408
WRITE/OUT "*** End of Tutorial ***"