-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshowjet.pro
182 lines (143 loc) · 7.84 KB
/
showjet.pro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
pro showjet,n,var=var,sample=sample,block=block,xc0=xc0,yc0=yc0,zc0=zc0,chk=chk,nodload=nodload $
,xrange=xrange,yrange=yrange,zrange=zrange, ct=ct, nolog=nolog
device,decomposed=0
if keyword_set(chk) then begin
fname = 'JetSet_hdf5_chk_'+string(n,format='(I4.4)')
print, 'read check point file: '+fname
endif else begin
fname = 'JetSet_hdf5_plt_cnt_'+string(n,format='(I4.4)')
chk=0
endelse
if not keyword_set(var) then var='dens'
if not keyword_set(xc0) then xc0 = -2.e12
if not keyword_set(yc0) then yc0 = 0.
if not keyword_set(zc0) then zc0 = 0.
if not keyword_set(sample) then sample=0
if not keyword_set(ct) then ct=0
if not keyword_set(nolog) then nolog=0
if not keyword_set(xrange) then str_xra = '' $
else str_xra = 'xra=['+strtrim(xrange[0],2)+','+strtrim(xrange[1],1)+']'
if not keyword_set(yrange) then str_yra = '' $
else str_yra = 'yra=['+strtrim(yrange[0],2)+','+strtrim(yrange[1],1)+']'
if not keyword_set(zrange) then str_zra = '' $
else str_zra = 'zra=['+strtrim(zrange[0],2)+','+strtrim(zrange[1],1)+']'
if keyword_set(xrange) then begin
if keyword_set(yrange) then str_yra = ','+str_yra
if keyword_set(zrange) then str_zra = ','+str_zra
endif else if (keyword_seT(yrange) and keyword_set(zrange)) then str_zra = ','+str_zra
str_xyzra = str_xra+str_yra+str_zra
if (strmid(str_xyzra,0,1,/reverse) eq ']') then str_xyzra = str_xyzra+','
if (where(strmatch(['velx','vely','velz','jet'],var) eq 1) ne -1) then nolog=1
read_amr,fname,var='dens',parameters=params,tree=tree ,/nodata
time = params.time
print,'time = ', time
if (keyword_set(nodload) or keyword_set(xrange) or keyword_set(yrange) or keyword_set(zrange)) then $
strexe = execute("data = loaddata(fname,'"+var+"',"+str_xyzra+"sample=sample,lref=lref,xCoord=x,yCoord=y,zCoord=z,time=time)") $
else data = dload(n,var=var,xc=xc0,yc=yc0,zc=zc0,x,y,z,time,sample=sample,lref=lref,chk=chk)
sz = size(data,/dimension)
pltx0=100 & plty0=80
winxs = pltx0+sz[0]+sz[1]+30 & winys = plty0+sz[2]+sz[1]+30
scrsz = get_screen_size()
loadct,ct,/sil
if (((winxs+100) ge scrsz[0]) or ((winys+100) ge scrsz[1])) then $
swindow, xs=winxs, ys=winys $
else window, xs=winxs, ys=winys
xind = (where(x ge xc0))[0] & yind=(where(y ge yc0))[0] & zind=(where(z ge zc0))[0]
dxy = reform(data[*,*,zind])
dyz = reform(data[xind,*,*])
dxz = reform(data[*,yind,*])
; draw slice cuts
maxd = max(data) & mind = min(data)
if not keyword_set(nolog) then begin
tvcoord, bytscl(alog10(dxz),min=alog10(mind),max=alog10(maxd)),x,z,pos=[pltx0,plty0,pltx0+sz[0],plty0+sz[2]],/dev,/axes,xtitle='x [cm]',ytitle='z [cm]'
if keyword_set(block) then showblock,tree=tree,param=params,yc=yc0
tvcoord, bytscl(alog10(dxy),min=alog10(mind),max=alog10(maxd)),x,y,pos=[pltx0,plty0+sz[2],pltx0+sz[0],plty0+sz[1]+sz[2]],/dev,/axes,ytitle='y [cm]',xtickformat='(a1)'
if keyword_set(block) then showblock,tree=tree,param=params,zc=zc0
tvcoord, bytscl(alog10(dyz),min=alog10(mind),max=alog10(maxd)),y,z,pos=[pltx0+sz[0],plty0,pltx0+sz[0]+sz[1],plty0+sz[2]],/dev,/axes,xtitle='y [cm]',ytickformat='(a1)'
if keyword_set(block) then showblock,tree=tree,param=params,xc=xc0
color_bar,lim=[mind,maxd],/log,/up,bartitle=var,pos=[pltx0+sz[0]+20, plty0+sz[2], pltx0+sz[0]+sz[1], plty0+sz[2]+20],titlegap=30.
endif else begin
tvcoord, bytscl(dxz,min=mind,max=maxd),x,z,pos=[pltx0,plty0,pltx0+sz[0],plty0+sz[2]],/dev,/axes,xtitle='x [cm]',ytitle='z [cm]'
if keyword_set(block) then showblock,tree=tree,param=params,yc=yc0
tvcoord, bytscl(dxy,min=mind,max=maxd),x,y,pos=[pltx0,plty0+sz[2],pltx0+sz[0],plty0+sz[1]+sz[2]],/dev,/axes,ytitle='y [cm]',xtickformat='(a1)'
if keyword_set(block) then showblock,tree=tree,param=params,zc=zc0
tvcoord, bytscl(dyz,min=mind,max=maxd),y,z,pos=[pltx0+sz[0],plty0,pltx0+sz[0]+sz[1],plty0+sz[2]],/dev,/axes,xtitle='y [cm]',ytickformat='(a1)'
if keyword_set(block) then showblock,tree=tree,param=params,xc=xc0
color_bar,lim=[mind,maxd],/up,bartitle=var,pos=[pltx0+sz[0]+20, plty0+sz[2], pltx0+sz[0]+sz[1], plty0+sz[2]+20],titlegap=30.
endelse
loadct,0,/sil
xyouts, pltx0+sz[0]+10, plty0+sz[2]+sz[1]-20,/dev,fname
xyouts, pltx0+sz[0]+10, plty0+sz[2]+sz[1]-40,/dev,'time = '+string(time/60./60.,format='(f5.2)')+'hrs'
stop
end
pro shownozzle,n,var=var,rj=rj,lj=lj,block=block,ct=ct
if keyword_set(chk) then begin
fname = 'JetSet_hdf5_chk_'+string(n,format='(I4.4)')
print, 'read check point file: '+fname
endif else begin
fname = 'JetSet_hdf5_plt_cnt_'+string(n,format='(I4.4)')
chk=0
endelse
read_amr,fname,var='dens',parameters=params,tree=tree ,/nodata
if not keyword_set(var) then var='dens'
if not keyword_set(rj) then rj=9.e9
if not keyword_set(lj) then lj=4.395e9
if not keyword_set(ct) then ct=0
xc0 = -2.e12 & yc0=0. & zc0=0.
drange = max([rj,lj])*3.
xrange = [xc0-drange,xc0+drange]
yrange = [-drange,drange]
zrange = [-drange,drange]
data = loaddata(fname,var,sample=0,lref=lref,xra=xrange,yra=yrange,zra=zrange,xCoord=x,yCoord=y,zCoord=z,time=time)
xcind = (where(x ge xc0))[0]
ycind = (where(y ge yc0))[0]
zcind = (where(z ge zc0))[0]
dxy = reform(data[*,*,zcind])
dyz = reform(data[xcind,*,*])
dxz = reform(data[*,ycind,*])
dsz = size(data,/dimension)
if (dsz[0] lt 512) then begin
mult = 512/dsz[0] +1
x = rebin(x,dsz[0]*mult)
y = rebin(y,dsz[1]*mult)
z = rebin(z,dsz[2]*mult)
dxy = rebin(dxy,dsz[0]*mult,dsz[1]*mult)
dyz = rebin(dyz,dsz[1]*mult,dsz[2]*mult)
dxz = rebin(dxz,dsz[0]*mult,dsz[2]*mult)
endif
sz = [dsz[0]*mult,dsz[1]*mult,dsz[2]*mult]
if (where(strmatch(['velx','vely','velz','jet'],var) eq 1) ne -1) then nolog=1 else nolog=0
pltx0=100 & plty0=80
winxs = pltx0+sz[0]+sz[1]+30 & winys = plty0+sz[2]+sz[1]+30
scrsz = get_screen_size()
loadct,ct,/sil
if (((winxs+100) ge scrsz[0]) or ((winys+100) ge scrsz[1])) then $
swindow, xs=winxs, ys=winys $
else window, xs=winxs, ys=winys
; draw slice cuts
maxd = max(data) & mind = min(data)
if not keyword_set(nolog) then begin
tvcoord, bytscl(alog10(dxz),min=alog10(mind),max=alog10(maxd)),x,z,pos=[pltx0,plty0,pltx0+sz[0],plty0+sz[2]],/dev,/axes,xtitle='x [cm]',ytitle='z [cm]'
oplot,[xc0-rj,xc0+rj,xc0+rj,xc0-rj,xc0-rj],[-lj,-lj,lj,lj,-lj],color=0
if keyword_set(block) then showblock,tree=tree,param=params,yc=yc0,/cell
tvcoord, bytscl(alog10(dxy),min=alog10(mind),max=alog10(maxd)),x,y,pos=[pltx0,plty0+sz[2],pltx0+sz[0],plty0+sz[1]+sz[2]],/dev,/axes,ytitle='y [cm]',xtickformat='(a1)'
plots,ring(xc0,yc0,rj),/data,color=0
if keyword_set(block) then showblock,tree=tree,param=params,zc=zc0,/cell
tvcoord, bytscl(alog10(dyz),min=alog10(mind),max=alog10(maxd)),y,z,pos=[pltx0+sz[0],plty0,pltx0+sz[0]+sz[1],plty0+sz[2]],/dev,/axes,xtitle='y [cm]',ytickformat='(a1)'
oplot,[-rj,rj,rj,-rj,-rj],[-lj,-lj,lj,lj,-lj],color=0
if keyword_set(block) then showblock,tree=tree,param=params,xc=xc0,/cell
color_bar,lim=[mind,maxd],/log,/up,bartitle=var,pos=[pltx0+sz[0]+20, plty0+sz[2], pltx0+sz[0]+sz[1], plty0+sz[2]+20],titlegap=30.
endif else begin
tvcoord, bytscl(dxz,min=mind,max=maxd),x,z,pos=[pltx0,plty0,pltx0+sz[0],plty0+sz[2]],/dev,/axes,xtitle='x [cm]',ytitle='z [cm]'
oplot,[xc0-rj,xc0+rj,xc0+rj,xc0-rj,xc0-rj],[-lj,-lj,lj,lj,-lj],color=0
if keyword_set(block) then showblock,tree=tree,param=params,yc=yc0,/cell
tvcoord, bytscl(dxy,min=mind,max=maxd),x,y,pos=[pltx0,plty0+sz[2],pltx0+sz[0],plty0+sz[1]+sz[2]],/dev,/axes,ytitle='y [cm]',xtickformat='(a1)'
plots,ring(xc0,yc0,rj),/data,color=0
if keyword_set(block) then showblock,tree=tree,param=params,zc=zc0,/cell
tvcoord, bytscl(dyz,min=mind,max=maxd),y,z,pos=[pltx0+sz[0],plty0,pltx0+sz[0]+sz[1],plty0+sz[2]],/dev,/axes,xtitle='y [cm]',ytickformat='(a1)'
oplot,[-rj,rj,rj,-rj,-rj],[-lj,-lj,lj,lj,-lj],color=0
if keyword_set(block) then showblock,tree=tree,param=params,xc=xc0,/cell
color_bar,lim=[mind,maxd],/up,bartitle=var,pos=[pltx0+sz[0]+20, plty0+sz[2], pltx0+sz[0]+sz[1], plty0+sz[2]+20],titlegap=30.
endelse
stop
end