1
C @(#)averpr.for 19.1 (ES0-DMD) 02/25/03 13:25:31
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===========================================================================
29
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
33
C subroutine AVERPR version 1.2 830914
34
C A. Kruszewski ESO Garching
36
C modified version 1.3 870303
37
C A. Kruszewski Obs. de Geneve
45
C using a two-dimensional profile "PRFL" it calculates average
46
C one-dimensional profile "AVPR" and a number of significant
53
C PRFL real*4 array two-dimensional profile
54
C IHED integer*4 radial dimension of profile in pixels
55
C TRSH real*4 limiting treshold for object detection
56
C ICNT integer*4 array numbers of used pixels at calculating
61
C AVPR real*4 array one-dimensional profile
62
C LIM integer*4 number of significant profile rings
64
C-----------------------------------------------------------------------
65
SUBROUTINE AVERPR(IHED, PRFL, TRSH, ICNT, AVPR,
66
& IAPR, KCLN, KSAT, LIM)
69
INCLUDE 'MID_REL_INCL:INVENT.INC/NOLIST'
74
INTEGER ICNT(8,0:IHED)
76
INTEGER IAPR(0:MAXSUB)
91
C *** Calculates averaged over octants profile AVPR.
102
IF ( ICNT(L,K) .EQ. -1 ) THEN
107
TEMP = TEMP + ICNT(L,K) * PRFL(L,K)
111
IF ( NK .GT. 0 ) THEN
121
C *** Check how many profile rings are significantly above
122
C *** the sky background. Two profile rings with average
123
C *** less than 0.3*TRSH are a condition for terminating
124
C *** the profile. Skip invalid central points first.
127
IF ( IAPR(0) .EQ. 0 ) THEN
136
IF ( IAPR(K) .EQ. 0 ) THEN
144
& ( MAX( AVPR(K-1) , AVPR(K) ) .GT. TRSH3 )
146
& ( .NOT. ( ( AVPR(K) .GT. AVPR(K-1) )
148
& ( AVPR(K-1) .LT. TRSH3 )
150
& (IAPR(K-1) .GT. 0 ) ) )
152
& ( AVPR(K+1) .GT. (-TRSH) ) ) GOTO 50
154
C *** Number of significant profile rings is defined as LIM.
159
LIM = MIN( IHED , K )
163
C *** Find extend of saturation KSAT.
168
IF ( IAPR(L) .EQ. -1 .OR. IAPR(L) .EQ. 0 ) GOTO 60
171
C *** Find extend of non-cleaned profile.
176
c IF ( IAPR(L) .GT. 0 .AND. L .LT. LIM ) GOTO 70
178
c IF ( KCLN . EQ. KSAT ) THEN
182
C *** Set the remaining values to zero.
184
IF ( LIM .LT. MAXSUB ) THEN
186
DO 80 L = K1 , MAXSUB