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

« back to all changes in this revision

Viewing changes to stdred/spec/libsrc/guess.for

  • 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
C @(#)guess.for 19.1 (ES0-DMD) 02/25/03 14:29:01
 
2
C===========================================================================
 
3
C Copyright (C) 1995 European Southern Observatory (ESO)
 
4
C
 
5
C This program is free software; you can redistribute it and/or 
 
6
C modify it under the terms of the GNU General Public License as 
 
7
C published by the Free Software Foundation; either version 2 of 
 
8
C the License, or (at your option) any later version.
 
9
C
 
10
C This program is distributed in the hope that it will be useful,
 
11
C but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
C GNU General Public License for more details.
 
14
C
 
15
C You should have received a copy of the GNU General Public 
 
16
C License along with this program; if not, write to the Free 
 
17
C Software Foundation, Inc., 675 Massachusetss Ave, Cambridge, 
 
18
C MA 02139, USA.
 
19
C
 
20
C Corresponding concerning ESO-MIDAS should be addressed as follows:
 
21
C       Internet e-mail: midas@eso.org
 
22
C       Postal address: European Southern Observatory
 
23
C                       Data Management Division 
 
24
C                       Karl-Schwarzschild-Strasse 2
 
25
C                       D 85748 Garching bei Muenchen 
 
26
C                       GERMANY
 
27
C===========================================================================
 
28
C
 
29
 
 
30
      SUBROUTINE GUESS (MODE,COEFF,SIZE,IDEG)
 
31
 
 
32
C --- Reads descriptors of table line and load initial
 
33
C --- coefficients of the dispersion relation X = f(lambda).
 
34
C
 
35
C INPUT:
 
36
C KEYNAM  CHAR*8  Generic name of descriptors storing the coefficients
 
37
C SIZE    INTG    Size of double precision array COEFF
 
38
C IDEG    INTG    Degree of the fit. If guess option, this value is 
 
39
C                 checked against the stored value.
 
40
C KEYWORDS INPUT:
 
41
C IN_A/C/1/60     Mode of operation IN_A  = GUESS for guess mode
 
42
C IN_B/C/1/60     Name of guess table.
 
43
C INPUTD/D/1/1    Shift in pixels
 
44
C
 
45
C DESCRIPTORS INPUT:
 
46
C GUESSI/I/5/1    Degree of the regression
 
47
C GUESSD/D/1/20   Coefficients of the regression.
 
48
C
 
49
C OUTPUT:
 
50
C MODE    INTG    Mode=0 (no Guess) or Mode=1 (Guess)
 
51
C COEFF   REAL*8  Coefficients
 
52
C IDEG    INTG    Stored value if guess option.
 
53
C
 
54
 
 
55
      IMPLICIT NONE
 
56
      INTEGER  MODE, SIZE, IDEG, GDEG
 
57
      INTEGER  KUN, KNUL, STATUS, IACT, TID
 
58
      CHARACTER  GUETAB*60, WLCMTD*8
 
59
      DOUBLE PRECISION COEFF(SIZE), SHIFT
 
60
 
 
61
C --- Read keyword WLCMTD and check if Guess mode. Optionally read
 
62
C --- keyword GUETAB.
 
63
 
 
64
      CALL STKRDC('IN_A',1,1,8,IACT,WLCMTD,KUN,KNUL,STATUS)
 
65
 
 
66
      MODE = 0
 
67
      IF (WLCMTD(1:1).EQ.'G' .OR. WLCMTD(1:1).EQ.'g') THEN
 
68
          MODE = 1
 
69
          CALL STKRDC('IN_B',1,1,60,IACT,GUETAB,KUN,KNUL,STATUS)
 
70
          CALL TBTOPN(GUETAB, 10, TID, STATUS)
 
71
          CALL STDRDI(TID,'GUESSI',6,1,IACT,GDEG,KUN,KNUL,STATUS)
 
72
          IF (GDEG.NE.IDEG) THEN
 
73
             CALL STTPUT ('Changed degree to the value
 
74
     . stored in guess table',STATUS)
 
75
             IDEG = GDEG
 
76
          ENDIF
 
77
          CALL STDRDD(TID,'GUESSD',1,20,IACT,COEFF,KUN,KNUL,STATUS)
 
78
          CALL STKRDD('INPUTD',1,1,IACT,SHIFT,KUN,KNUL,STATUS)
 
79
          COEFF(1) = COEFF(1) + SHIFT
 
80
          CALL TBTCLO(TID,STATUS)
 
81
      ENDIF
 
82
 
 
83
      RETURN
 
84
      END
 
85
 
 
86
 
 
87
 
 
88
 
 
89
 
 
90
 
 
91