diff options
Diffstat (limited to 'lib/slope.f90')
| -rw-r--r-- | lib/slope.f90 | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/slope.f90 b/lib/slope.f90 index 0b2b98da..e8420979 100644 --- a/lib/slope.f90 +++ b/lib/slope.f90 @@ -1,7 +1,7 @@ subroutine slope(y,npts,xpk) ! Remove best-fit slope from data in y(i). When fitting the straight line, -! ignore the peak around xpk +/- 2 bins +! ignore the peak around xpk +/- 4 bins real y(npts) @@ -12,7 +12,7 @@ subroutine slope(y,npts,xpk) sumxy=0. sumy2=0. do i=1,npts - if(abs(i-xpk).gt.2.0) then + if(abs(i-xpk).gt.4.0) then sumw=sumw + 1.0 x=i sumx=sumx + x @@ -30,9 +30,9 @@ subroutine slope(y,npts,xpk) sq=0. do i=1,npts y(i)=y(i)-(a + b*i) - if(abs(i-xpk).gt.2.0) sq=sq + y(i)**2 + if(abs(i-xpk).gt.4.0) sq=sq + y(i)**2 enddo - rms=sqrt(sq/(sumw-2.0)) + rms=sqrt(sq/(sumw-4.0)) y=y/rms return |
