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

« back to all changes in this revision

Viewing changes to stdred/long/proc/lnident.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
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
2
!.COPYRIGHT   (C) 1993-2005 European Southern Observatory
 
3
!.IDENT       lnident.prg
 
4
!.AUTHORS     Pascal Ballester (ESO/Garching) 
 
5
!             Cristian Levin   (ESO/La Silla)
 
6
!.KEYWORDS    Spectroscopy, Long-Slit
 
7
!.PURPOSE     
 
8
!                line identification in long slit reduction
 
9
!                command:
 
10
!                          IDENTIFY/LONG
 
11
!
 
12
!.VERSION     1.0  Package Creation  17-MAR-1993  
 
13
! 050531        last modif
 
14
 
15
!-------------------------------------------------------
 
16
!
 
17
CROSSREF wlc ystart lintab  tol
 
18
!
 
19
define/param  p1  {wlc}     CHAR  "Wavelength calibration frame: "
 
20
define/param  p2  {ystart}  NUMB  "Ystart: "
 
21
define/param  p3  {lintab}  CHAR  "Line table: "
 
22
define/param  p4  +   N   "Error:"
 
23
!
 
24
define/local cmd/c/1/20 "{mid$cmnd} "           !copy Midas command string
 
25
define/local toler/d/1/1 0.
 
26
if p4(1:1) .eq. "+"  then
 
27
   toler = 4. * step(1)
 
28
else
 
29
   toler = {p4}
 
30
endif
 
31
!
 
32
verify/long {p1} IMA
 
33
set/long  WLC={p1}  YSTART={p2}   LINTAB={p3} 
 
34
!
 
35
graph/spec
 
36
reset/graph
 
37
!
 
38
if ystart .eq. 0  ystart = npix(2)/2
 
39
compute/table   {lintab}  :IDENT=NULL
 
40
@s lnident,seline
 
41
!
 
42
if outputi(1) .eq. 0  then
 
43
   write/out "Error: Wrong parameter YSTART = {YSTART}"
 
44
   return/exit
 
45
endif
 
46
!
 
47
if cmd(1:1) .eq. "X" then
 
48
   set/gcursor ? c_hair
 
49
   $ $GUI_EXE/ident.exe {aux_mode(3)} &
 
50
   return
 
51
endif
 
52
!
 
53
plot/row          {WLC}       @{YSTART} 
 
54
identify/gcursor  {LINTAB}    :IDENT :X   {TOLER}
 
55
select/table      {LINTAB}     ALL
 
56
 
 
57
 
 
58
ENTRY SELINE
 
59
 
 
60
define/param p1  {LINTAB}  TAB
 
61
define/param p2  {YSTART}  NUMB
 
62
!
 
63
define/local  midscan/D/1/1  0. 
 
64
define/local  wcbin/D/1/1    0.
 
65
 
 
66
if {p2} .lt. 0 .or. {p2} .gt. npix(2) then
 
67
   write/out "Error: Wrong parameter YSTART = {p2}"
 
68
   return/exit
 
69
endif
 
70
!
 
71
wcbin = M$ABS(YSTEP*STEP(2)/2.)
 
72
!
 
73
if {p2} .eq. 0 .and. npix(2) .eq. 1 then
 
74
   midscan = 1.0
 
75
   wcbin = 0.2
 
76
elseif {p2} .eq. 1  .or. {p2} .eq. npix(2) then
 
77
   midscan  = start(2) + ({P2}-1.)*step(2)
 
78
else
 
79
   midscan  = start(2) + ({P2}-0.9)*step(2)
 
80
endif
 
81
!
 
82
select/table {p1} ABS(:Y-({midscan})).le.{wcbin}
 
83
!
 
84
if outputi(1) .eq. 0  then
 
85
   write/out "Error: Wrong parameter YSTART = {p2}"
 
86
   return/exit
 
87
endif