1
! @(#)necextr.prg 19.1 (ESO-DMD) 02/25/03 14:19:37
2
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++
3
!.COPYRIGHT (C) 1991 European Southern Observatory
5
!.AUTHOR Pascal Ballester, ESO - Garching
6
!.KEYWORDS Spectroscopy, Echelle,
7
!.PURPOSE Command EXTRACT/ECHELLE INPUT OUTPUT W,OFF,A[,WS,OFF1,OFF2]
8
!.VERSION 1.0 Creation 31-JUL-1991 PB
11
!-------------------------------------------------------
13
define/param p1 ? IMAGE "Enter input image:"
14
define/param p2 ? IMAGE "Enter output extracted orders:"
15
define/param p3 {slit} N "Extraction params (slit,offset or slit,ron,g,sigma):"
16
define/param p4 {extmtd} C "Extraction method"
18
! Check extraction method
20
define/local errflag/i/1/1 1
22
if p4(1:1) .eq. "L" ERRFLAG = 0
23
if p4(1:1) .eq. "A" ERRFLAG = 0
24
if p4(1:1) .eq. "O" ERRFLAG = 0
25
if errflag .eq. 0 then
26
set/echelle EXTMTD={p4}
28
error/echelle EXTRACT/ECHELLE EXTMTD
31
! Update extraction parameters
33
define/local w/r/1/4 0. all
35
if extmtd(1:1) .eq. "O" then
36
write/keyw w/r/1/4 {slit},{ron},{gain},{extsigma}
37
write/keyw w/r/1/4 {p3}
43
write/keyw w/r/1/2 {slit},{offset}
44
write/keyw w/r/1/2 {p3}
50
if slit .le. 0. error/echelle EXTRACT/ECHELLE SLIT
51
if echord(1) .le. 0 error/echelle EXTRACT/ECHELLE ECHORD(1)
52
if ron .lt. 0. error/echelle EXTRACT/ECHELLE RON
53
if gain .lt. 0. error/echelle EXTRACT/ECHELLE GAIN
54
if extsigma .lt. 0. error/echelle EXTRACT/ECHELLE EXTSIGMA
56
if extmtd(1:1) .eq. "O" then
57
extract/optimal {p1} {p2} {slit},{echord(4)},{echord(5)} -
58
{ron},{gain},{extsigma} {ordtab} COEFF
60
extr/order {p1} {p2} {w(1)},0.,{w(2)} {p4} {ordtab} -
61
COEFF {echord(4)},{echord(5)}