diff options
| author | Enrico Rossi <e.rossi@tecnobrain.com> | 2018-11-03 17:52:26 +0100 |
|---|---|---|
| committer | Enrico Rossi <e.rossi@tecnobrain.com> | 2018-11-03 17:52:26 +0100 |
| commit | b4aebf2d137b892f53503b13785ecae900062ff7 (patch) | |
| tree | 3ba99b2baec2292f2e13bfe90a5e401a5f4c47a5 /lib/slope.f90 | |
| parent | 37f727ac0746fd85504aa46c1f023c09b3eff33a (diff) | |
New upstream version 1.9.1+repackupstream/1.9.1+repack
* Drop local hamlib copy (commit d1b545be).
* Drop local boost copy (1.63.0).
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 |
