Working on bandmap display ...

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/map65@347 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2007-01-12 21:31:16 +00:00
parent d0815b78c5
commit 61d7af040c
4 changed files with 195 additions and 187 deletions

View File

@ -9,7 +9,7 @@
! 16 c:/wsjt.reg ! 16 c:/wsjt.reg
! 17 wave files written to disk ! 17 wave files written to disk
! 18 test file to be transmitted (wsjtgen.f90) ! 18 test file to be transmitted (wsjtgen.f90)
! 19 ! 19 bandmap.txt
! 20 ! 20
! 21 ALL.TXT ! 21 ALL.TXT
! 22 kvasd.dat ! 22 kvasd.dat
@ -97,8 +97,10 @@ subroutine ftn_init
status='unknown') status='unknown')
#endif #endif
open(24,file=appdir(:iz)//'/tmp24.txt',status='unknown') ! open(24,file=appdir(:iz)//'/tmp24.txt',status='unknown', &
open(26,file=appdir(:iz)//'/tmp26.txt',status='unknown') ! share='denynone')
open(26,file=appdir(:iz)//'/tmp26.txt',status='unknown', &
share='denynone')
return return

View File

@ -1264,6 +1264,7 @@ def update():
except: except:
lines="" lines=""
bmtext.configure(state=NORMAL) bmtext.configure(state=NORMAL)
bmtext.delete('1.0',END)
bmtext.insert(END,' Freq DF Pol UTC\n') bmtext.insert(END,' Freq DF Pol UTC\n')
bmtext.insert(END,'--------------------------------------------\n') bmtext.insert(END,'--------------------------------------------\n')
for i in range(len(lines)): for i in range(len(lines)):

View File

@ -23,14 +23,24 @@ subroutine map65a
common/spcom/ss(4,322,NFFT) !169 MB: half-symbol spectra common/spcom/ss(4,322,NFFT) !169 MB: half-symbol spectra
data blank/' '/ data blank/' '/
data shmsg0/'ATT','RO ','RRR','73 '/ data shmsg0/'ATT','RO ','RRR','73 '/
data nfile/0/
save
include 'gcom2.f90' include 'gcom2.f90'
rewind 11
rewind 12
nfile=nfile+1
nutc=0744+nfile
infile='061111.0745'
write(infile(8:11),1001) nutc
1001 format(i4.4)
! read(infile(8:11),*) nutc
tskip=0. tskip=0.
fselect=0. fselect=0.
fselect=104.5303 fselect=104.5303
nmin=1 nmin=1
infile='061111.0745'
open(23,file='CALL3.TXT',status='unknown') open(23,file='CALL3.TXT',status='unknown')
@ -43,243 +53,238 @@ subroutine map65a
kk=0 kk=0
nkk=1 nkk=1
do nfile=1,nmin n=8*NSMAX
n=8*NSMAX call rfile3a(infile,id,n,ierr)
call rfile3a(infile,id,n,ierr) newdat=1
newdat=1 nz=n/8
nz=n/8 if(fselect.gt.0.0) then
read(infile(8:11),*) nutc
if(fselect.gt.0.0) then
! nfilt=2 should be faster (but doesn't work right?) ! nfilt=2 should be faster (but doesn't work right?)
nfilt=1 !nfilt=2 is faster for selected freq nfilt=1 !nfilt=2 is faster for selected freq
! freq=fselect+1.600 ! freq=fselect+1.600
freq=fselect freq=fselect
nflip=-1 !May need to try both +/- 1 nflip=-1 !May need to try both +/- 1
ipol=4 !Try all four? ipol=4 !Try all four?
dt=2.314240 !Not needed? dt=2.314240 !Not needed?
call decode1a(id,newdat,nfilt,freq,nflip,ipol,sync2, & call decode1a(id,newdat,nfilt,freq,nflip,ipol,sync2, &
a,dt,pol,nkv,nhist,qual,decoded) a,dt,pol,nkv,nhist,qual,decoded)
nsync2=nint(10.0*log10(sync2)) - 40 !### empirical ### nsync2=nint(10.0*log10(sync2)) - 40 !### empirical ###
nw=0 nw=0
! Insert 'OOO' if flip<0. ! Insert 'OOO' if flip<0.
write(11,1010) nutc,nsync1,nsync2,dt,ndf,nw,decoded, & write(11,1010) nutc,nsync1,nsync2,dt,ndf,nw,decoded, &
nkv,nqual nkv,nqual
1010 format(i4.4,i3,i4,f5.1,i5,i3,2x,a22,2i3) 1010 format(i4.4,i3,i4,f5.1,i5,i3,2x,a22,2i3)
ndecdone=1 ndecdone=1
endif endif
nfilt=1 nfilt=1
do i=1,NFFT do i=1,NFFT
short(1,i)=0. short(1,i)=0.
short(2,i)=0. short(2,i)=0.
short(3,i)=0. short(3,i)=0.
enddo enddo
call symspec(id,nz,ss,savg) call symspec(id,nz,ss,savg)
newspec=1 newspec=1
freq0=-999. freq0=-999.
sync10=-999. sync10=-999.
fshort0=-999. fshort0=-999.
sync20=-999. sync20=-999.
ntry=0 ntry=0
do i=ia,ib !Search over freq range do i=ia,ib !Search over freq range
freq=0.001*((i-1)*df - 23000) + 100.0 freq=0.001*((i-1)*df - 23000) + 100.0
! Find the local base level for each polarization; update every 10 bins. ! Find the local base level for each polarization; update every 10 bins.
if(mod(i-ia,10).eq.0) then if(mod(i-ia,10).eq.0) then
do jp=1,4 do jp=1,4
do ii=-50,50 do ii=-50,50
tavg(ii)=savg(jp,i+ii) tavg(ii)=savg(jp,i+ii)
enddo
call pctile(tavg,tmp,101,50,base(jp))
enddo enddo
endif call pctile(tavg,tmp,101,50,base(jp))
enddo
endif
! Find max signal at this frequency ! Find max signal at this frequency
smax=0. smax=0.
do jp=1,4 do jp=1,4
if(savg(jp,i)/base(jp).gt.smax) smax=savg(jp,i)/base(jp) if(savg(jp,i)/base(jp).gt.smax) smax=savg(jp,i)/base(jp)
enddo enddo
if(smax.gt.1.1) then if(smax.gt.1.1) then
ntry=ntry+1 ntry=ntry+1
! Look for JT65 sync patterns and shorthand square-wave patterns. ! Look for JT65 sync patterns and shorthand square-wave patterns.
call ccf65(ss(1,1,i),sync1,ipol,dt,flipk, & call ccf65(ss(1,1,i),sync1,ipol,dt,flipk, &
syncshort,snr2,ipol2,dt2) syncshort,snr2,ipol2,dt2)
shmsg=' ' shmsg=' '
! Is there a shorthand tone above threshold? ! Is there a shorthand tone above threshold?
if(syncshort.gt.1.0) then if(syncshort.gt.1.0) then
! ### Do shorthand AFC here (or maybe after finding a pair?) ### ! ### Do shorthand AFC here (or maybe after finding a pair?) ###
short(1,i)=syncshort short(1,i)=syncshort
short(2,i)=dt2 short(2,i)=dt2
short(3,i)=ipol2 short(3,i)=ipol2
! Check to see if lower tone of shorthand pair was found. ! Check to see if lower tone of shorthand pair was found.
do j=2,4 do j=2,4
i0=i-nint(j*53.8330078/df) i0=i-nint(j*53.8330078/df)
! Should this be i0 +/- 1, or just i0? ! Should this be i0 +/- 1, or just i0?
! Should we also insist that difference in DT be either 1.5 or -1.5 s? ! Should we also insist that difference in DT be either 1.5 or -1.5 s?
if(short(1,i0).gt.1.0) then if(short(1,i0).gt.1.0) then
fshort=0.001*((i0-1)*df - 23000) + 100.0 fshort=0.001*((i0-1)*df - 23000) + 100.0
! Keep only the best candidate within ftol. ! Keep only the best candidate within ftol.
if(fshort-fshort0.le.ftol .and. sync2.gt.sync20 & if(fshort-fshort0.le.ftol .and. sync2.gt.sync20 &
.and. nkk.eq.2) kk=kk-1 .and. nkk.eq.2) kk=kk-1
if(fshort-fshort0.gt.ftol .or. & if(fshort-fshort0.gt.ftol .or. &
sync2.gt.sync20) then sync2.gt.sync20) then
kk=kk+1 kk=kk+1
sig(kk,1)=nfile sig(kk,1)=nfile
sig(kk,2)=nutc sig(kk,2)=nutc
sig(kk,3)=fshort sig(kk,3)=fshort
sig(kk,4)=syncshort sig(kk,4)=syncshort
sig(kk,5)=dt2 sig(kk,5)=dt2
sig(kk,6)=45*(ipol2-1)/57.2957795 sig(kk,6)=45*(ipol2-1)/57.2957795
sig(kk,7)=0 sig(kk,7)=0
sig(kk,8)=snr2 sig(kk,8)=snr2
sig(kk,9)=0 sig(kk,9)=0
sig(kk,10)=0 sig(kk,10)=0
! sig(kk,11)=rms0 ! sig(kk,11)=rms0
sig(kk,12)=savg(ipol2,i) sig(kk,12)=savg(ipol2,i)
sig(kk,13)=0 sig(kk,13)=0
sig(kk,14)=0 sig(kk,14)=0
sig(kk,15)=0 sig(kk,15)=0
sig(kk,16)=0 sig(kk,16)=0
! sig(kk,17)=0 ! sig(kk,17)=0
sig(kk,18)=0 sig(kk,18)=0
msg(kk)=shmsg0(j) msg(kk)=shmsg0(j)
fshort0=fshort fshort0=fshort
sync20=sync2 sync20=sync2
nkk=2 nkk=2
endif
endif endif
enddo endif
endif enddo
endif
! Is sync1 above threshold? ! Is sync1 above threshold?
if(sync1.gt.1.0) then if(sync1.gt.1.0) then
! Keep only the best candidate within ftol. ! Keep only the best candidate within ftol.
! (Am I deleting any good decodes by doing this? Any harm in omitting ! (Am I deleting any good decodes by doing this? Any harm in omitting
! these statements??) ! these statements??)
if(freq-freq0.le.ftol .and. sync1.gt.sync10 .and. & if(freq-freq0.le.ftol .and. sync1.gt.sync10 .and. &
nkk.eq.1) kk=kk-1 nkk.eq.1) kk=kk-1
if(freq-freq0.gt.ftol .or. sync1.gt.sync10) then if(freq-freq0.gt.ftol .or. sync1.gt.sync10) then
nflip=nint(flipk) nflip=nint(flipk)
call decode1a(id,newdat,nfilt,freq,nflip,ipol, & call decode1a(id,newdat,nfilt,freq,nflip,ipol, &
sync2,a,dt,pol,nkv,nhist,qual,decoded) sync2,a,dt,pol,nkv,nhist,qual,decoded)
kk=kk+1 kk=kk+1
sig(kk,1)=nfile sig(kk,1)=nfile
sig(kk,2)=nutc sig(kk,2)=nutc
sig(kk,3)=freq sig(kk,3)=freq
sig(kk,4)=sync1 sig(kk,4)=sync1
sig(kk,5)=dt sig(kk,5)=dt
sig(kk,6)=pol sig(kk,6)=pol
sig(kk,7)=flipk sig(kk,7)=flipk
sig(kk,8)=sync2 sig(kk,8)=sync2
sig(kk,9)=nkv sig(kk,9)=nkv
sig(kk,10)=qual sig(kk,10)=qual
! sig(kk,11)=rms0 ! sig(kk,11)=rms0
sig(kk,12)=savg(ipol,i) sig(kk,12)=savg(ipol,i)
sig(kk,13)=a(1) sig(kk,13)=a(1)
sig(kk,14)=a(2) sig(kk,14)=a(2)
sig(kk,15)=a(3) sig(kk,15)=a(3)
sig(kk,16)=a(4) sig(kk,16)=a(4)
! sig(kk,17)=a(5) ! sig(kk,17)=a(5)
sig(kk,18)=nhist sig(kk,18)=nhist
msg(kk)=decoded msg(kk)=decoded
freq0=freq freq0=freq
sync10=sync1 sync10=sync1
nkk=1 nkk=1
endif
endif endif
endif endif
enddo endif
enddo
! write(*,1010) ! write(*,1010)
! Trim the list and produce a sorted index and sizes of groups. ! Trim the list and produce a sorted index and sizes of groups.
! (Should trimlist remove all but best SNR for given UTC and message content?) ! (Should trimlist remove all but best SNR for given UTC and message content?)
call trimlist(sig,kk,indx,nsiz,nz) call trimlist(sig,kk,indx,nsiz,nz)
do i=1,kk do i=1,kk
done(i)=.false. done(i)=.false.
enddo
j=0
ilatest=-1
do n=1,nz
ifile0=0
do m=1,nsiz(n)
i=indx(j+m)
ifile=sig(i,1)
if(ifile.gt.ifile0 .and.msg(i).ne.blank) then
ilatest=i
ifile0=ifile
endif
enddo enddo
j=0 i=ilatest
ilatest=-1 if(i.ge.1) then
do n=1,nz if(.not.done(i)) then
ifile0=0 done(i)=.true.
do m=1,nsiz(n) nutc=sig(i,2)
i=indx(j+m) freq=sig(i,3)
ifile=sig(i,1) sync1=sig(i,4)
if(ifile.gt.ifile0 .and.msg(i).ne.blank) then dt=sig(i,5)
ilatest=i npol=nint(57.2957795*sig(i,6))
ifile0=ifile flip=sig(i,7)
endif sync2=sig(i,8)
enddo nkv=sig(i,9)
i=ilatest nqual=min(sig(i,10),10.0)
if(i.ge.1) then
if(.not.done(i)) then
done(i)=.true.
nutc=sig(i,2)
freq=sig(i,3)
sync1=sig(i,4)
dt=sig(i,5)
npol=nint(57.2957795*sig(i,6))
flip=sig(i,7)
sync2=sig(i,8)
nkv=sig(i,9)
nqual=min(sig(i,10),10.0)
! rms0=sig(i,11) ! rms0=sig(i,11)
nsavg=sig(i,12) !Was used for diagnostic ... nsavg=sig(i,12) !Was used for diagnostic ...
do k=1,5 do k=1,5
a(k)=sig(i,12+k) a(k)=sig(i,12+k)
enddo enddo
nhist=sig(i,18) nhist=sig(i,18)
decoded=msg(i) decoded=msg(i)
if(flip.lt.0.0) then if(flip.lt.0.0) then
do i=22,1,-1 do i=22,1,-1
if(decoded(i:i).ne.' ') go to 10 if(decoded(i:i).ne.' ') go to 10
enddo enddo
stop 'Error in message format' stop 'Error in message format'
10 if(i.le.18) decoded(i+2:i+4)='OOO' 10 if(i.le.18) decoded(i+2:i+4)='OOO'
endif endif
nkHz=nint(freq-1.600) nkHz=nint(freq-1.600)
f0=144.0+0.001*nkHz f0=144.0+0.001*nkHz
ndf=nint(1000.0*(freq-1.600-nkHz)) ndf=nint(1000.0*(freq-1.600-nkHz))
ndf0=nint(a(1)) ndf0=nint(a(1))
ndf1=nint(a(2)) ndf1=nint(a(2))
ndf2=nint(a(3)) ndf2=nint(a(3))
nsync1=sync1 nsync1=sync1
nsync2=nint(10.0*log10(sync2)) - 40 !### empirical ### nsync2=nint(10.0*log10(sync2)) - 40 !### empirical ###
cbad=' ' cbad=' '
! if(abs(f0-144.103).lt.0.001) then ! if(abs(f0-144.103).lt.0.001) then
! write(11,1010) nutc,nsync1,nsync2,dt,ndf,decoded, ! write(11,1010) nutc,nsync1,nsync2,dt,ndf,decoded,
! + nkv,nqual ! + nkv,nqual
! endif ! endif
write(19,1012) f0,ndf,npol,nutc,decoded write(19,1012) f0,ndf,npol,nutc,decoded
1012 format(f7.3,i5,i4,i5.4,2x,a22) 1012 format(f7.3,i5,i4,i5.4,2x,a22)
write(26,1014) f0,ndf,ndf0,ndf1,ndf2,dt,npol,nsync1, & write(26,1014) f0,ndf,ndf0,ndf1,ndf2,dt,npol,nsync1, &
nsync2,nutc,decoded,nkv,nqual,nhist nsync2,nutc,decoded,nkv,nqual,nhist
1014 format(f7.3,i5,3i3,f5.1,i5,i3,i4,i5.4,2x,a22,3i3) 1014 format(f7.3,i5,3i3,f5.1,i5,i3,i4,i5.4,2x,a22,3i3)
endif
endif endif
j=j+nsiz(n) endif
enddo j=j+nsiz(n)
call display(nutc)
! if(nfile.ge.1) go to 999
100 continue
enddo enddo
call display(nutc)
999 return return
end subroutine map65a end subroutine map65a

View File

@ -7,7 +7,7 @@ subroutine sysqqq(cmnd,iret)
#endif #endif
character*(*) cmnd character*(*) cmnd
! iret=system(cmnd) iret=system(cmnd)
return return
end subroutine sysqqq end subroutine sysqqq