From 791b39fce5d4e1194cec6914891fc38509e12d79 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sat, 30 Jan 2021 11:36:43 -0500 Subject: [PATCH] Estimate rms of ccf2 without using the 2-dimensional ccf(). --- lib/qra/q65/q65.f90 | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/lib/qra/q65/q65.f90 b/lib/qra/q65/q65.f90 index c7eb216a4..f7f2cf665 100644 --- a/lib/qra/q65/q65.f90 +++ b/lib/qra/q65/q65.f90 @@ -169,19 +169,9 @@ subroutine q65_dec0(iavg,nutc,iwave,ntrperiod,nfqso,ntol,ndepth,lclearave, & endif ! Estimate rms on ccf baseline - sq=0. - nsq=0 - jd=(lag2-lag1)/4 - do i=-ia2,ia2 - do j=lag1,lag2 - if(abs(j-jpk).gt.jd .and. abs(i-ipk).gt.ia/2) then - sq=sq + ccf(i,j)**2 - nsq=nsq+1 - endif - enddo - enddo - rms=sqrt(sq/nsq) - smax=ccf(ipk,jpk) + call pctile(ccf2(-ia2:ia2),2*ia2+1,40,base) + rms=0.6*base !Empirical constant 0.6 + smax=maxval(ccf2) snr1=smax/rms ccf2=ccf2/rms if(snr1.gt.10.0) ccf2=(10.0/snr1)*ccf2