Skip to content

Commit ba56492

Browse files
committed
initial commit of all viz files
1 parent 2bc5d5b commit ba56492

File tree

377 files changed

+41865
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

377 files changed

+41865
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

2

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
2+
!p.charsize=2
3+
!p.position=0
4+
nx = f.s.gn[0]
5+
nz = f.s.gn[2]
6+
slice= f.s.gn[1]/2
7+
8+
bx=reform(f.bx[*,slice,*],nx,nz)
9+
by=reform(f.by[*,slice,*],nx,nz)
10+
bz=reform(f.bz[*,slice,*],nx,nz)
11+
ex=reform(f.ex[*,slice,*],nx,nz)
12+
ey=reform(f.ey[*,slice,*],nx,nz)
13+
ez=reform(f.ez[*,slice,*],nx,nz)
14+
vix=reform(f.v[*,slice,*,0,1],nx,nz)
15+
viy=reform(f.v[*,slice,*,1,1],nx,nz)
16+
viz=reform(f.v[*,slice,*,2,1],nx,nz)
17+
vex=reform(f.v[*,slice,*,0,0],nx,nz)
18+
vey=reform(f.v[*,slice,*,1,0],nx,nz)
19+
vez=reform(f.v[*,slice,*,2,0],nx,nz)
20+
21+
22+
loadct,0
23+
window, xs=1100,ys=1300
24+
;!p.multi=[0,3,4]
25+
!x.style=1
26+
!y.style=1
27+
loadct,33
28+
tvlct, 0,0,0,0
29+
tvlct, 255,255,255,1
30+
31+
!p.background=1
32+
33+
xx=findgen(nx)
34+
yy=findgen(nz)
35+
36+
p1 = !P & x1 = !X & y1 = !Y
37+
38+
dataptr=ptrarr(12)
39+
40+
dataptr[0]=ptr_new(vix)
41+
dataptr[1]=ptr_new(viz)
42+
dataptr[2]=ptr_new(viy)
43+
dataptr[3]=ptr_new(vex)
44+
dataptr[4]=ptr_new(vez)
45+
dataptr[5]=ptr_new(vey)
46+
dataptr[6]=ptr_new(bx)
47+
dataptr[7]=ptr_new(by)
48+
dataptr[8]=ptr_new(bz)
49+
dataptr[9]=ptr_new(ex)
50+
dataptr[10]=ptr_new(ey)
51+
dataptr[11]=ptr_new(ez)
52+
53+
pos=[0.2,0.1,0.9,0.9]
54+
55+
titlestr=strarr(12,30)
56+
titlestr[0,*,*]='vix'
57+
titlestr[1,*]='viy'
58+
titlestr[2,*]='viz'
59+
titlestr[3,*]='vex'
60+
titlestr[4,*]='vey'
61+
titlestr[5,*]='vez'
62+
titlestr[6,*]='bx'
63+
titlestr[7,*]='by'
64+
titlestr[8,*]='bz'
65+
titlestr[9,*]='ex'
66+
titlestr[10,*]='ey'
67+
titlestr[11,*]='ez'
68+
69+
70+
71+
sz=size(bx, /dimensions)
72+
nx=sz(0)
73+
ny=sz(1)
74+
75+
xx=findgen(nx)
76+
yy=findgen(ny)
77+
78+
time=f.s.time
79+
80+
cgDisplay, WID=1,xs=1100, ys=1100
81+
cgLoadCT, 22, /Brewer, /Reverse
82+
pos = cgLayout([3,4] , OXMargin=[5,5], OYMargin=[5,12], XGap=3, YGap=7)
83+
FOR j=0,11 DO BEGIN
84+
p = pos[*,j]
85+
r=scale_vector( *dataptr(j), 1,254)
86+
cgImage, r, NoErase=j NE 0, Position=p
87+
cgcontour,xx#yy, xx,yy , /nodata, /noerase, xtitle='x', pos=p, title=titlestr(j), Charsize=cgDefCharsize()*0.5
88+
cgColorBar, position=[p[0], p[1]-0.03, p[2], p[1]-0.02], Charsize=cgDefCharsize()*0.5
89+
ENDFOR
90+
cgText, 0.5, 0.96, /Normal, 'time='+string(time), Alignment=0.5, Charsize=cgDefCharsize()*1.25
91+
92+
end
93+

a.out

8.43 KB
Binary file not shown.

aaf.pro

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
function aaf, arr
3+
return, alog10(abs(fft(arr, /center))+1e-6)
4+
end

al_legend.pro

+572
Large diffs are not rendered by default.

alf2.pro

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
3+
pro alf2, br,bz,bth,vr,vz,d,p,mf,ma,ms
4+
va=sqrt(br^2+bz^2)/sqrt(d)
5+
va2=va^2
6+
7+
vs2=((5./3.)* p /d)
8+
vs=sqrt(vs2)
9+
10+
btot2 = br^2 + bz^2 + bth^2
11+
12+
cfast2 = 0.5*( vs2 +btot2/d + sqrt( (vs2 +btot2/d)^2 -4.0*vs2*va2 ) )
13+
14+
cslow2 = 0.5*( vs2 +btot2/d - sqrt( (vs2 +btot2/d)^2 -4.0*vs2*va2 ) )
15+
cfast=sqrt(cfast2)
16+
cslow=sqrt(cslow2)
17+
18+
vpol=sqrt(vr^2 + vz^2)
19+
20+
mf=vpol/cfast
21+
ma=vpol/va
22+
ms=vpol/cslow
23+
24+
print, min(abs(mf)),min(mf), max(mf)
25+
print, min(abs(ma)),min(ma), max(ma)
26+
print, min(abs(ms)),min(ms), max(ms)
27+
end

allalpha.pro

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
pload, 0, dir='q01', /nodata
2+
nfile=50
3+
tptr=ptrarr(12)
4+
5+
qarr=[0.1,0.5,0.7,0.9,1.3,1.5,1.7,1.9]
6+
for i=0,7 do begin
7+
8+
dirnum=qarr[i]
9+
tag1=string(dirnum, format='(F4.1)')
10+
dirtag='q'+string(dirnum*10, format='(I02)')+'/'
11+
PLOAD, nfile, DIR = dirtag, /silent
12+
mx=bx1*bx2
13+
ry=rho*vx1*vx2
14+
15+
alpha=(ry-mx)/rho^1.6666667
16+
alphamean=mean(alpha)
17+
18+
print, tag1, alphamean
19+
endfor
20+
21+
end

allalpha2.pro

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
qarr=[0.1,0.5,0.7,0.9,1.3,1.5,1.7,1.9]
2+
bptr=ptrarr(12)
3+
tptr=ptrarr(12)
4+
for i=0,7 do begin
5+
6+
dirnum=qarr[i]
7+
dirtag='q'+string(dirnum*10, format='(I02)')+'/'
8+
readcol,dirtag+'alphat.txt',t,alpha
9+
tptr[i]=ptr_new(t)
10+
bptr[i]=ptr_new(alpha)
11+
endfor
12+
13+
14+
15+
16+
17+
18+
items=[ $
19+
'q=0.1' $
20+
,'q=0.5' $
21+
, 'q=0.7' $
22+
, 'q=0.9' $
23+
, 'q=1.3' $
24+
, 'q=1.5' $
25+
, 'q=1.7' $
26+
, 'q=1.9' $
27+
]
28+
29+
cl=[ $
30+
'red' $
31+
, 'orange' $
32+
, 'green' $
33+
, 'blue' $
34+
, 'violet' $
35+
, 'green' $
36+
, 'red' $
37+
, 'orange' $
38+
]
39+
40+
ls=[2,2,2,2,0,0,0,0]
41+
42+
cgdisplay, xs=800,ys=800
43+
44+
fname="allalpha"
45+
for usingps=0,1 do begin
46+
if (usingps eq 1) then begin
47+
cgps_open, fname+'.eps', /encapsulated, /color, tt_font='Times', /quiet, font=1
48+
omega_str='!9W!X'
49+
charsize=cgdefcharsize()
50+
endif else begin
51+
set_plot, 'x'
52+
omega_str='!7X!X'
53+
charsize=cgdefcharsize()
54+
endelse
55+
56+
57+
58+
59+
tmax=max([*tptr[0] $
60+
])/2/!DPI
61+
ymax=10*max( [ abs(*bptr[7]) ] )
62+
63+
thick=2.
64+
cgplot, *tptr[0]/2./!DPI, abs(*bptr[0]), /ylog, yrange=[1e-6*ymax,ymax], color=cl[0], xrange=[0,tmax], lines=ls[0], $
65+
xtitle='t, orbits', $
66+
ytitle='BxBy '
67+
68+
for i=1,7 do begin
69+
cgplot, *tptr[i]/2./!DPI, abs(*bptr[i]), /overplot, color=cl[i], lines=ls[i]
70+
endfor
71+
72+
73+
al_legend, items, lines=ls, colors=cl, $
74+
pos=[60,1e-3],$
75+
charsize=charsize, linsize=.25
76+
77+
78+
if ( usingps ) then begin
79+
cgps_close, /jpeg, Width=1100, /nomessage, delete_ps=0
80+
endif else begin
81+
e=1
82+
endelse
83+
endfor
84+
end

allban.pro

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
;pload, 0, dir='q01', /nodata
2+
nfile=50
3+
tptr=ptrarr(12)
4+
5+
nfile=189
6+
nstr=string(nfile, format='(I08)')
7+
qarr=[0.3,0.5,0.7,0.9,1.3,1.5,1.7,1.9]
8+
for i=0,7 do begin
9+
10+
dirnum=qarr[i]
11+
dirtag='q'+string(dirnum*10, format='(I02)')
12+
print, dirtag
13+
;PLOAD, nfile, DIR = dirtag, var='bx2'
14+
qq=h5_parse(dirtag+'/banerbh0'+dirtag+nstr+'.h5', /read_data)
15+
;narr=remapfunc (bx2(*,*,0) , t[nfile], nx1,nx2,qarr[i], x1,x2,dx2)
16+
tptr[i]=ptr_new(reform(qq.lumley._DATA))
17+
endfor
18+
19+
20+
21+
items=[ $
22+
'q=0.1' $
23+
, 'q=0.5' $
24+
, 'q=0.7' $
25+
, 'q=0.9' $
26+
, 'q=1.3' $
27+
, 'q=1.5' $
28+
, 'q=1.7' $
29+
, 'q=1.9' $
30+
]
31+
32+
cl=[ $
33+
'red' $
34+
, 'orange' $
35+
, 'yellow' $
36+
, 'green' $
37+
, 'blue' $
38+
, 'violet' $
39+
, 'black' $
40+
, 'black' $
41+
]
42+
43+
ls=[0,1,2,3,4,5,6,7]
44+
45+
;tmax=max([t1,t2,t3 , $
46+
; t4, t13, t15, t17,t19 ])/2/!DPI
47+
;1max=10*max( [ abs(bxy1) , abs(bxy2) , abs(bxy3) ] )
48+
49+
thick=2.
50+
;cgplot, *tptr[0]/2./!DPI, abs(*bptr[0]), /ylog, yrange=[1e-6*ymax,ymax], color=cl[0], xrange=[0,tmax], lines=ls[0], $
51+
; xtitle='t, orbits', $
52+
; ytitle='BxBy '
53+
54+
; pos=cglayout([2,4] , OXMargin=[9,1], OYMargin=[14,2], XGap=9, YGap=9)
55+
pos=cglayout([4,2] , OXMargin=[13,1], OYMargin=[9,1], XGap=4, YGap=9)
56+
57+
xs=1200
58+
ys=650
59+
cgdisplay, xs=xs, ys=ys
60+
61+
cgloadct,33
62+
63+
64+
fname="qban"
65+
for usingps=0,1 do begin
66+
if (usingps eq 1) then begin
67+
cgps_open, fname+'.eps', /encapsulated, /color, tt_font='Times', /quiet, font=1
68+
omega_str='!9W!X'
69+
charsize=cgdefcharsize()*.7
70+
endif else begin
71+
set_plot, 'x'
72+
omega_str='!7X!X'
73+
endelse
74+
75+
76+
for i=0,7 do begin
77+
;cgplot, *tptr[i]/2./!DPI, abs(*bptr[i]), /overplot, color=cl[i], lines=ls[i]
78+
px=pos[*,i]
79+
dat=(*tptr[i])
80+
tvlct, 255,255,255,0
81+
r=cgscalevector(dat,0,254)
82+
imin=min(dat)
83+
imax=max(dat)
84+
print, 'q', qarr[i], imin, imax
85+
cgimage, r , pos=px, /noerase
86+
cgcolorbar, range=[imin,imax], pos=[px[0] , px[1]-0.03, px[2],px[1]-0.02], charsize=charszie
87+
sz=size(dat, /dimensions)
88+
x=findgen(sz(0))/sz(0)*1-0.5
89+
y=findgen(sz(1))/sz(1)*sqrt(2.)
90+
cgcontour, r,x,y, $
91+
/noerase, $
92+
/nodata, $
93+
xticklayout=1, $
94+
yticklayout=1, $
95+
xtickname=REPLICATE(' ', 2),$
96+
ytickname=REPLICATE(' ', 2),$
97+
axiscolor='white', $
98+
xticks=1,$
99+
yticks=1,$
100+
pos=px, $
101+
charsize=charsize, $
102+
ytitle='';'q='+string(qarr[i],format='(F4.1)')
103+
104+
105+
cgtext, -0.5,1.2 , "q="+string(qarr[i],format='(F4.1)')
106+
107+
cx=findgen(250)/250*3.4-1.7
108+
109+
110+
cx2=cx ( where ( cx le 0))
111+
cx2=findgen(100)/100*(-.5)
112+
cx3=cx ( where ( cx ge 0))
113+
114+
cgplot, cx2, 2.8*cx2+1.4, /overplot,pos=pos
115+
cgplot, cx3, -2.8*cx3+1.4, /overplot, pos=pos
116+
cgplot, cx, 0*cx, /overplot, pos=pos, color='red'
117+
endfor
118+
119+
120+
if ( usingps ) then begin
121+
;device,/close
122+
cgps_close, /jpeg, Width=2048, /nomessage, delete_ps=0
123+
;set_plot,'x'
124+
endif else begin
125+
;set_plot,'x'
126+
fname2=fname
127+
;im=cgsnapshot(filename=fname2,/nodialog,/jpeg)
128+
endelse
129+
130+
endfor
131+
;al_legend, items, lines=ls, colors=cl, /right, charsize=cgdefcharsize()*1.5, linsize=.25
132+
133+
READ_JPEG, fname+'.jpg', a, TRUE=1 & cgimage, a
134+
end

0 commit comments

Comments
 (0)