;$Id: pvid_simple.pro,v 1.4 2013/11/04 13:25:11 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.ny) openr,1,'data/proc0/slice_bb3.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 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.ny,nt) ; ; 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