1
C @(#)rlgrnt.for 19.1 (ES0-DMD) 02/25/03 13:25:38
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+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
31
C subroutine RLGRNT version 2.3 830916
32
C A. Kruszewski ESO Garching
33
C modified version 2.4 870304
34
C A. Kruszewski Obs. de Geneve
38
C calculates gradient in an observed profile relative to the
39
C standard stellar profile
40
C this relative gradient should be close to zero for stars
41
C negative for galaxies, and positive for majority of defects
43
C quantity -LOG10(AVPR)-SPRF , or in other words, deviations of
44
C an observed profile from the standard profile, is subjected to
45
C the regression with respect to a ring number K expressed
47
C the coefficient of regression is accepted as relative gradient
50
C AVPR real*4 array observed one-dimensional profile
51
C SPRF real*4 array cumulative standard profile
52
C HHCUT real*4 upper limit of usable data
53
C TRSH real*4 lower limiting treshold
55
C AVGR real*4 relative gradient
56
C SIGMA real*4 sigma of single data point
57
C-----------------------------------------------------------------------
58
SUBROUTINE RLGRNT(AVPR, SPRF, HHCUT, TRSH, AVGR, SIGMA)
61
INCLUDE 'MID_REL_INCL:INVENT.INC/NOLIST'
81
REAL X(0:MAXSUB), Y(0:MAXSUB)
95
BLIM = MIN( AVPR(0) , HHCUT )
96
ALIM = MAX( 0.01*BLIM , 0.5*TRSH )
99
C ****** Select usable part of an observed profile.
102
IF ( AVPR(L) .LT. ALIM .OR. L .GT. MAXSUB ) THEN
106
IF ( AVPR(L) .LT. HHCUT ) THEN
108
Y(L) = -ALOG10( AVPR(L) ) - SPRF(L)
119
C ****** Calculate root mean square deviation SIGMA of used data.
121
IF ( NN .GT. 1 ) THEN
122
CALL MEAN( YY , NN , AMEAN , SIGMA )
127
C ****** Calculate first approximation for relative gradient.
129
IF ( NN .GE. 2 ) THEN
130
CALL GRADET( L , X , Y , IW , AVGR , ZRLV , DVGR , SGGR )
131
IF ( NN .EQ. 2 ) THEN
143
C ****** Repeat calculations after rejecting
144
C ****** points deviating more than 1.4*SGGR.
147
IF ( IC .EQ. 0 ) GOTO 40
152
IF ( IW(L) .EQ. 1 ) THEN
153
IF ( ABS( DVGR(L) ) .GT. GRSL ) THEN
161
IF ( ID .EQ. 0 .OR. NN .LT. 2 ) THEN
164
CALL GRADET( MAXSUB , X , Y , IW , AVGR ,
165
& ZRLV , DVGR , SGGR )
166
IF ( NN .GT. 2 ) THEN