;******************************************** pro ufidl_to_profile_dps,trunid0,tcorrect=tcorrect,$ orbmin0=orbmin0,orbmax0=orbmax0,step0=step0,nloop0=nloop0,nx0=nx0,$ title0=title0,noquery=noquery,storefile=storefile,inte=inte,large=large,modemax=modemax ;construct profiles from fourier amplitudes ;******************************************** if(n_params() le 0) then begin print,'pro ufidl_to_profile_dps,trunid' print,' ' print,'display profiles calculated from fourier-modes' print,'trunid = run-ide (without .fsave)' print,'KEYWORDS:' print,' /tcorr -use corrected temperatures in ***.ufsave.tcorr' print,' orbmin,orbmax,step (def= 0, max(torb), 1)' print,' nloop = slowdown-parameter (def=5)' print,' nx = number of radial points in profiles (def=200)' print,' title = title (default = runide)' print,' /noquery -> do not query for replay in the end' print,' ' print,' storefile -> store frames into storefileNNN.bmp' print,' (stores 4-bit images, change to 8-bit if needed) print,' ' print,'KEYBORD-commands during display' print,'f --> jump forward NJUMP steps (NJUMP=500 originally)' print,'b --> jump backward NJUMP steps'' print,'l --> increase jump interval NJUMP-> NJUMP*2' print,'t --> decrease jump interval NJUMP-> NJUMP/2'' print,'+ --> speedup (smaller nloop)' print,'- --> slowdown (larger nloop)' print,'q --> quit (goto query)' print,'s --> pause (any key resumes display)' print,'h --> help message' print,' ' print,'The idea of these is to help to choose the print,'interesting portions of the run' print,' ' print,'In the end the procedure queries for a redisplay' print,'and it is possible to choose new orbmin,orbmax,step' print,'also asks for storefile' print,'EXAMPLES:' print,'** all dpsani001, try keybord commands!' print,"ufidl_to_profile_dps,'dpsani001',/tcorr" print,'' print,'** store travelling wave sequence for long-box run' print,"ufidl_to_profile_dps,'twt36d0011_a0',/tcorr,orbmin=800,orbmax=810,step=2,$" print,"store='twt36d0011_a0_profile_travelling',nx=400" return end trunid=trunid0+'.ufsave' if(keyword_set(inte)) then trunid=trunid0 title=trunid restore,trunid if(keyword_set(inte)) then begin lamdavx=u_amp*omega lamdavy=v_amp*omega lamdaroo=tau_amp phasevx=u_phase phasevy=v_phase phaseroo=tau_phase lamdatt=lamdaroo*0. phasett=phaseroo*0. xl=xl_phys torb=time_amp/(2.*!pi) flamda=findgen(n_elements(lambda_m))+1 tttable=time_amp*0. taumin=1. endif if(keyword_set(tcorrect)) then begin print,'uses corrected T' restore,trunid+'.tcorr' lamdatt=lamdatt_corr phasett=phasett_corr tttable=tttable_corr title=title+' Tcorr' endif ;trunid='dpsani001/dpsani001.ufsave' ;trunid='twt36d0011_j.ufsave' ;trunid='twt30d0011_a0_j.ufsave' omega=1.948d-4 if(keyword_set(title0)) then title=title0 nx=200 if(keyword_set(nx0)) then nx=nx0 ;number of x-points nm=n_elements(flamda)-1 ;number of modes if(keyword_set(modemax)) then nm=modemax0 endif if(key eq 'l') then begin njump=long(njump*2) print,njump endif if(key eq 't') then begin njump=long(njump/2> 1) print,njump endif if(key eq '-') then begin nloop=nloop+1 endif if(key eq '+') then begin nloop=nloop-1>1 endif if(key eq 's') then begin key1=get_kbrd(1) endif if(key eq 'h') then begin print,'keybord-control:' print,'f --> jump forward' print,'b --> jump backward' print,'l --> increase jump interval' print,'t --> decrease jump interval' print,'+ --> speedup (smaller nloop)' print,'- --> slowdown (smaller nloop)' print,'q --> quit' print,'s --> pause' endif skip_key: test=xt*0. for i=0,nm do begin testi=lamdaroo(ind,i)*cos(1.*flamda(i)*(fiitab-phaseroo(ind,i))) test=test+testi endfor roo=1.+test test=xt*0. for i=0,nm do begin testi=lamdavx(ind,i)*cos(1.*flamda(i)*(fiitab-phasevx(ind,i))) test=test+testi endfor vx=test/omega test=xt*0. for i=0,nm do begin testi=lamdavy(ind,i)*cos(1.*flamda(i)*(fiitab-phasevy(ind,i))) test=test+testi endfor vy=test/omega test=xt*0. for i=0,nm/2 do begin testi=lamdatt(ind,i)*cos(1.d0*flamda(i)*(fiitab-phasett(ind,i))) test=test+testi endfor t=(tttable(ind)+test)/omega^2 st=string(torb(ind),'(f8.3)') ;******************************** ;plot separately if(plotmode eq 1) then begin plot,xt,roo_old,col=1,thick=2,yr=yr_roo,ys=1,title=trunid,pos=pos(0,*),/noe,/nod,ytitle='A(tau)' oplot,xt,roo_old,col=0,thick=2 xyouts,-xl*0.9,max(yr_roo)*.9,st_old,col=0,chars=1.2 xyouts,-xl*0.9,max(yr_roo)*.9,st,col=1,chars=1.2 for loop=1,nloop do begin oplot,xt,roo,col=1,thick=2 endfor plot,xt,vx_old,col=2,thick=2,yr=yr_vx,ys=1,pos=pos(1,*),/noe,/nod,ytitle='A(u)' oplot,xt,vx_old,col=0,thick=2 for loop=1,nloop do begin oplot,xt,vx,col=2,thick=2 endfor plot,xt,vy_old,col=3,thick=2,yr=yr_vy,ys=1,pos=pos(2,*),/noe,/nod,ytitle='A(v)' oplot,xt,vy_old,col=0,thick=2 for loop=1,nloop do begin oplot,xt,vy,col=3,thick=2 endfor plot,xt,t_old,col=5,thick=2,yr=yr_t,ys=1,pos=pos(3,*),/noe,/nod,ytitle='A(T)',xtitle='x' oplot,xt,t_old,col=0,thick=2 for loop=1,nloop do begin oplot,xt,t,col=5,thick=2 endfor endif ;******************************** ;plot on a single frame if(plotmode eq 2) then begin plot,xt,roo_old-1,col=1,thick=2,yr=yr_single,ys=1,title=title,/noe,/nod,xtitle='RADIAL COORDINATE',ytitle='FRACTIONAL AMPLITUDE',pos=[0.175,.15,.825,.85],chars=1.5 xyouts,-xl*0.9,max(yr_single)*.85,'t/T = '+st_old,col=0,chars=2 xyouts,-xl*0.9,max(yr_single)*.85,'t/T = '+st,col=1,chars=2 ;xyouts,-xl*0.5,max(yr_single)*.9,'TAU_0= '+st_tau,col=1,chars=1.4 ;xyouts,-xl*0.1,max(yr_single)*.9,'T_0= '+st_t0,col=1,chars=1.4 yp=max(yr_single)*.85 plots,xl*[0.52,0.65]-.4*xl,[1,1]*yp,psym=0,thick=2 xyouts,xl*.7-0.4*xl,yp,'TAU',col=1,chars=1.6 yp=max(yr_single)*.7 plots,xl*[0.52,0.65]-.4*xl,[1,1]*yp,psym=0,col=5,thick=2 xyouts,xl*.7-0.4*xl,yp,'T'+st_t,col=5,chars=1.6 yp=max(yr_single)*.85 plots,xl*[0.52,0.65],[1,1]*yp,psym=0,col=2,thick=2 xyouts,xl*.7,yp,'u'+st_v,col=2,chars=1.6 yp=max(yr_single)*.7 plots,xl*[0.52,0.65],[1,1]*yp,psym=0,col=3,thick=2 xyouts,xl*.7,yp,'v'+st_v,col=3,chars=1.6 oplot,xt,roo_old-1,col=0,thick=2 for loop=1,nloop do begin oplot,xt,roo-1,col=1,thick=2 endfor oplot,xt,vx_old/vscale,col=0,thick=2 for loop=1,nloop do begin oplot,xt,vx/vscale,col=2,thick=2 ;print,vx/vscale endfor oplot,xt,vy_old/vscale,col=0,thick=2 for loop=1,nloop do begin oplot,xt,vy/vscale,col=3,thick=2 endfor oplot,xt,t_old/tscale-1,col=0,thick=2 for loop=1,nloop do begin oplot,xt,t/tscale-1,col=5,thick=2 endfor if(istore eq 1) then begin nstore=nstore+1 oplot,xt,roo-1,col=1,thick=2 oplot,xt,vx/vscale,col=2,thick=2 oplot,xt,vy/vscale,col=3,thick=2 oplot,xt,t/tscale-1,col=5,thick=2 image=tvrd(0,0,768,576,/true) ;change to 8-bit ;image=color_quan(image,1,rr,gg,bb,col=256) & four=0 ;change to 4-bit image=color_quan(image,1,rr,gg,bb,col=16) & four=1 is='00'+string(nstore,'(i1)') if(nstore gt 9) then is='0'+string(nstore,'(i2)') if(nstore gt 99) then is=string(nstore,'(i3)') giffile=storefile+'.'+is+'.bmp' write_bmp,giffile,image,rr,gg,bb,four=four print,giffile endif endif roo_old=roo vx_old=vx vy_old=vy t_old=t st_old=st endfor ;ind endi: istore=0 if(not keyword_set(noquery)) then begin print,'' print,'DISPLAY AGAIN? (def=no, "y"-> start from beginning)' vast='' read,vast if(vast eq 'y') then begin print,'orbmin,orbmax,step,nx' read,orbmin,orbmax,step,nx print,'storefile (ret-> no storing)' read,vast if(vast ne '') then storefile=vast if(vast ne '') then istore=1 goto,new_start endif endif goto,here end