1
! @(#)lnreduce.prg 19.1 (ES0-DMD) 02/25/03 14:24:50
2
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++
3
!.COPYRIGHT (C) 1993 European Southern Observatory
5
!.AUTHORS Pascal Ballester (ESO/Garching)
6
! Cristian Levin (ESO/La Silla)
7
!.KEYWORDS Spectroscopy, Long-Slit
8
!.PURPOSE Batch reduction of data.
9
!.VERSION 1.0 Package Creation 17-MAR-1993
10
!-------------------------------------------------------
12
define/param P1 ? CHAR "Input Catalog : "
15
! Now process the input catalog. The variable image stores the current image.
16
def/loc exttab/c/1/80 " " all
17
def/loc extima/c/1/80 " " all
18
def/loc rebima/c/1/80 " " all
19
def/loc ndark/c/1/80 " " all
20
def/loc partbl/c/1/80 " " all
21
def/loc parwlc/c/1/80 " " all
22
def/loc image/c/1/80 " " all
23
def/loc outima/c/1/80 " " all
24
def/loc partab/c/1/80 " " all
27
def/loc rebmet/i/1/1 0
28
def/loc exairm/i/1/1 0
30
def/loc n_test/i/1/1 0
31
def/loc redstrt/d/1/1 0.
32
def/loc redend/d/1/1 0.
33
def/loc redstp/d/1/1 0.
35
def/loc idxout/i/1/1 'outnumb'
36
def/loc incat/c/1/80 " " all
38
indx = m$index(p1, ".cat")
40
write/keyw incat/c/1/80 'p1'.cat
42
write/keyw incat/c/1/80 'p1'
45
write/keyw partab/c/1/80 'session'
46
indx = m$index(session, ".tbl")
49
write/keyw partab/c/1/80 'session(1:{indx})'
55
write/keyw exttab/c/1/80 " " all
56
write/keyw extima/c/1/80 " " all
57
write/keyw partbl/c/1/80 " " all
58
write/keyw parwlc/c/1/80 " " all
59
write/keyw ndark/c/1/80 " " all
60
write/keyw rebima/c/1/80 " " all
62
store/frame image 'incat' ? CLEAN
64
VERIFY/LONG 'image' IMA
66
indx = m$index(image, ".bdf")
69
write/keyw image/c/1/80 'image(1:{indx})'
72
if outputf(1:1) .eq. " " then
73
write/keyw outima/c/1/80 'image'_red
75
write/keyw outima/c/1/80 'outputf''idxout'
79
write/out processing image 'image'...
81
-COPY 'image'.bdf tmp_comp.bdf
82
if BIASOPT(1:1) .eq. "Y" then
83
n_test = M$TSTNO('bias')
85
VERIFY/LONG 'bias' IMA
86
comp/image tmp_comp1 = tmp_comp - 'bias'
87
rename/image tmp_comp1 tmp_comp
90
if DARKOPT(1:1) .eq. "Y" then
91
VERIFY/LONG 'dark' OTIME
92
write/keyw ndark/c/1/80 'dark'
93
comp/image tmp_dark = 'dark' / '{dark},o_time(7)' * '{image},o_time(7)'
94
comp/image tmp_comp1 = tmp_comp - tmp_dark
95
rename/image tmp_comp1 tmp_comp
98
if FLATOPT(1:1) .eq. "Y" then
99
n_test = M$TSTNO('flat')
101
VERIFY/LONG 'flat' IMA
102
comp/image tmp_comp1 = tmp_comp / 'flat'
103
rename/image tmp_comp1 tmp_comp
106
copy/dd 'image' lhcuts tmp_comp
108
if ROTOPT(1:1) .eq. "Y" then
109
write/out "rotating..."
110
rotate/clock tmp_comp tmp_comp_rot
111
rename/image tmp_comp_rot tmp_comp
112
write/desc tmp_comp start/d/2/1 'rotstep(1)'
113
write/desc tmp_comp step/d/2/1 'rotstep(2)'
116
if TRIMOPT(1:1) .eq. "Y" then
117
write/out "extracting subimage..."
118
extract/image 'outima' = tmp_comp[@'trim(1)',@'trim(2)':@'trim(3)',@'trim(4)']
121
-COPY tmp_comp.bdf 'outima'.bdf
124
write/keyw rebima/c/1/80 'image'rb_tmp
125
if REBOPT(1:1) .eq. "Y" then
126
write/out "rebinning..."
127
redstrt = '{partab}COE.tbl,REBSTRT'
128
redend = '{partab}COE.tbl,REBEND'
129
redstp = '{partab}COE.tbl,REBSTP'
130
REBIN/LONG 'outima' 'rebima' 'redstrt','redend','redstp' 'rebmtd' 'partab'COE.tbl
131
-COPY 'rebima'.bdf 'outima'.bdf
134
write/keyw extima/c/1/80 'image'_ext
135
if EXTOPT(1:1) .eq. "Y" then
136
write/out "extinction correction..."
137
EXTINCTION/LONG 'outima' 'extima'
138
-COPY 'extima'.bdf 'outima'.bdf
142
if RESPOPT(1:1) .eq. "Y" then
143
write/out "flux calibration..."
144
CALIBRATE/FLUX 'outima' tmp_comp1
145
rename/image tmp_comp1 'outima'
148
DELETE/IMAGE 'rebima'.bdf NO
149
DELETE/IMAGE 'extima'.bdf NO
150
write/out output image is 'outima'...
154
-DELETE tmp_in.cat tmp_dark.bdf tmp_flat.bdf
157
write/out "Batch reduction done."