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

« back to all changes in this revision

Viewing changes to contrib/obs/ntt/wfocus.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
! @(#)wfocus.prg        19.1 (ES0-DMD) 02/25/03 13:28:19
 
2
!===========================================================================
 
3
! Copyright (C) 1995 European Southern Observatory (ESO)
 
4
!
 
5
! This program is free software; you can redistribute it and/or 
 
6
! modify it under the terms of the GNU General Public License as 
 
7
! published by the Free Software Foundation; either version 2 of 
 
8
! the License, or (at your option) any later version.
 
9
!
 
10
! This program is distributed in the hope that it will be useful,
 
11
! but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
! GNU General Public License for more details.
 
14
!
 
15
! You should have received a copy of the GNU General Public 
 
16
! License along with this program; if not, write to the Free 
 
17
! Software Foundation, Inc., 675 Massachusetss Ave, Cambridge, 
 
18
! MA 02139, USA.
 
19
!
 
20
! Corresponding concerning ESO-MIDAS should be addressed as follows:
 
21
!       Internet e-mail: midas@eso.org
 
22
!       Postal address: European Southern Observatory
 
23
!                       Data Management Division 
 
24
!                       Karl-Schwarzschild-Strasse 2
 
25
!                       D 85748 Garching bei Muenchen 
 
26
!                       GERMANY
 
27
!===========================================================================
 
28
!
 
29
! @(#)wfocus.prg        19.1 (ESO-ASD) 02/25/03 13:28:19
 
30
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
31
!.IDENT      wfocus.prg
 
32
!.PURPOSE    Wedge focus in the displayed image
 
33
!.USE        @c wfocus
 
34
!.AUTHOR     Cristian Levin
 
35
!.VERSION    1.0       01/06/92  Creation
 
36
!.VERSION    2.0       17/05/94  Cleaned up - K.Banse
 
37
!.VERSION    2.1       10/01/95  implementation of parameters file (CL)
 
38
!.VERSION    2.2       14/09/95  remove CLEAR/CHAN OVER - KB
 
39
!.KEYWORDS
 
40
! --------------------------------------------------------------
 
41
!
 
42
define/param p8 + ? "Enter input_spec for center/gauss:"
 
43
if p8(1:1) .eq. "+" then
 
44
   define/local centin/c/1/6 CURSOR
 
45
else
 
46
   define/local centin/c/1/60 {p8}
 
47
endif
 
48
!
 
49
! EXTERNAL VARIABLES:
 
50
! teloffs1, teloffs2, camoffs1, camoffs2, signwedg, distwedg
 
51
!
 
52
define/local dx/r/1/1 0.0
 
53
define/local dy/r/1/1 0.0
 
54
define/local dtelf/r/1/1 0.0
 
55
define/local yleft/r/1/1 0.0
 
56
define/local yright/r/1/1 0.0
 
57
define/local dcamf/r/1/1 0.0
 
58
 
59
center/gauss {centin} focleft
 
60
if outputi(1) .eq. 0 then
 
61
   write/out
 
62
   write/out Invalid number of coordinates.
 
63
   return
 
64
endif
 
65
 
66
dx = distwedg
 
67
 
68
compute/table focleft :xstart = :xstart + {dx}
 
69
compute/table focleft :xend = :xend + {dx}
 
70
 
71
define/local ioff/i/1/2 0,0
 
72
if mid$sess(16:20) .eq. "94NOV" then
 
73
   ioff = ididev(6)*ididev(15)+1           !offset into keyword IDIMEMC
 
74
else
 
75
   ioff = 1                                !offset into keyword IDIMEMC
 
76
endif
 
77
ioff(2) = ioff(1)+19
 
78
define/local cmc/c/1/20 {idimemc({ioff}:{ioff(2)})}
 
79
center/gauss {cmc},focleft focright
 
80
 
81
set/midas output=no ! we don't want output on the screen...
 
82
 
83
statist/table focleft :ycen
 
84
yleft = outputr(3)     ! minimum value
 
85
statist/table focright :ycen
 
86
yright = outputr(3)    ! minimum value
 
87
 
88
set/midas output=yes
 
89
 
90
! Y-shift
 
91
dy = signwedg * (yright-yleft)
 
92
!
 
93
! TELESCOPE focus offset
 
94
dtelf = teloffs1 * dy * teloffs2
 
95
!
 
96
! RILD camera focus offset
 
97
dcamf = camoffs1 * dy * camoffs2
 
98
 
99
write/out
 
100
write/out
 
101
set/format F9.3
 
102
write/out Y-shift = {dy}
 
103
write/out RILD camera focus offset = {dcamf}
 
104
write/out
 
105
set/format F9.3
 
106
write/out TELESCOPE focus offset = {dtelf}
 
107
 
108
outputr(1) = dy
 
109
outputr(2) = dcamf
 
110
outputr(3) = dtelf