Added "getdphi" to do least-squares solution for Dphi.

Updated Makefile.in
Commented out Linux calls to usleep in sleep_msec, makes it hang.
Removed duplicate code from plrr.f90.


git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/map65@498 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2007-07-12 14:25:08 +00:00
parent f816f479fd
commit 53881351a8
5 changed files with 25 additions and 16 deletions

View File

@ -47,7 +47,7 @@ SRCS2F90 = astro0.F90 audio_init.F90 azdist0.f90 \
runqqq.F90 fivehz.F90 flushqqq.F90 \
rfile.f90 rfile3a.f90 spec.f90 map65a.F90 display.F90 \
getfile.F90 getfile2.F90 recvpkt.F90 savetf2.F90 \
symspec.f90 sec_midn.F90
symspec.f90 sec_midn.F90 getdphi.f90
SRCS2F77 = indexx.f gen65.f chkmsg.f \
gentone.f gencwid.f set.f db.f pctile.f sort.f ssort.f \

18
getdphi.f90 Normal file
View File

@ -0,0 +1,18 @@
subroutine getdphi(qphi)
real qphi(12)
s=0.
c=0.
do i=1,12
th=i*30/57.2957795
s=s+qphi(i)*sin(th)
c=c+qphi(i)*cos(th)
enddo
dphi=57.2957795*atan2(s,c)
write(11,1010) nint(dphi)
1010 format('Best-fit Dphi =',i4,' deg')
return
end

View File

@ -15,6 +15,7 @@ subroutine map65a(newdat)
character decoded*22,blank*22
include 'spcom.f90'
real short(3,NFFT) !SNR dt ipol for potential shorthands
real qphi(12)
include 'gcom2.f90'
include 'datcom.f90'
data blank/' '/
@ -249,6 +250,7 @@ subroutine map65a(newdat)
write(11,1010) nkHz,ndf,npol,nutc,dt,nsync2,decoded,nkv,nqual
1010 format(i3,i5,i4,i5.4,f5.1,i4,2x,a22,i5,i4,i4)
else
qphi(iloop)=sig(k,10)
write(11,1010) nkHz,ndf,npol,nutc,dt,nsync2,decoded,nkv, &
nqual,30*iloop
write(27,1011) 30*iloop,nkHz,ndf,npol,nutc, &
@ -267,6 +269,7 @@ subroutine map65a(newdat)
iloop=iloop+1
go to 2
endif
if(ndphi.eq.1 .and.iloop.eq.12) call getdphi(qphi)
if(nqd.eq.1) then
write(11,*) '$EOF'
call flushqqq(11)

View File

@ -40,17 +40,4 @@ program plrr
end program plrr
! To compile: % gfortran -o plrr plrr.f90 plrr_subs.c
real function sec_midn()
real*8 sec8,hrtime
sec_midn=secnds(0.0)
return
end function sec_midn
subroutine sleep_msec(n)
use dflib
call sleepqq(n)
return
end subroutine sleep_msec
! To compile: % gfortran -o plrr plrr.f90 sec_midn.F90 plrr_subs.c

View File

@ -21,7 +21,8 @@ subroutine sleep_msec(n)
#ifdef Win32
call sleepqq(n)
#else
call usleep(min(1,1000*n))
!m=min(1,n)
! call usleep(m)
#endif
return