; $Id: rslice.pro,v 1.4 2016/07/21 05:08:09 brandenb Exp $ if !d.name eq 'PS' then begin device,xsize=18,ysize=22,yoffset=3 !p.charthick=3 & !p.thick=3 & !x.thick=3 & !y.thick=3 end ; ; mv idl.ps ~/tex/x/x/fig/rslice_xy.ps ; ; after this, run also .r pvar (so that the x array is defined) ; and then .r pselect_last ; !p.charsize=1.7 !x.margin=[8.8,1.5] !y.margin=[3.2,.5] @parameters ; ; reads xy slices ; this routine is not very general yet and needs to be adjusted ; before it can be general purpose. ; ; find the correct file by looking for it like so: ; ls -l data/proc*/slice_uu3.xy ; spawn,'ls data/proc*/slice_uu3.xy' file_slice='data/proc2/slice_uu3.xy' file_slice='data/proc11/slice_uu3.xy' ;file_slice='data/proc11/slice_bb3.xy' ;(used as an experiment) ; pc_read_param,obj=param pc_read_dim,obj=dim pc_read_ts,obj=ts nx=dim.nx ; prec=1d0 t=0.*prec default,w,.0 default,iplot,1 default,t1,10.0 slice_zpos=0.*prec xy_slice=fltarr(nx)*prec help,xy_slice print,'nx=',nx Lx=param.Lxyz(0) dk=2.*!pi/Lx ; it=0 ;nx=nx/2 ;ix1=nx/2-1 ;ix2=ix1+nx-1 ix1=0 ix2=nx-1 close,1 ;openr,1,file_slice,'unformatted',/f77 openr,1,file_slice,/f77 print,'test: t1,t2=',t1,t2 while not eof(1) do begin readu,1,xy_slice,t,slice_zpos if t gt t1 and t le t2 then begin if iplot eq 1 then begin print,t,min(xy_slice),max(xy_slice), slice_zpos plot,xy_slice,yr=[-1,1]*.01 wait,w endif ; if it eq 0 then begin tt=t xt=xy_slice(ix1:ix2) endif else begin tt=[tt,t] xt=[xt,xy_slice(ix1:ix2)] endelse if (it mod 50) eq 0 then print,it,t,max(ts.t) it=it+1L ;plot,xy_slice(11,*),yr=[-1,1]*1e-3 ;tvscl,xy_slice ;tvscl,congrid(xy_slice,2*nx,2*ny) end else if t ge t2 then begin print,'ENDING',t,t2 goto,ending end end ending: nt=it print,'ENDED',t,t2 ; dt=(max(tt)-min(tt))/(nt-1) Ttotal=nt*dt dom=2.*!pi/Ttotal print,'dom=',dom omega=findgen(nt)*dom kk=findgen(nx)*dk print,'Ttotal=',Ttotal xt=reform(xt,nx,nt) ko=fft(xt,-1) help,ko ;!x.title='!8k!6' ;!y.title='!7x!6' ;contour,(alog(abs(ko)))(0:nx/2,0:nt/2),/fil,nlev=30,kk(0:nx/2),omega(0:nt/2) ;stop ; ;grav=-param.gravz fff=(alog(abs(ko)))(0:nx/2,0:nt/2) kkk=kk(0:nx/2) ooo=omega(0:nt/2) ;fff=(alog(abs(ko))) close,1 END