diff --git a/map65/libm65/polfit.f90 b/map65/libm65/polfit.f90 index 7013432e2..e01bbe6a9 100644 --- a/map65/libm65/polfit.f90 +++ b/map65/libm65/polfit.f90 @@ -56,15 +56,16 @@ subroutine polfit(y,npts,a) deltaa(j)=deltaa(j)*fn/3. ! write(*,4000) iter,j,a,deltaa,chisq2 !4000 format(2i2,2(2x,3f8.2),f12.5) - enddo + enddo ! j=1,nterms chisqr=fchisq_pol(y,npts,a) ! write(*,4000) 0,0,a,chisqr + if(chisqr.lt.1.0) exit if(deltaa(1).lt.0.01*(a(2)-a(1)) .and. deltaa(2).lt.0.01*(a(2)-a(1)) & .and. deltaa(3).lt.1.0) exit if(chisqr/chisqr0.gt.0.99) exit - a(3)=mod(a(3)+360.0,180.0) chisqr0=chisqr - enddo + enddo ! iter + a(3)=mod(a(3)+360.0,180.0) return end subroutine polfit diff --git a/map65/libm65/wideband_sync.f90 b/map65/libm65/wideband_sync.f90 index 65b5074ce..ee582549d 100644 --- a/map65/libm65/wideband_sync.f90 +++ b/map65/libm65/wideband_sync.f90 @@ -44,7 +44,7 @@ subroutine get_candidates(ss,savg,xpol,nfa,nfb,nts_jt65,nts_q65,cand,ncand) enddo jz=j -call wb_sync(ss,savg,xpol,jz,nfa,nfb) + call wb_sync(ss,savg,xpol,jz,nfa,nfb) tstep=2048.0/11025.0 !0.185760 s: 0.5*tsym_jt65, 0.3096*tsym_q65 df3=96000.0/NFFT