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

« back to all changes in this revision

Viewing changes to contrib/invent/libsrc/prflch.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 @(#)prflch.for        19.1 (ES0-DMD) 02/25/03 13:25:37
 
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
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
30
C.IDENTIFICATION
 
31
C  subroutine PRFLCH         version 2.0       870725
 
32
C  A. Kruszewski             ESO Garching
 
33
C.KEYWORDS
 
34
C  profiles
 
35
C.PURPOSE
 
36
C  It checks if an average profile AVPR goes down with the increasing
 
37
C  radius K at least as steep as p.s.f. multiplied by a factor DNEB.
 
38
C  If not then a value of an image size LIM is adjusted.
 
39
C.INPUT/OUTPUT
 
40
C  input arguments
 
41
C  AVPR        real*4 array      one-dimensional profile
 
42
C  LIM         integer*4         number of significant profile rings
 
43
C  KSAT        integer*4         number of saturated profile rings
 
44
C  HCUT        real*4            saturation level
 
45
C  STPR        real*4 array      logarithmic p.s.f.
 
46
C  DNEB        integer*4         rejection factor
 
47
C  output arguments
 
48
C  LIM         integer*4         number of significant profile rings
 
49
C-----------------------------------------------------------------------
 
50
       SUBROUTINE PRFLCH(AVPR, IHED, KSAT, HCUT, APSF, DNEB , LIM)
 
51
C
 
52
       IMPLICIT NONE
 
53
C
 
54
       INTEGER   IHED
 
55
       REAL      APSF(0:IHED)
 
56
       INTEGER   KSAT
 
57
       REAL      HCUT
 
58
       REAL      AVPR(0:IHED)
 
59
       REAL      DNEB
 
60
       INTEGER   LIM
 
61
C
 
62
       INTEGER   IC
 
63
       INTEGER   KK, KL
 
64
       REAL      TEMP
 
65
C
 
66
       IC = 0
 
67
       KK = MAX(KSAT+2,3)
 
68
       IF (KK .GE. LIM) THEN
 
69
          RETURN
 
70
       ENDIF
 
71
       KL = KK - 1
 
72
       IF (KL .LT. 0) THEN
 
73
          RETURN
 
74
       ENDIF
 
75
C
 
76
10     CONTINUE
 
77
       IF (.NOT.(KK.LE.LIM .AND. AVPR(KK).GT.0.0 .AND. IC.EQ.0)) THEN
 
78
          GOTO 20
 
79
       ENDIF
 
80
       TEMP   = (AVPR(KL)/AVPR(KK)) - DNEB*(APSF(KL)/APSF(KK))
 
81
       IF (TEMP .LT. 0.0) THEN
 
82
          IC = 1
 
83
       ENDIF
 
84
       KK = KK + 1
 
85
       GOTO 10
 
86
C
 
87
20     CONTINUE
 
88
       IF (IC .EQ. 1) THEN
 
89
           LIM = MAX(KK-1, 4)
 
90
       ENDIF
 
91
C
 
92
       RETURN
 
93
       END