;$Id: pvid_simple.pro,v 1.1 2009/11/11 11:20:06 brandenb Exp $ ; ; simple scrip to read in 1-D slice file and plot as butterfly diagram ; pc_read_grid,o=grid pc_read_dim,o=dim ; ; define array, and open file ; a=fltarr(dim.nx,dim.ny) openr,1,'data/slice_uu1.xy',/f77 ; ; loop to read all records ; set counter i=0 in the beginning ; i=0 while not eof(1) do begin readu,1,a,t tvscl,a if i eq 0 then begin aa=a tt=t endif else begin aa=[aa,a] tt=[tt,t] endelse i=i+1 end close,1 nt=i ; ; reformate to have a 2-D array (not a 1-D array) ; aa=reform(aa,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