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

« back to all changes in this revision

Viewing changes to stdred/echelle/proc/necextr.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
! @(#)necextr.prg       19.1 (ESO-DMD) 02/25/03 14:19:37
 
2
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
3
!.COPYRIGHT   (C) 1991 European Southern Observatory
 
4
!.IDENT       echextr.prg
 
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
 
9
! 020322        last modif
 
10
 
11
!-------------------------------------------------------
 
12
!
 
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"
 
17
!
 
18
! Check extraction method
 
19
!
 
20
define/local errflag/i/1/1  1
 
21
 
 
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}
 
27
else
 
28
   error/echelle EXTRACT/ECHELLE  EXTMTD
 
29
endif
 
30
!
 
31
! Update extraction parameters
 
32
!
 
33
define/local w/r/1/4   0. all
 
34
!
 
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}
 
38
  slit     = w(1)
 
39
  ron      = w(2)
 
40
  gain     = w(3)
 
41
  extsigma = w(4)
 
42
else
 
43
  write/keyw w/r/1/2  {slit},{offset}
 
44
  write/keyw w/r/1/2  {p3}
 
45
  slit     = w(1)
 
46
  offset   = w(2)
 
47
endif
 
48
!
 
49
verify/echelle {p1}
 
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
 
55
!
 
56
if extmtd(1:1) .eq. "O" then
 
57
   extract/optimal {p1} {p2} {slit},{echord(4)},{echord(5)} -
 
58
                   {ron},{gain},{extsigma} {ordtab} COEFF
 
59
else
 
60
   extr/order {p1} {p2} {w(1)},0.,{w(2)} {p4} {ordtab} -
 
61
              COEFF {echord(4)},{echord(5)}
 
62
endif
 
63