Many changes. GUI version of MAP65 is beginning to tske shape.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/map65@349 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2007-01-13 20:21:32 +00:00
parent 31a9615af5
commit 162d6499b6
9 changed files with 160 additions and 108 deletions

View File

@ -22,6 +22,7 @@ C f_stop = 750 Hz.
+ 5.89886379,1.59355187,-2.49138308,0.60910773,-0.04248129/ + 5.89886379,1.59355187,-2.49138308,0.60910773,-0.04248129/
save save
if(nmax.lt.0) go to 900
if(first) then if(first) then
npatience=FFTW_ESTIMATE npatience=FFTW_ESTIMATE
! npatience=FFTW_MEASURE ! npatience=FFTW_MEASURE
@ -99,6 +100,13 @@ C Do the short reverse transform, to go back to time domain.
call sfftw_execute_(plan3) call sfftw_execute_(plan3)
call sfftw_execute_(plan4) call sfftw_execute_(plan4)
n4=min(nmax/64,NFFT2) n4=min(nmax/64,NFFT2)
go to 999
return 900 call sfftw_destroy_plan_(plan1)
call sfftw_destroy_plan_(plan2)
call sfftw_destroy_plan_(plan3)
call sfftw_destroy_plan_(plan4)
call sfftw_destroy_plan_(plan5)
999 return
end end

View File

@ -97,8 +97,8 @@ 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', &
! share='denynone') share='denynone')
open(26,file=appdir(:iz)//'/tmp26.txt',status='unknown', & open(26,file=appdir(:iz)//'/tmp26.txt',status='unknown', &
share='denynone') share='denynone')

View File

@ -2,7 +2,8 @@
subroutine ftn_quit subroutine ftn_quit
include 'gcom1.f90' include 'gcom1.f90'
ngo=0 ngo=0
! Destroy the FFTW plans
call four2a(a,-1,1,1,1) call four2a(a,-1,1,1,1)
! @@@ Should also terminate the plans created in filbig! call filbig(id,-1,f0,newdat,c4a,c4b,n4)
return return
end subroutine ftn_quit end subroutine ftn_quit

View File

@ -5,6 +5,7 @@ real psavg !Average spectrum Decoder
real s2 !2d spectrum for horizontal waterfall GUI real s2 !2d spectrum for horizontal waterfall GUI
real ccf !CCF in time (blue curve) Decoder real ccf !CCF in time (blue curve) Decoder
real green !Data for green line GUI real green !Data for green line GUI
real fselect !Specified QSO frequency GUI
integer ngreen !Length of green GUI integer ngreen !Length of green GUI
real dgain !Digital audio gain setting GUI real dgain !Digital audio gain setting GUI
integer iter !(why is this here??) integer iter !(why is this here??)
@ -87,7 +88,7 @@ character*80 filetokillb
character*12 pttport character*12 pttport
common/gcom2/ps0(431),psavg(450),s2(64,3100),ccf(-5:540), & common/gcom2/ps0(431),psavg(450),s2(64,3100),ccf(-5:540), &
green(500),ngreen,dgain,iter,ndecoding,ndecoding0,mousebutton, & green(500),fselect,ngreen,dgain,iter,ndecoding,ndecoding0,mousebutton, &
ndecdone,npingtime,ierr,lauto,mantx,nrestart,ntr,nmsg,nsave,nadd5, & ndecdone,npingtime,ierr,lauto,mantx,nrestart,ntr,nmsg,nsave,nadd5, &
dftolerance,LDecoded,rxdone,monitoring,nzap,nsavecum,minsigdb, & dftolerance,LDecoded,rxdone,monitoring,nzap,nsavecum,minsigdb, &
nclearave,nfreeze,nafc,newspec,nmode,mode65,nclip,ndebug,nblank,nport, & nclearave,nfreeze,nafc,newspec,nmode,mode65,nclip,ndebug,nblank,nport, &

View File

@ -41,6 +41,7 @@ root_geom=""
#------------------------------------------------------ Global variables #------------------------------------------------------ Global variables
nfile=0
appdir=os.getcwd() appdir=os.getcwd()
isync=1 isync=1
isync_save=0 isync_save=0
@ -171,8 +172,8 @@ def bandmap(event=NONE):
bm.geometry(bm_geom) bm.geometry(bm_geom)
if g.Win32: bm.iconbitmap("wsjt.ico") if g.Win32: bm.iconbitmap("wsjt.ico")
iframe_bm1 = Frame(bm, bd=1, relief=SUNKEN) iframe_bm1 = Frame(bm, bd=1, relief=SUNKEN)
bmtext=Text(iframe_bm1, height=35, width=45, bg="Navy", fg="yellow") bmtext=Text(iframe_bm1, height=35, width=41, bg="Navy", fg="yellow")
bmtext.pack(side=LEFT, fill=X, padx=1) bmtext.pack(side=LEFT, fill=X, padx=1, pady=3)
bmsb = Scrollbar(iframe_bm1, orient=VERTICAL, command=bmtext.yview) bmsb = Scrollbar(iframe_bm1, orient=VERTICAL, command=bmtext.yview)
bmsb.pack(side=RIGHT, fill=Y) bmsb.pack(side=RIGHT, fill=Y)
bmtext.configure(yscrollcommand=bmsb.set) bmtext.configure(yscrollcommand=bmsb.set)
@ -347,10 +348,6 @@ def txmute(event=NONE):
else: else:
lab7.configure(bg='gray85',fg='gray85') lab7.configure(bg='gray85',fg='gray85')
#------------------------------------------------------ savelast
def savelast(event=NONE):
Audio.gcom2.nsavelast=1
#------------------------------------------------------ MsgBox #------------------------------------------------------ MsgBox
def MsgBox(t): def MsgBox(t):
msg=Pmw.MessageDialog(root,buttons=('OK',),message_text=t) msg=Pmw.MessageDialog(root,buttons=('OK',),message_text=t)
@ -602,7 +599,6 @@ Alt+M Monitor
Alt+O Tx Stop Alt+O Tx Stop
Alt+Q Log QSO Alt+Q Log QSO
Alt+S Stop Monitoring or Decoding Alt+S Stop Monitoring or Decoding
Alt+V Save Last
Alt+X Exclude Alt+X Exclude
Alt+Z Toggle Zap Alt+Z Toggle Zap
Right/Left Arrow Increase/decrease Freeze DF Right/Left Arrow Increase/decrease Freeze DF
@ -1091,7 +1087,7 @@ def plot_yellow():
def update(): def update():
global root_geom,isec0,naz,nel,ndmiles,ndkm,nopen, \ global root_geom,isec0,naz,nel,ndmiles,ndkm,nopen, \
im,pim,cmap0,isync,isync_save,idsec,first,itol,txsnrdb,tx6alt,\ im,pim,cmap0,isync,isync_save,idsec,first,itol,txsnrdb,tx6alt,\
bm_geom bm_geom,nfile
utc=time.gmtime(time.time()+0.1*idsec) utc=time.gmtime(time.time()+0.1*idsec)
isec=utc[5] isec=utc[5]
@ -1265,13 +1261,15 @@ def update():
lines="" lines=""
bmtext.configure(state=NORMAL) bmtext.configure(state=NORMAL)
bmtext.delete('1.0',END) 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)):
bmtext.insert(END,lines[i]) bmtext.insert(END,lines[i])
bmtext.see(END) bmtext.see(END)
Audio.gcom2.ndecdone=0
Audio.gcom2.ndecdone=3 nfile=nfile+1
if(nfile<11):
decode()
if g.cmap != cmap0: if g.cmap != cmap0:
im.putpalette(g.palette) im.putpalette(g.palette)
@ -1562,8 +1560,6 @@ root.bind_all('<Alt-q>',logqso)
root.bind_all('<Alt-Q>',logqso) root.bind_all('<Alt-Q>',logqso)
root.bind_all('<Alt-s>',stopmon) root.bind_all('<Alt-s>',stopmon)
root.bind_all('<Alt-S>',stopmon) root.bind_all('<Alt-S>',stopmon)
root.bind_all('<Alt-v>',savelast)
root.bind_all('<Alt-V>',savelast)
root.bind_all('<Alt-x>',decode_exclude) root.bind_all('<Alt-x>',decode_exclude)
root.bind_all('<Alt-X>',decode_exclude) root.bind_all('<Alt-X>',decode_exclude)
root.bind_all('<Alt-z>',toggle_zap) root.bind_all('<Alt-z>',toggle_zap)
@ -1594,8 +1590,6 @@ bstop=Button(iframe4c, text='Stop',underline=0,command=stopmon,
padx=1,pady=1) padx=1,pady=1)
bmonitor=Button(iframe4c, text='Monitor',underline=0,command=monitor, bmonitor=Button(iframe4c, text='Monitor',underline=0,command=monitor,
padx=1,pady=1) padx=1,pady=1)
bsavelast=Button(iframe4c, text='Save',underline=2,command=savelast,
padx=1,pady=1)
bdecode=Button(iframe4c, text='Decode',underline=0,command=decode, bdecode=Button(iframe4c, text='Decode',underline=0,command=decode,
padx=1,pady=1) padx=1,pady=1)
berase=Button(iframe4c, text='Erase',underline=0,command=erase, berase=Button(iframe4c, text='Erase',underline=0,command=erase,
@ -1613,7 +1607,6 @@ blogqso.pack(side=LEFT,expand=1,fill=X)
#bplay.pack(side=LEFT,expand=1,fill=X) #bplay.pack(side=LEFT,expand=1,fill=X)
bstop.pack(side=LEFT,expand=1,fill=X) bstop.pack(side=LEFT,expand=1,fill=X)
bmonitor.pack(side=LEFT,expand=1,fill=X) bmonitor.pack(side=LEFT,expand=1,fill=X)
bsavelast.pack(side=LEFT,expand=1,fill=X)
bdecode.pack(side=LEFT,expand=1,fill=X) bdecode.pack(side=LEFT,expand=1,fill=X)
berase.pack(side=LEFT,expand=1,fill=X) berase.pack(side=LEFT,expand=1,fill=X)
bclravg.pack(side=LEFT,expand=1,fill=X) bclravg.pack(side=LEFT,expand=1,fill=X)
@ -1682,7 +1675,7 @@ ldsec.grid(column=0,row=4,ipadx=3,padx=2,pady=5,sticky='EW')
Widget.bind(ldsec,'<Button-1>',incdsec) Widget.bind(ldsec,'<Button-1>',incdsec)
Widget.bind(ldsec,'<Button-3>',decdsec) Widget.bind(ldsec,'<Button-3>',decdsec)
f5b.pack(side=LEFT,expand=0,fill=BOTH) f5b.pack(side=LEFT,expand=1,fill=BOTH)
#------------------------------------------------------ Tx params and msgs #------------------------------------------------------ Tx params and msgs
f5c=Frame(iframe5,bd=2,relief=GROOVE) f5c=Frame(iframe5,bd=2,relief=GROOVE)
@ -1700,7 +1693,6 @@ f5c2.grid(column=0,row=1,sticky='W',padx=4)
sked.grid(column=0,row=3,sticky='W',padx=4) sked.grid(column=0,row=3,sticky='W',padx=4)
genmsg.grid(column=0,row=4,sticky='W',padx=4) genmsg.grid(column=0,row=4,sticky='W',padx=4)
auto.grid(column=0,row=5,sticky='EW',padx=4) auto.grid(column=0,row=5,sticky='EW',padx=4)
#txstop.grid(column=0,row=6,sticky='EW',padx=4)
ntx=IntVar() ntx=IntVar()
tx1=Entry(f5c,width=24) tx1=Entry(f5c,width=24)
@ -1745,7 +1737,7 @@ tx6.grid(column=1,row=5)
rb6.grid(column=2,row=5) rb6.grid(column=2,row=5)
b6.grid(column=3,row=5) b6.grid(column=3,row=5)
f5c.pack(side=LEFT,fill=BOTH) f5c.pack(side=LEFT,expand=1,fill=BOTH)
iframe5.pack(expand=1, fill=X, padx=4) iframe5.pack(expand=1, fill=X, padx=4)
#------------------------------------------------------------ Status Bar #------------------------------------------------------------ Status Bar

View File

@ -20,7 +20,7 @@ subroutine map65a
logical done(MAXMSG) logical done(MAXMSG)
integer rfile3 integer rfile3
character decoded*22,blank*22,cbad*1 character decoded*22,blank*22,cbad*1
common/spcom/ss(4,322,NFFT) !169 MB: half-symbol spectra common/spcom/ip0,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/ data nfile/0/
@ -30,17 +30,30 @@ subroutine map65a
rewind 11 rewind 11
rewind 12 rewind 12
nfile=nfile+1 1 nfile=nfile+1
nutc=0744+nfile nutc=0744+nfile
if(nutc.eq.0747) go to 1
if(nutc.eq.0749) go to 1
if(nutc.eq.0751) go to 1
if(nutc.eq.0753) go to 1
infile='061111.0745' infile='061111.0745'
write(infile(8:11),1001) nutc write(infile(8:11),1001) nutc
1001 format(i4.4) 1001 format(i4.4)
! read(infile(8:11),*) nutc ! read(infile(8:11),*) nutc
tskip=0. tskip=0.
fselect=0. ! fselect=126.0 + 1.6 + 0.290
fselect=104.5303 ! nflip=-1
nmin=1 ! ip0=1
fselect=128.0 + 1.6 + 0.220
nflip=1
ip0=3
! fselect=155.0 + 1.6 + 0.454
! nflip=1
! ip0=2
! fselect=103 + 1.6 - 0.07
! nflip=-1 !May need to try both +/- 1
! ip0=4 !Try all four?
open(23,file='CALL3.TXT',status='unknown') open(23,file='CALL3.TXT',status='unknown')
@ -60,16 +73,14 @@ subroutine map65a
if(fselect.gt.0.0) then 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=2 !nfilt=2 is faster for selected freq
! freq=fselect+1.600
freq=fselect freq=fselect
nflip=-1 !May need to try both +/- 1
ipol=4 !Try all four?
dt=2.314240 !Not needed? dt=2.314240 !Not needed?
call decode1a(id,newdat,nfilt,freq,nflip,ip0,sync2, &
call decode1a(id,newdat,nfilt,freq,nflip,ipol,sync2, &
a,dt,pol,nkv,nhist,qual,decoded) a,dt,pol,nkv,nhist,qual,decoded)
nsync1=0
nsync2=nint(10.0*log10(sync2)) - 40 !### empirical ### nsync2=nint(10.0*log10(sync2)) - 40 !### empirical ###
ndf=nint(a(1))
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, &
@ -181,6 +192,8 @@ subroutine map65a
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)
! i9=index(decoded,'AA1YN')
! if(i9.gt.0) print*,i,i9,fselect,freq,decoded
kk=kk+1 kk=kk+1
sig(kk,1)=nfile sig(kk,1)=nfile
sig(kk,2)=nutc sig(kk,2)=nutc
@ -273,8 +286,8 @@ subroutine map65a
! + 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

View File

@ -1,4 +1,4 @@
subroutine spec(brightness,contrast,logmap,ngain,nspeed,a) subroutine spec(brightness,contrast,ngain,nspeed,a,a2)
parameter (NX=750,NY=130,NTOT=NX*NY,NFFT=32768) parameter (NX=750,NY=130,NTOT=NX*NY,NFFT=32768)
@ -9,58 +9,77 @@ subroutine spec(brightness,contrast,logmap,ngain,nspeed,a)
! Output: ! Output:
integer*2 a(NTOT) !Pixel values for NX x NY array integer*2 a(NTOT) !Pixel values for NX x NY array
integer*2 a2(NTOT) !Pixel values for NX x NY array
logical first logical first
integer nstep(4) integer nstep(5)
integer b0,c0 integer b0,c0
real s(NX,NY) real s(NFFT,NY)
common/spcom/ss(4,322,NFFT) !169 MB: half-symbol spectra common/spcom/ip0,ss(4,322,NFFT) !169 MB: half-symbol spectra
include 'gcom1.f90' include 'gcom1.f90'
include 'gcom2.f90' include 'gcom2.f90'
include 'gcom3.f90' include 'gcom3.f90'
include 'gcom4.f90' include 'gcom4.f90'
data first/.true./ data first/.true./
data nstep/16,10,5,3/ !Integration limits data nstep/40,20,10,5,3/ !Integration limits
save save
if(first) then if(first) then
df=96000.0/nfft df=96000.0/nfft
call zero(a,NX*NY/2) call zero(a,NX*NY/2)
call zero(a2,NX*NY/2)
first=.false. first=.false.
endif endif
nadd=nstep(nspeed) nadd=nstep(nspeed)
nlines=322/nadd nlines=322/nadd
call zero(s,NX*NY) call zero(s,NFFT*NY)
k=0 k=0
ia=9001 imid=nint(1000.0*(fselect-125.0+48.0)/df)
ib=9750 ia=imid-374
do j=1,nlines ib=ia+749
k=k+1
do i=ia,ib do n=1,nadd
s(i,j)=s(i,j) + ss(1,k,i) + ss(3,k,i) do j=1,nlines
k=k+1
do i=1,NFFT
s(i,j)=s(i,j) + ss(3,k,i)
enddo
enddo enddo
enddo enddo
newpts=NX*nlines newpts=NX*nlines
do i=newpts+1,NX*NY do i=newpts+1,NX*NY
a(i)=a(i-newpts) a(i)=a(i-newpts)
a2(i)=a2(i-newpts)
enddo enddo
gain=40*sqrt(nstep(nspeed)/5.0) * 5.0**(0.01*contrast) gain=40*sqrt(nstep(nspeed)/5.0) * 5.0**(0.01*contrast)
gamma=1.3 + 0.01*contrast gamma=1.3 + 0.01*contrast
offset=(brightness+64.0)/2 offset=(brightness+64.0)/2
k=0 k=0
fac=20.0/nadd
nbpp=NFFT/NX !Bins per pixel in wide waterfall
do j=1,nlines do j=1,nlines
do i=ia,ib do i=1,NX
k=k+1 k=k+1
n=0 n=0
x=s(i,j) x=0.
! if(s(i).gt.0.0 .and. logmap.eq.1) n=gain*log10(0.001*s(i)) & do ii=(i-1)*nbpp+1,i*nbpp
! + offset + 20 x=max(x,s(ii,j))
if(x.gt.0.0 .and. logmap.eq.0) n=(20.0*x)**gamma + offset enddo
x=fac*x
if(x.gt.0.0) n=(2.0*x)**gamma + offset
n=min(252,max(0,n)) n=min(252,max(0,n))
a(k)=n a(k)=n
n=0
x=fac*s(ia+i-1,j)
if(x.gt.0.0) n=(3.0*x)**gamma + offset
n=min(252,max(0,n))
a2(k)=n
enddo enddo
enddo enddo

116
specjt.py
View File

@ -41,10 +41,6 @@ fmid0=1500
frange=2000 frange=2000
frange0=2000 frange0=2000
isec0=-99 isec0=-99
logmap=IntVar()
logmap.set(0)
logm0=0
minsep=IntVar()
mode0="" mode0=""
mousedf0=0 mousedf0=0
naxis=IntVar() naxis=IntVar()
@ -86,21 +82,27 @@ balloon=Pmw.Balloon(root)
def pal_gray0(): def pal_gray0():
g.cmap="gray0" g.cmap="gray0"
im.putpalette(Colormap2Palette(colormapgray0),"RGB") im.putpalette(Colormap2Palette(colormapgray0),"RGB")
im2.putpalette(Colormap2Palette(colormapgray0),"RGB")
def pal_gray1(): def pal_gray1():
g.cmap="gray1" g.cmap="gray1"
im.putpalette(Colormap2Palette(colormapgray1),"RGB") im.putpalette(Colormap2Palette(colormapgray1),"RGB")
im2.putpalette(Colormap2Palette(colormapgray1),"RGB")
def pal_linrad(): def pal_linrad():
g.cmap="Linrad" g.cmap="Linrad"
im.putpalette(Colormap2Palette(colormapLinrad),"RGB") im.putpalette(Colormap2Palette(colormapLinrad),"RGB")
im2.putpalette(Colormap2Palette(colormapLinrad),"RGB")
def pal_blue(): def pal_blue():
g.cmap="blue" g.cmap="blue"
im.putpalette(Colormap2Palette(colormapblue),"RGB") im.putpalette(Colormap2Palette(colormapblue),"RGB")
im2.putpalette(Colormap2Palette(colormapblue),"RGB")
def pal_Hot(): def pal_Hot():
g.cmap="Hot" g.cmap="Hot"
im.putpalette(Colormap2Palette(colormapHot),"RGB") im.putpalette(Colormap2Palette(colormapHot),"RGB")
im2.putpalette(Colormap2Palette(colormapHot),"RGB")
def pal_AFMHot(): def pal_AFMHot():
g.cmap="AFMHot" g.cmap="AFMHot"
im.putpalette(Colormap2Palette(colormapAFMHot),"RGB") im.putpalette(Colormap2Palette(colormapAFMHot),"RGB")
im2.putpalette(Colormap2Palette(colormapAFMHot),"RGB")
#--------------------------------------------------- Command button routines #--------------------------------------------------- Command button routines
#---------------------------------------------------- fdf_change #---------------------------------------------------- fdf_change
@ -224,8 +226,9 @@ def freeze_decode(event):
#---------------------------------------------------- update #---------------------------------------------------- update
def update(): def update():
global a,b0,c0,g0,im,isec0,line0,newMinute,nscroll,pim, \ global a,a2,b0,c0,g0,im,im2,isec0,line0,line02,newMinute,\
root_geom,t0,mousedf0,nfreeze0,tol0,mode0,nmark0,logm0, \ nscroll,pim,pim2, \
root_geom,t0,mousedf0,nfreeze0,tol0,mode0,nmark0, \
fmid,fmid0,frange,frange0 fmid,fmid0,frange,frange0
utc=time.gmtime(time.time()+0.1*Audio.gcom1.ndsec) utc=time.gmtime(time.time()+0.1*Audio.gcom1.ndsec)
@ -245,47 +248,55 @@ def update():
nspeed=nspeed0.get() #Waterfall update rate nspeed=nspeed0.get() #Waterfall update rate
brightness=sc1.get() brightness=sc1.get()
contrast=sc2.get() contrast=sc2.get()
logm=logmap.get()
g0=sc3.get() g0=sc3.get()
newspec=Audio.gcom2.newspec #True if new data available newspec=Audio.gcom2.newspec #True if new data available
if newspec: if newspec:
Audio.spec(brightness,contrast,logm,g0,nspeed,a) #Call Fortran routine spec Audio.spec(brightness,contrast,g0,nspeed,a,a2) #Call Fortran routine spec
pass
if newspec or brightness!=b0 or contrast!=c0 or logm!=logm0: if newspec or brightness!=b0 or contrast!=c0:
if brightness==b0 and contrast==c0 and logm==logm0: if brightness==b0 and contrast==c0:
n=Audio.gcom2.nlines n=Audio.gcom2.nlines
box=(0,0,NX,300-n) #Define region box=(0,0,NX,130-n) #Define region
region=im.crop(box) #Get all but last line(s) region=im.crop(box) #Get all but last line(s)
region2=im2.crop(box) #Get all but last line(s)
try: try:
im.paste(region,(0,n)) #Move waterfall down im.paste(region,(0,n)) #Move waterfall down
im2.paste(region2,(0,n)) #Move waterfall down
except: except:
print "Images did not match, continuing anyway." print "Images did not match, continuing anyway."
for i in range(n): for i in range(n):
line0.putdata(a[NX*i:NX*(i+1)]) #One row of pixels to line0 line0.putdata(a[NX*i:NX*(i+1)]) #One row of pixels to line0
im.paste(line0,(0,i)) #Paste in new top line im.paste(line0,(0,i)) #Paste in new top line(s)
line02.putdata(a2[NX*i:NX*(i+1)])#One row of pixels to line0
im2.paste(line02,(0,i)) #Paste in new top line(s)
nscroll=nscroll+n nscroll=nscroll+n
else: #A scale factor has changed else: #A scale factor has changed
im.putdata(a) #Compute whole new image im.putdata(a) #Compute whole new image
im2.putdata(a2) #Compute whole new image
b0=brightness #Save scale values b0=brightness #Save scale values
c0=contrast c0=contrast
logm0=logm
if newspec: if newspec:
if Audio.gcom2.monitoring: if Audio.gcom2.monitoring:
if minsep.get() and newMinute: if newMinute:
draw.line((0,0,749,0),fill=128) #Draw the minute separator draw.line((0,0,749,0),fill=128) #Draw the minute separator
draw2.line((0,0,749,0),fill=128) #Draw the minute separator
if nscroll == 13: if nscroll == 13:
draw.text((5,2),t0[0:5],fill=253) #Insert time label draw.text((5,2),t0[0:5],fill=253) #Insert time label
draw2.text((5,2),t0[0:5],fill=253) #Insert time label
else: else:
if minsep.get(): draw.line((0,0,749,0),fill=128) #Draw the minute separator
draw.line((0,0,749,0),fill=128) #Draw the minute separator draw2.line((0,0,749,0),fill=128) #Draw the minute separator
pim=ImageTk.PhotoImage(im) #Convert Image to PhotoImage pim=ImageTk.PhotoImage(im) #Convert Image to PhotoImage
graph1.delete(ALL) graph1.delete(ALL)
pim2=ImageTk.PhotoImage(im2) #Convert Image to PhotoImage
graph2.delete(ALL)
#For some reason, top two lines are invisible, so we move down 2 #For some reason, top two lines are invisible, so we move down 2
graph1.create_image(0,0+2,anchor='nw',image=pim) graph1.create_image(0,0+2,anchor='nw',image=pim)
graph2.create_image(0,0+2,anchor='nw',image=pim2)
newMinute=0 newMinute=0
Audio.gcom2.newspec=0 Audio.gcom2.newspec=0
@ -328,33 +339,23 @@ def update():
#-------------------------------------------------------- draw_axis #-------------------------------------------------------- draw_axis
def draw_axis(): def draw_axis():
xmid=fmid
if naxis.get(): xmid=xmid-1270.46
c.delete(ALL) c.delete(ALL)
# Draw the frequency or DF tick marks xmid=125.0
if(frange==2000): bw=96.0
for ix in range(-1300,5001,20): x1=int(xmid-0.5*bw)
i=374.5 + (ix-xmid)/df x2=int(xmid+0.5*bw)
j=20 xdf=bw/NX
if (ix%100)==0 : for ix in range(x1,x2,1):
j=16 i=0.5*NX + (ix-xmid)/xdf
x=i-2 j=20
if ix<1000 : x=x+2 if (ix%5)==0: j=16
y=8 if (ix%10)==0 :
c.create_text(x,y,text=str(ix)) j=16
c.create_line(i,25,i,j,fill='black') x=i-1
if ix<100: x=x+1
if(frange==4000): y=8
for ix in range(-2600,5401,50): c.create_text(x,y,text=str(ix))
i=374.5 + (ix-xmid)/(2*df) c.create_line(i,25,i,j,fill='black')
j=20
if (ix%200)==0 :
j=16
x=i-2
if ix<1000 : x=x+2
y=8
c.create_text(x,y,text=str(ix))
c.create_line(i,25,i,j,fill='black')
dx=288.7 + (1500-fmid)/df dx=288.7 + (1500-fmid)/df
dff=df dff=df
@ -370,6 +371,26 @@ def draw_axis():
x2=(Audio.gcom2.mousedf+tol)/dff + dx x2=(Audio.gcom2.mousedf+tol)/dff + dx
c.create_line(x1,25,x2,25,fill='green',width=2) c.create_line(x1,25,x2,25,fill='green',width=2)
c2.delete(ALL)
xmid2=0
bw2=750.0*96000.0/32768.0 #approx 2197.27 Hz
x1=int(xmid-0.5*bw2)/100 - 1
x1=100*x1
x2=int(xmid+0.5*bw2)
xdf2=bw2/NX
for ix in range(x1,x2,20):
i=0.5*NX + (ix-xmid2)/xdf2
j=20
# if (ix%5)==0: j=16
if (ix%100)==0 :
j=16
x=i-1
if ix<1000: x=x+2
if ix<0: x=x-2
y=8
c2.create_text(x,y,text=str(ix))
c2.create_line(i,25,i,j,fill='black')
#-------------------------------------------------------- Create GUI widgets #-------------------------------------------------------- Create GUI widgets
#-------------------------------------------------------- Menu bar #-------------------------------------------------------- Menu bar
@ -384,7 +405,6 @@ setupbutton = Menubutton(mbar, text = 'Options', )
setupbutton.pack(side = LEFT) setupbutton.pack(side = LEFT)
setupmenu = Menu(setupbutton, tearoff=1) setupmenu = Menu(setupbutton, tearoff=1)
setupbutton['menu'] = setupmenu setupbutton['menu'] = setupmenu
setupmenu.add_checkbutton(label = 'Mark T/R boundaries',variable=minsep)
setupmenu.add_checkbutton(label='Flatten spectra',variable=nflat) setupmenu.add_checkbutton(label='Flatten spectra',variable=nflat)
setupmenu.add_checkbutton(label='Mark JT65 tones only if Freeze is checked', setupmenu.add_checkbutton(label='Mark JT65 tones only if Freeze is checked',
variable=nmark) variable=nmark)
@ -429,7 +449,7 @@ bfmid3.pack(side=LEFT)
bfmid2.pack(side=LEFT) bfmid2.pack(side=LEFT)
#------------------------------------------------- Speed selection buttons #------------------------------------------------- Speed selection buttons
for i in (4, 3, 2, 1): for i in (5, 4, 3, 2, 1):
t=str(i) t=str(i)
Radiobutton(mbar,text=t,value=i,variable=nspeed0).pack(side=RIGHT) Radiobutton(mbar,text=t,value=i,variable=nspeed0).pack(side=RIGHT)
nspeed0.set(1) nspeed0.set(1)
@ -508,11 +528,9 @@ try:
elif key == 'Brightness': sc1.set(value) elif key == 'Brightness': sc1.set(value)
elif key == 'Contrast': sc2.set(value) elif key == 'Contrast': sc2.set(value)
elif key == 'DigitalGain': sc3.set(value) elif key == 'DigitalGain': sc3.set(value)
elif key == 'MinuteSeparators': minsep.set(value)
elif key == 'AxisLabel': naxis.set(value) elif key == 'AxisLabel': naxis.set(value)
elif key == 'MarkTones': nmark.set(value) elif key == 'MarkTones': nmark.set(value)
elif key == 'Flatten': nflat.set(value) elif key == 'Flatten': nflat.set(value)
elif key == 'LogMap': logmap.set(value)
elif key == 'Palette': g.cmap=value elif key == 'Palette': g.cmap=value
elif key == 'Frange': nfr.set(value) elif key == 'Frange': nfr.set(value)
elif key == 'Fmid': fmid=int(value) elif key == 'Fmid': fmid=int(value)
@ -574,11 +592,9 @@ f.write("UpdateInterval " + str(nspeed0.get()) + "\n")
f.write("Brightness " + str(b0)+ "\n") f.write("Brightness " + str(b0)+ "\n")
f.write("Contrast " + str(c0)+ "\n") f.write("Contrast " + str(c0)+ "\n")
f.write("DigitalGain " + str(g0)+ "\n") f.write("DigitalGain " + str(g0)+ "\n")
f.write("MinuteSeparators " + str(minsep.get()) + "\n")
f.write("AxisLabel " + str(naxis.get()) + "\n") f.write("AxisLabel " + str(naxis.get()) + "\n")
f.write("MarkTones " + str(nmark.get()) + "\n") f.write("MarkTones " + str(nmark.get()) + "\n")
f.write("Flatten " + str(nflat.get()) + "\n") f.write("Flatten " + str(nflat.get()) + "\n")
f.write("LogMap " + str(logmap.get()) + "\n")
f.write("Palette " + g.cmap + "\n") f.write("Palette " + g.cmap + "\n")
f.write("Frange " + str(nfr.get()) + "\n") f.write("Frange " + str(nfr.get()) + "\n")
f.write("Fmid " + str(fmid) + "\n") f.write("Fmid " + str(fmid) + "\n")

View File

@ -19,8 +19,10 @@ c = -1 means sort x in decreasing order (ignoring y)
c = -2 means sort x in decreasing order and carry y along. c = -2 means sort x in decreasing order and carry y along.
integer kflag, n integer kflag, n
real x(n), y(n) ! real x(n), y(n)
real r, t, tt, tty, ty ! real r, t, tt, tty, ty
integer x(n), y(n)
integer r, t, tt, tty, ty
integer i, ij, j, k, kk, l, m, nn integer i, ij, j, k, kk, l, m, nn
integer il(21), iu(21) integer il(21), iu(21)