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)
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.
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.
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,
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
27
C===========================================================================
30
SUBROUTINE GUESS (MODE,COEFF,SIZE,IDEG)
32
C --- Reads descriptors of table line and load initial
33
C --- coefficients of the dispersion relation X = f(lambda).
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.
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
46
C GUESSI/I/5/1 Degree of the regression
47
C GUESSD/D/1/20 Coefficients of the regression.
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.
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
61
C --- Read keyword WLCMTD and check if Guess mode. Optionally read
64
CALL STKRDC('IN_A',1,1,8,IACT,WLCMTD,KUN,KNUL,STATUS)
67
IF (WLCMTD(1:1).EQ.'G' .OR. WLCMTD(1:1).EQ.'g') THEN
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)
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)