-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaxback.pro
149 lines (123 loc) · 2.88 KB
/
axback.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
cgDisplay, WID=1,xs=1100, ys=1100,xpos=1200, ypos=800
nbeg=0
nend=nlast
nfile=0
for nfile=nbeg, nend do begin
pload,nfile
time=t[nfile]
den=rho[*,*]
v1 =vx1[*,*]
v2 =vx2[*,*]
v3 =vx3[*,*]
b1 =bx1[*,*]
b2 =bx2[*,*]
b3 =bx3[*,*]
pr =prs[*,*]
x2d=rebin(reform(x1,nx1,1),nx1,nx2)
y2d=rebin(reform(x2,1,nx2),nx1,nx2)
r = x2d;
r2 = r*r;
r3 = r2*r;
betap=1.25e-2
kappa=1.
Bmag = sqrt(2.0*kappa/betap);
bxback= 2.0*Bmag*cos(y2d)/r3;
byback= Bmag*sin(y2d)/r3;
bx1=bx1+bxback
bx2=bx2+byback
xx=x1
yy=!PI/2-x2
polar, den, xx,yy
xx=x1
yy=!PI/2-x2
polar, v1, xx,yy
xx=x1
yy=!PI/2-x2
polar, v2, xx,yy
xx=x1
yy=!PI/2-x2
polar, v3, xx,yy
xx=x1
yy=!PI/2-x2
polar, b1, xx,yy
xx=x1
yy=!PI/2-x2
polar, b2, xx,yy
xx=x1
yy=!PI/2-x2
polar, b3, xx,yy
xx=x1
yy=!PI/2-x2
polar, pr, xx,yy
bx2by2=b1^2+b2^2
print, 'max, min, v1', max(v1), min(v1)
print, 'max, min, v2', max(v2), min(v2)
print, 'max, min, v3', max(v3), min(v3)
print, 'max, min, b1', max(b1), min(b1)
print, 'max, min, b2', max(b2), min(b2)
print, 'max, min, b3', max(b3), min(b3)
dataptr=ptrarr(12)
titlestr=strarr(12,30)
dataptr[0]=ptr_new(v1)
dataptr[1]=ptr_new(v2)
dataptr[2]=ptr_new(v3)
dataptr[3]=ptr_new(b1)
dataptr[4]=ptr_new(b2)
dataptr[5]=ptr_new(b3)
dataptr[6]=ptr_new(pr)
dataptr[7]=ptr_new(alog(den))
dataptr[8]=ptr_new(alog(bx2by2))
titlestr[0,*]='v1'
titlestr[1,*]='v2'
titlestr[2,*]='v3'
titlestr[3,*]='b1'
titlestr[4,*]='b2'
titlestr[5,*]='b3'
titlestr[6,*]='rho'
titlestr[7,*]='rho'
titlestr[8,*]='bx^2+by^2'
cgLoadCT, 22, /Brewer, /Reverse
pos = cglayout([1,1] , OXMargin=[5,5], OYMargin=[5,7], XGap=3, YGap=7)
;FOR j=0,8 DO BEGIN
j=0
p = pos[*,j]
j=7
r=cgscalevector( *dataptr(j), 1,254)
imin=min(*dataptr[j])
imax=max(*dataptr[j])
cgImage, r, Position=p
cgcontour,xx#yy, xx,yy , /nodata, /noerase, xtitle='x', pos=p, title=titlestr(j), Charsize=cgDefCharsize()*0.5
cgColorBar, position=[p[0], p[1]-0.03, p[2], p[1]-0.02],range=[imin-1e-6,imax+1e-6], Charsize=cgDefCharsize()*0.5
;ENDFOR
cgText, 0.5, 0.96, /Normal, 'SDI time='+string(time/2./!DPI, format='(F6.2)'), Alignment=0.5, Charsize=cgDefCharsize()*1.25
bpres=(b1^2+b2^2+b3^2)/2.d
bet=bpres/pr
stag=bpres/den*(v1^2+v2^2+v3^2)
cgcontour,bet, xx,yy,pos=p, levels=1, /overplot
q=13
help, b1
cv1=congrid(b1, q,q)
cv2=congrid(b2, q,q)
cx=congrid(xx, q)
cy=congrid(yy, q)
;velovect, cv1,cv2, cx,cy, /noerase,/overplot, position=pos , color=cgcolor('white'), c_thick=4
xf=2.0
;for i=1.26, xf,0.1 do begin
;field_line, b1, b2, xx,yy, i,0.05, rr,zz
;oplot, rr,zz,color=255
;field_line, b1(0), b2(0), x1,x2, 10,i, rr,zz
;oplot, rr,zz,color=255
;endfor
for qq=x1[1],5,0.25 do begin
seed=[qq,!PI*9.9/20.]
myxq=x1
myyq=x2
br=bx1
bth=bx2/sqrt(xpos^2+ypos^2)
field_line, br,bth,0,myxq,myyq,0,seed=seed ,pl, method="BS23", tol=1.e-6
oplot, pl[0,*]*sin(pl[1,*]), pl[0,*]*cos(pl[1,*]), color=cgcolor('black')
pl=0
seed=0
endfor
endfor
end