;$Id: pvid3.pro,v 1.3 2009/11/21 13:08:07 brandenb Exp $ ; ; simple scrip to read in 1-D slice file and plot as butterfly diagram ; pc_read_param,o=param pc_read_grid,o=grid pc_read_dim,o=dim ; ; define array, and open file ; close,1 close,2 close,3 a1=fltarr(dim.nx,dim.ny) a2=fltarr(dim.nx,dim.ny) a3=fltarr(dim.nx,dim.ny) openr,1,'data/slice_uu1.xy',/f77 openr,2,'data/slice_uu2.xy',/f77 openr,3,'data/slice_uu3.xy',/f77 ; ; loop to read all records ; set counter i=0 in the beginning ; i=0 t1=0. t1=100. t1=10. while not eof(1) do begin readu,1,a1,t readu,2,a2,t readu,3,a3,t if t gt t1 then begin tvscl,a1,0 tvscl,a2,1 tvscl,a3,2 if i eq 0 then begin aa1=a1 aa2=a2 aa3=a3 tt=t endif else begin aa1=[aa1,a1] aa2=[aa2,a2] aa3=[aa3,a3] tt=[tt,t] endelse i=i+1 print,i,t endif if i eq 1000 then goto,ending end ending: close,1 close,2 close,3 nt=i ; ; reformate to have a 2-D array (not a 1-D array) ; aa1=reform(aa1,dim.nx,nt,dim.ny) aa2=reform(aa2,dim.nx,nt,dim.ny) aa3=reform(aa3,dim.nx,nt,dim.ny) ; ; plot as contour plot ; !p.charsize=2. !x.title='!8t!6' !y.title='!7h!6/!7p!6' ;contour,transpose(aa),tt,grid.y(dim.m1:dim.m2)/!pi,/fill,nlev=20 ; END