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

« back to all changes in this revision

Viewing changes to applic/general/libsrc/atest.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 @(#)atest.for 19.1 (ES0-DMD) 02/25/03 13:18:59
 
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
      SUBROUTINE ATEST(NX,NY,IN,HG,HL,OUT,M,OG,UL,OL,
 
30
     >                 NSG,NSL,ORD,TYP)
 
31
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
32
C
 
33
C  compares actual gradient and Laplaces with noise statistics and decides
 
34
C  if a pixel is significant on the actual order
 
35
C  OG,UL,OL : upper limit for gradients and lower and upper limits for 
 
36
C  Laplace-terms respectively; pixel values exceeding these
 
37
C  limits make the pixel significant. (in)
 
38
C  NSG,NSL  : number of pixels wich became significant at the actual 
 
39
C  order by gradient or Laplace respectively. (out)
 
40
C
 
41
C----------------------------------------------------------------------------
 
42
      IMPLICIT NONE
 
43
C
 
44
      CHARACTER*1 S,TYP
 
45
      INTEGER     NX,NY,ORD,NSG,NSL,I
 
46
      REAL       IN(1),HG(1),HL(1),OUT(1),OG,UL,OL,HHL,ORDR,M(1)
 
47
C
 
48
      ORDR=ORD
 
49
      S='L'
 
50
      NSG=0
 
51
      NSL=0
 
52
C
 
53
      DO 10 I=1,NX*NY
 
54
      IF (M(I).NE.0) GOTO 10          ! pixel already significant on lower order
 
55
      IF (TYP.NE.'S') GOTO 5
 
56
C
 
57
C *** test for filter type SMOOTH
 
58
      IF (HG(I).GE.OG) GOTO 2                     ! gradient significant
 
59
      HHL=HL(I)
 
60
      IF ((HHL.GE.OL).OR.(HHL.LE.UL)) GOTO 3      ! Laplace significant
 
61
      GOTO 10
 
62
C
 
63
    2 S = 'G'
 
64
    3 IF (S.EQ.'G') NSG=NSG+1
 
65
      IF (S.EQ.'L') NSL=NSL+1
 
66
      S='L'
 
67
      OUT(I)=IN(I)
 
68
      GOTO 9
 
69
C
 
70
    5 IF (TYP.NE.'G') GOTO 7
 
71
 
 
72
C *** test for filter type GRADIENT
 
73
      HHL=HG(I)
 
74
      IF(HHL.LT.OG) GOTO 10                       ! gradient not significant
 
75
      OUT(I)=HHL
 
76
      NSG=NSG+1
 
77
      GOTO 9
 
78
C
 
79
C *** test for filter type LAPLACE
 
80
    7 HHL=HL(I)
 
81
      IF ((HHL.LT.OL).AND.(HHL.GT.UL)) GOTO 10    ! Laplace not significant
 
82
      OUT(I)=HHL
 
83
      NSL=NSL+1
 
84
    9 M(I)=ORDR! mark significant pixel
 
85
   10 CONTINUE
 
86
C
 
87
      RETURN
 
88
      END