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

« back to all changes in this revision

Viewing changes to stdred/long/proc/lnreduce.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
! @(#)lnreduce.prg      19.1 (ES0-DMD) 02/25/03 14:24:50
 
2
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
3
!.COPYRIGHT   (C) 1993 European Southern Observatory
 
4
!.IDENT       lnreduce.prg
 
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
!-------------------------------------------------------
 
11
!
 
12
define/param P1 ? CHAR "Input Catalog : "
 
13
 
 
14
 
 
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
 
25
def/loc catal/i/1/1 0
 
26
def/loc indx/i/1/1 0
 
27
def/loc rebmet/i/1/1 0
 
28
def/loc exairm/i/1/1 0
 
29
def/loc airm/r/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.
 
34
 
 
35
def/loc idxout/i/1/1 'outnumb'
 
36
def/loc incat/c/1/80 " " all
 
37
 
 
38
indx = m$index(p1, ".cat")
 
39
if indx .eq. 0 then
 
40
    write/keyw incat/c/1/80 'p1'.cat
 
41
else
 
42
    write/keyw incat/c/1/80 'p1'
 
43
endif
 
44
 
 
45
write/keyw partab/c/1/80 'session'
 
46
indx = m$index(session, ".tbl")
 
47
if indx .ne. 0 then
 
48
    indx = 'indx' - 1
 
49
    write/keyw partab/c/1/80 'session(1:{indx})'
 
50
endif
 
51
 
 
52
!!!!!
 
53
LOOP:
 
54
!!!!!
 
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
 
61
 
 
62
store/frame image 'incat' ? CLEAN
 
63
 
 
64
VERIFY/LONG 'image' IMA
 
65
 
 
66
indx = m$index(image, ".bdf")
 
67
if indx .ne. 0 then
 
68
    indx = 'indx' - 1
 
69
    write/keyw image/c/1/80 'image(1:{indx})'
 
70
endif
 
71
 
 
72
if outputf(1:1) .eq. " " then
 
73
    write/keyw outima/c/1/80 'image'_red
 
74
else
 
75
    write/keyw outima/c/1/80 'outputf''idxout'
 
76
    idxout = 'idxout' + 1
 
77
endif
 
78
!
 
79
write/out processing image 'image'...
 
80
!
 
81
-COPY 'image'.bdf tmp_comp.bdf
 
82
if BIASOPT(1:1) .eq. "Y" then
 
83
    n_test = M$TSTNO('bias')
 
84
    if n_test .eq. 0 -
 
85
        VERIFY/LONG  'bias' IMA
 
86
    comp/image tmp_comp1 = tmp_comp - 'bias'
 
87
    rename/image tmp_comp1 tmp_comp
 
88
endif
 
89
 
 
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
 
96
endif
 
97
 
 
98
if FLATOPT(1:1) .eq. "Y" then
 
99
    n_test = M$TSTNO('flat')
 
100
    if n_test .eq. 0 -
 
101
        VERIFY/LONG  'flat'  IMA
 
102
    comp/image tmp_comp1 = tmp_comp / 'flat'
 
103
    rename/image tmp_comp1 tmp_comp
 
104
endif
 
105
 
 
106
copy/dd 'image' lhcuts tmp_comp
 
107
 
 
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)'
 
114
endif
 
115
 
 
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)']
 
119
    del/image tmp_comp n
 
120
else
 
121
    -COPY tmp_comp.bdf 'outima'.bdf
 
122
endif
 
123
!
 
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
 
132
endif
 
133
 
 
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
 
139
endif
 
140
 
 
141
 
 
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'
 
146
endif
 
147
 
 
148
DELETE/IMAGE  'rebima'.bdf  NO
 
149
DELETE/IMAGE  'extima'.bdf  NO
 
150
write/out output image is 'outima'...
 
151
goto LOOP
 
152
 
 
153
CLEAN:
 
154
-DELETE tmp_in.cat tmp_dark.bdf tmp_flat.bdf 
 
155
 
 
156
write/out
 
157
write/out "Batch reduction done."