-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEvolution_svc_fig4.py
258 lines (216 loc) · 27.6 KB
/
Evolution_svc_fig4.py
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
import matplotlib
import numpy as np
from CM1calc import *
import xarray as xr
import cmocean
import matplotlib.pyplot as plt
import pyart
import gc
import scipy
import matplotlib.patheffects as PathEffects
from scipy.ndimage import gaussian_filter
import dask_image.ndfilters
import dask_image.ndmeasure
import dask.array as da
import matplotlib.patheffects as PathEffects
from matplotlib.offsetbox import AnchoredText
from skimage import measure
dire='resdep125m/'
inputdir='/lustre/research/weiss/schueth/'+dire
output='/home/aschueth/cm1vb19_'+dire
fils=[inputdir+'cm1out_000'+i+'.nc' for i in list(map(str,[241,281,321,361,401,441,481,521,561,601,641,682]))]#only works for 100,999 files
Z = [[0,0],[0,0]]
#svort accum
CS3 = plt.contourf(Z, np.linspace(-37.5,37.51,100),cmap=cmocean.cm.balance,extend='both')
plt.clf()
Z = [[0,0],[0,0]]
#ppert
CS4 = plt.contourf(Z, np.arange(-2.5,-0.24,0.25),cmap=cmocean.cm.deep_r)
plt.clf()
Z = [[0,0],[0,0]]
uhlevels = [x for x in [0,15,30,45,60,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300]]
CS5 = plt.contourf(Z, uhlevels,cmap=cmocean.cm.solar)
plt.clf()
fig = plt.figure(figsize=(50,66.667),facecolor='white')
SMALL_SIZE = 50
MEDIUM_SIZE = 70
BIGGER_SIZE = 80
plt.rc('font', size=SMALL_SIZE) # controls default text sizes
plt.rc('axes', titlesize=MEDIUM_SIZE) # fontsize of the axes title
plt.rc('axes', labelsize=MEDIUM_SIZE) # fontsize of the x and y labels
plt.rc('xtick', labelsize=SMALL_SIZE) # fontsize of the tick labels
plt.rc('ytick', labelsize=SMALL_SIZE) # fontsize of the tick labels
plt.rc('legend', fontsize=SMALL_SIZE) # legend fontsize
plt.rc('figure', titlesize=BIGGER_SIZE) # fontsize of the figure title
ax1=plt.subplot2grid((4,3),(0,0))
ax2=plt.subplot2grid((4,3),(0,1))
ax3=plt.subplot2grid((4,3),(0,2))
ax4=plt.subplot2grid((4,3),(1,0))
ax5=plt.subplot2grid((4,3),(1,1))
ax6=plt.subplot2grid((4,3),(1,2))
ax7=plt.subplot2grid((4,3),(2,0))
ax8=plt.subplot2grid((4,3),(2,1))
ax9=plt.subplot2grid((4,3),(2,2))
ax10=plt.subplot2grid((4,3),(3,0))
ax11=plt.subplot2grid((4,3),(3,1))
ax12=plt.subplot2grid((4,3),(3,2))
ax = [ax1,ax2,ax3,ax4,ax5,ax6,ax7,ax8,ax9,ax10,ax11,ax12]
splot = ['a)','b)','c)','d)','e)','f)','g)','h)','i)','j)','k)','l)']
#Define locations of boundaries
FFCB = {0:np.array([[ 4.86884141, 10.375 ],[ 4.44686139, 9.5 ],[ 4.05423633, 8.625 ],[ 3.64985285, 7.75 ],[ 3.15657047, 7. ],[ 2.62499905, 6.27821522],[ 2.12499905, 5.56459732],[ 1.62499905, 4.85904255],[ 1.12499905, 4.10675905],[ 0.62499905, 3.36482382],[ 0.12499905, 2.53129161],[-0.27386941, 1.75 ],[-0.68231142, 0.875 ],[-1.01718037, 0. ],[-1.35777942, -1. ],[-1.57785562, -2. ]]),
1:np.array([[ 5.99086257, 10.37499976],[ 5.5 , 9.58876788],[ 5. , 8.82126842],[ 4.5 , 8.10436297],[ 3.96253602, 7.37499976],[ 3.4257762 , 6.62499976],[ 2.91093929, 5.87499976],[ 2.44510978, 5.12499976],[ 2. , 4.33265115],[ 1.587627 , 3.49999976],[ 1.21635902, 2.62499976],[ 0.875 , 1.72026292],[ 0.53071672, 0.74999976],[ 0.19872144, -0.12500024],[-0.15546898, -1.00000024],[-0.5 , -1.96384078]]),
2:np.array([[ 8.54061181, 10.375 ],[ 8.06202471, 9.625 ],[ 7.56556684, 8.875 ],[ 7.02764613, 8.125 ],[ 6.5 , 7.43761181],[ 5.875 , 6.76087758],[ 5.25 , 6.13583467],[ 4.65981735, 5.5 ],[ 4.0766735 , 4.875 ],[ 3.44582794, 4.25 ],[ 2.79675029, 3.625 ],[ 2.22093496, 3. ],[ 1.67305726, 2.25 ],[ 1.23266721, 1.5 ],[ 0.76464286, 0.625 ]]),
3:np.array([[10.375 , 8.25187126],[ 9.86647059, 7.625 ],[ 9.25538549, 6.875 ],[ 8.65589245, 6.25 ],[ 8.01777899, 5.625 ],[ 7.375 , 5.01724138],[ 6.75 , 4.45344991],[ 6.09312749, 3.875 ],[ 5.37737192, 3.25 ],[ 4.75 , 2.71335878],[ 4.0501269 , 2.125 ],[ 3.375 , 1.56784387],[ 2.68686709, 1. ],[ 2. , 0.44531857],[ 0.46574946, -0.125 ]]),
4:np.array([[10.375 , 7.02988668],[10.375 , 7.02988668],[ 9.62674014, 6.50000012],[ 8.93103448, 6.00000012],[ 8.25 , 5.4872952 ],[ 7.5 , 4.88574231],[ 6.875 , 4.36104663],[ 6.17069672, 3.75000012],[ 5.5 , 3.14889479],[ 4.875 , 2.55981516],[ 4.25 , 1.954121 ],[ 3.625 , 1.33609359],[ 3. , 0.71863548],[ 2.3679371 , 0.12500012],[ 1.625 , -0.39668623],[ 0.63376241, -0.74999988],[ 0.63376241, -0.74999988]]),
5:np.array([[10.37499905, 7.37302839],[10.37499905, 7.37302839],[ 9.91912729, 6.5 ],[ 9.41274833, 5.75 ],[ 8.87499905, 5.07083333],[ 8.29048368, 4.375 ],[ 7.7377722 , 3.75 ],[ 7.12499905, 3.08843874],[ 6.49999905, 2.43457272],[ 5.87499905, 1.80793919],[ 5.24999905, 1.20754219],[ 4.61306615, 0.625 ],[ 3.89093569, 0. ],[ 3.24999905, -0.52211132],[ 2.49999905, -1.09905872],[ 1.74999905, -1.59587115],[ 0.62499905, -1.72879743],[ 0.18919831, -2. ]]),
6:np.array([[10.37499905, 6.71794872],[10.37499905, 6.71794872],[ 9.97342719, 5.875 ],[ 9.53405989, 5. ],[ 9.08887373, 4.25 ],[ 8.57104221, 3.5 ],[ 8.02771871, 2.75 ],[ 7.49999905, 2.08971554],[ 6.87499905, 1.38119658],[ 6.25916226, 0.75 ],[ 5.62499905, 0.15727949],[ 4.99999905, -0.37591019],[ 4.24999905, -0.96390504],[ 3.51306012, -1.5 ],[ 2.7828739 , -2. ],[ 2.02396999, -2.5 ],[ 1.2600655 , -3. ],[ 0.71073491, -3.25 ]]),
7:np.array([[10.37499905, 5.14187476],[10.37499905, 5.14187476],[ 9.88435487, 4.37499976],[ 9.37499905, 3.63999976],[ 8.87499905, 2.9841315 ],[ 8.24999905, 2.26519584],[ 7.62499905, 1.64401018],[ 6.99999905, 1.08222198],[ 6.2966377 , 0.49999976],[ 5.62499905, -0.01288525],[ 4.87499905, -0.54275102],[ 4.12499905, -1.02038441],[ 3.33282292, -1.50000024],[ 2.51713355, -2.00000024],[ 1.74999905, -2.47853194],[ 1.05659428, -3.00000024],[ 1.05659428, -3.00000024]]),
8:np.array([[10.0418771 , 10.37499988],[10.0418771 , 10.37499988],[ 9.75 , 9.42916655],[ 9.25799663, 8.62499988],[ 8.69444444, 7.99999988],[ 8.125 , 7.31659824],[ 7.59118705, 6.62499988],[ 7.00425926, 5.87499988],[ 6.5 , 5.20577269],[ 5.97619048, 4.49999988],[ 5.42011278, 3.74999988],[ 4.875 , 3.0470587 ],[ 4.33705597, 2.37499988],[ 3.75 , 1.62934911],[ 3.25 , 0.95259197],[ 2.75 , 0.24671863],[ 2.125 , -0.44823168],[ 1.25 , -0.85686215],[ 0.80514812, -1.00000012]]),
9:np.array([[ 6.96101524, 10.37499997],[ 6.96101524, 10.37499997],[ 6.66167707, 9.37499997],[ 6.36166401, 8.49999997],[ 6. , 7.54574533],[ 5.625 , 6.64755008],[ 5.25 , 5.84339149],[ 4.82223633, 4.99999997],[ 4.375 , 4.15968237],[ 3.94499651, 3.37499997],[ 3.5 , 2.56774285],[ 3.04329741, 1.74999997],[ 2.59149545, 0.99999997],[ 2.02019657, 0.24999997],[ 1.36831695, -0.25000003],[ 1.10675568, -0.37500003]]),
10:np.array([[ 6.00493941, 10.37499994],[ 6.00493941, 10.37499994],[ 5.7843808 , 9.37499994],[ 5.51982267, 8.37499994],[ 5.23954877, 7.49999994],[ 4.89232317, 6.49999994],[ 4.56929737, 5.62499994],[ 4.21570777, 4.74999994],[ 3.84115783, 3.87499994],[ 3.45323768, 2.99999994],[ 3.05303227, 2.12499994],[ 2.625 , 1.25018825],[ 2.20821764, 0.49999994],[ 1.73866749, -0.25000006],[ 1.36287306, -0.87500006]]),
11:np.array([[ 4.85817188, 10.375 ],[ 4.85817188, 10.375 ],[ 4.74224356, 9.25 ],[ 4.55779773, 8.125 ],[ 4.32682046, 7.125 ],[ 4.05963549, 6.125 ],[ 3.78140083, 5.125 ],[ 3.5 , 4.16881527],[ 3.18268429, 3.125 ],[ 2.875 , 2.17360569],[ 2.54283591, 1.25 ],[ 2.125 , 0.47097998],[ 1.25 , 0.03820437],[ 0.35426035, -0.25 ],[ 0.35426035, -0.25 ]])}
LFCB = {0:np.array([[-2.125 , 10.8333407 ],[-2.40371941, 9.87499976],[-2.78406406, 8.99999976],[-3.31255745, 8.24999976],[-4. , 7.71610741],[-4.625 , 7.08194115],[-5.18826773, 6.37499976],[-6.01468816, 5.99999976],[-5.65889347, 5.12499976],[-5.25 , 4.3073988 ],[-4.875 , 3.41300135],[-4.68748656, 2.37499976],[-4.34111366, 1.49999976],[-4.30576725, 0.49999976],[-3.75 , -0.15509981],[-3. , -0.71983004],[-2.31562305, -1.25000024],[-1.57785562, -2. ]]),
1:np.array([[-1.125 , 10.93749976],[-2.375 , 10.93749976],[-3.625 , 10.93749976],[-4.875 , 10.93749976],[-5.88462637, 10.74999976],[-5.5 , 9.93749976],[-5.22170903, 8.99999976],[-4.81591188, 8.12499976],[-4.43751344, 7.24999976],[-4.125 , 6.25792431],[-3.81342017, 5.37499976],[-3.84672222, 4.37499976],[-3.44097136, 3.49999976],[-3.25 , 2.62164672],[-3.25 , 1.68196956],[-3.10064436, 0.62499976],[-3.09567697, -0.37500024],[-2.625 , -0.94168864],[-2.125 , -1.68750003],[-1.46199428, -2.25000024],[-0.53898435, -3.00000024]]),
2:np.array([[-9.17434831, 10.37499976],[-8.64184483, 9.62499976],[-8.375 , 8.68367794],[-8.09320439, 7.74999976],[-7.75 , 6.75341377],[-7.27236958, 5.99999976],[-6.875 , 5.14443425],[-6.31476623, 4.49999976],[-5.846849 , 3.74999976],[-5.125 , 3.21313762],[-4.56388601, 2.49999976],[-4.13659701, 1.62499976],[-3.375 , 1.2400567 ],[-2.625 , 0.74185725],[-2. , 0.02176511],[-1.40621656, -0.37500024],[-0.625 , -0.04678567],[ 0.375 , -0.08857955]]),
3:np.array([[-10.5 , 5.4810749 ],[ -9.5 , 5.20361253],[ -8.94021359, 4.5 ],[ -8.237798 , 4. ],[ -7.625 , 3.36288957],[ -7.16511739, 2.5 ],[ -7.25 , 1.5712083 ],[ -6.875 , 0.81384995],[ -6.05592311, .375 ],[ -5.26596008, -0.125 ],[ -4.41537653, -0.5 ],[ -3.5 , -0.7836762 ],[ -2.54134653, -1.125 ],[ -1.75 , -1.56552684]]),
4:np.array([[-10.5 , 7.70786959],[-10. , 6.97128126],[ -9.5 , 6.2395956 ],[ -9.00556839, 5.375 ],[ -8.625 , 4.60194669],[ -8.22641804, 3.75 ],[ -7.90168115, 2.75 ],[ -7.67614316, 1.75 ],[ -7.7891989 , 0.625 ],[ -8.25 , -0.0534288 ],[ -7.51045315, -0.625 ],[ -6.75 , -1.00477268],[ -6. , -1.25463938],[ -5. , -1.50970773],[ -3.75 , -1.57849753],[ -2.75 , -1.82773598],[ -1.53296025, -1.875 ]]),
5:np.array([[20,20]]),
6:np.array([[20,20]]),
7:np.array([[20,20]]),
8:np.array([[-1.05000000e+01, 7.61694952e+00],[-9.50000000e+00, 7.58728605e+00],[-8.65173781e+00, 7.12499988e+00],[-8.12500000e+00, 6.49518699e+00],[-7.44649165e+00, 5.87499988e+00],[-6.97150702e+00, 5.12499988e+00],[-6.62500000e+00, 4.23624640e+00],[-5.85002391e+00, 3.74999988e+00],[-5.17850180e+00, 3.12499988e+00],[-4.93552146e+00, 2.12499988e+00],[-5.12627071e+00, 1.12499988e+00],[-4.87500000e+00, 4.58522515e-01],[-4.00000000e+00, 5.60535060e-05],[-3.12500000e+00, -3.69872323e-01],[-2.37500000e+00, -8.40084544e-01],[-1.58712011e+00, -1.25000012e+00],[-1.00437607e+00, -1.50000012e+00]]),
9:np.array([[-10.5 , 8.76203271],[ -9.5 , 8.81704928],[ -9. , 9.31608935],[ -7.875 , 9.19047912],[ -7.125 , 8.68956658],[ -6.72450415, 7.87499976],[ -6.875 , 7.22064033],[ -6.95669946, 6.87499976],[ -7.04789986, 5.74999976],[ -6.65296811, 4.87499976],[ -7. , 3.88077212],[ -6.89979382, 2.87499976],[ -6.75 , 2.07689593],[ -6.5382696 , 1.24999976],[ -6.375 , 0.664926 ],[ -5.625 , 0.20245688],[ -4.625 , 0.17138454],[ -3.69021436, 0.12499976],[ -3.05374949, -0.50000024],[ -2.125 , -0.33348619],[ -1.25 , -0.71057123],[ -0.5 , -1.23359836],[ -0.08129281, -1.75000024],[ 0.18689288, -2.00000024]]),
10:np.array([[-7.80062665, 10.37499976],[-7.25 , 9.66940956],[-6.75 , 8.87675008],[-7. , 8.11750979],[-7.48106061, 7.62499976],[-7.45262605, 6.99999976],[-7.25 , 6.15612426],[-7.29073788, 5.62499976],[-7.26363336, 4.62499976],[-7.5 , 3.84775409],[-7.125 , 3.00487342],[-6.96750464, 2.24999976],[-6.21529185, 1.74999976],[-5.5 , 1.15920005],[-5. , 0.42970986],[-4.46697673, -0.12500024],[-3.25 , -0.06137962],[-2.625 , 0.14023436]]),
11:np.array([[-6.72943538e+00, 1.03749990e+01],[-7.25000000e+00, 9.73328667e+00],[-7.16852247e+00, 8.87499905e+00],[-6.73404301e+00, 8.12499905e+00],[-6.37566233e+00, 7.12499905e+00],[-6.17479362e+00, 6.12499905e+00],[-6.10899926e+00, 4.99999905e+00],[-5.89377720e+00, 3.87499905e+00],[-5.62500000e+00, 2.99666482e+00],[-5.50354778e+00, 1.99999905e+00],[-4.91233637e+00, 1.37499905e+00],[-4.37500000e+00, 6.89534951e-01],[-3.83750487e+00, -9.53674316e-07],[-2.86989466e+00, -9.53674316e-07],[-1.93397777e+00, -3.75000954e-01],[-1.09835303e+00, -7.50000954e-01],[-2.99407791e-01, -1.25000095e+00]])}
RFGF = {0:np.array([[ -1.57785562, -2. ],[ -1.60362114, -2.12500095],[ -1.5206053 , -3.12500095],[ -1.31911676, -4.12500095],[ -1.64356344, -5.00000095],[ -2.03390069, -5.87500095],[ -2.38501759, -6.75000095],[ -3.25000095, -6.93629274],[ -3.50000095, -7.44290323],[ -4.62500095, -7.30959442],[ -5.75000095, -7.40087208],[ -6.25000095, -8.18626474],[ -6.48758756, -9.25000095],[ -6.44953934, -10.25000095],[ -7.25000095, -9.98961259]]),
1:np.array([[ -0.53898435, -3.00000024],[ -0.56391815, -3.12500095],[ -0.02744441, -3.62500095],[ 0.1761453 , -4.62500095],[ -0.125 , -5.60123542],[ -0.579515 , -6.37500095],[ -0.74516575, -7.25000095],[ -0.82023673, -8.37500095],[ -1.28241204, -9.12500095],[ -2. , -9.69050014],[ -2.75 , -10.15473943]]),
2:np.array([[ 0.51427932, 0. ],[ 0.59418439, -0.12500095],[ 0.96679591, -1.00000095],[ 1.49066436, -1.75000095],[ 1.84547709, -2.62500095],[ 1.858293 , -3.62500095],[ 1.5 , -4.50915729],[ 1.45964414, -5.50000095],[ 1.125 , -6.46505893],[ 0.74488977, -7.25000095],[ 0.36259906, -8.12500095],[ -0.125 , -8.97576152],[ -0.75 , -9.59959326],[ -1.31814942, -10.25000095]]),
3:np.array([[ -1.43162003, -1.625 ],[ -1.39121411, -1. ],[ -1.125 , -0.64516112],[ -0.75 , -0.43864916],[ -0.22826922, -0.375 ],[ 0.25 , -0.184622 ],[ 0.46574946, -0.125 ],[ 1.20238731, -0.625 ],[ 1.72233693, -1.375 ],[ 2.21321487, -2.125 ],[ 2.4553911 , -3.125 ],[ 2.4928142 , -4.125 ],[ 2.30465725, -5.25 ],[ 1.96969376, -6.125 ],[ 1.5 , -6.9885065 ],[ 0.96118724, -7.625 ],[ 0.2394501 , -8.125 ],[ -0.375 , -8.79559955],[ -0.88631255, -9.5 ],[ -1.53021209, -10.125 ]]),
4:np.array([[ 0.63376241, -0.74999988],[ 1.35978357, -0.875 ],[ 2.13233545, -1.25 ],[ 2.60583601, -2.125 ],[ 2.74293087, -3.25 ],[ 2.85296059, -4.375 ],[ 2.61811858, -5.375 ],[ 2.125 , -6.15147099],[ 1.5 , -6.76503115],[ 1.1789083 , -7.75 ],[ 0.85892512, -8.625 ],[ 0.375 , -9.44399365],[ -0.25 , -10.04755724],[ -1.02465353, -10.5 ]]),
5:np.array([[ 0.18919831, -2. ],[ 1.58399213, -2.125 ],[ 1.86527364, -2.5 ],[ 1.9497764 , -3. ],[ 1.84913983, -3.5 ],[ 1.74999905, -3.93710943],[ 1.97294944, -4.375 ],[ 2.0327072 , -4.875 ],[ 1.93583584, -5.375 ],[ 1.73705788, -5.75 ],[ 1.44482313, -6.125 ],[ 1.12251257, -6.375 ],[ 0.74999905, -6.6719915 ],[ 0.62499905, -7.15594265],[ 0.37499905, -7.53693344],[ 0.06686866, -7.875 ],[ -0.21002159, -8.25 ],[ -0.56673425, -8.5 ],[ -1.00000095, -8.62604147],[ -1.37500095, -8.89416334],[ -1.69573607, -9.25 ],[ -2.12500095, -9.49761524],[ -2.32650466, -9.875 ],[ -2.5495531 , -10.25 ]]),
6:np.array([[ 0.71073491, -3.25 ],[ 0.85629957, -3.375 ],[ 1.0731314 , -3.75 ],[ 1.08340591, -4.125 ],[ 1.24999905, -4.58490305],[ 1.42207152, -5. ],[ 1.60578116, -5.5 ],[ 1.73201097, -6. ],[ 1.62385938, -6.5 ],[ 1.37499905, -6.9546024 ],[ 1.37499905, -7.33649709],[ 1.2427425 , -7.75 ],[ 1.23958459, -8.375 ],[ 1.10655302, -8.875 ],[ 0.86734941, -9.25 ],[ 0.54465069, -9.625 ],[ 0.12633921, -9.875 ],[ -0.37500095, -9.9774166 ],[ -0.59711797, -10.375 ]]),
7:np.array([[ 1.12499905, -3.39750445],[ 1.73834799, -3.5 ],[ 2.11528453, -3.75 ],[ 2.37499905, -4.03761851],[ 2.62499905, -4.45851712],[ 2.79896706, -4.875 ],[ 2.87614317, -5.375 ],[ 2.86784586, -5.875 ],[ 2.79399818, -6.5 ],[ 2.69112915, -7. ],[ 2.50573936, -7.5 ],[ 2.37026676, -7.875 ],[ 2.11035367, -8.25 ],[ 1.74999905, -8.549062 ],[ 1.29874995, -8.75 ],[ 1.04180164, -9.125 ],[ 1.23472436, -9.625 ],[ 1.20840937, -10.25 ]]),
8:np.array([[ 0.80514812, -1.00000012],[ 1.30062 , -1.12500095],[ 1.73221552, -1.37500095],[ 2.05170642, -1.62500095],[ 2.375 , -1.93468068],[ 2.625 , -2.27644739],[ 2.86495486, -2.75000095],[ 2.99238036, -3.25000095],[ 3.04619446, -3.75000095],[ 2.99477609, -4.25000095],[ 2.88395062, -4.87500095],[ 2.75 , -5.25069923],[ 2.5 , -5.66060871],[ 2.21459132, -6.00000095],[ 2.34365323, -6.50000095],[ 2.40164647, -7.00000095],[ 2.47692039, -7.62500095],[ 2.5 , -8.19074931],[ 2.53027314, -8.75000095],[ 2.4877456 , -9.25000095],[ 2.36835962, -9.75000095],[ 2.17846296, -10.25000095]]),
9:np.array([[ 1.10675568, -0.37500003],[ 1.62939979, -0.50000095],[ 2.125 , -0.62540865],[ 2.625 , -0.8351729 ],[ 2.97628056, -1.12500095],[ 3.25 , -1.44881008],[ 3.43913075, -1.87500095],[ 3.52951008, -2.37500095],[ 3.75 , -2.76183542],[ 3.97154152, -3.25000095],[ 4.08825713, -3.75000095],[ 4.08581535, -4.37500095],[ 3.96951231, -4.87500095],[ 3.81037555, -5.37500095],[ 3.63541048, -5.87500095],[ 3.48209006, -6.25000095],[ 3.30031944, -6.75000095],[ 3.125 , -7.16309188],[2.92120808, -7.62500095],[ 2.72310699, -8.00000095],[ 2.48355434, -8.37500095],[ 2.17634778, -8.75000095],[ 1.875 , -9.04245844],[ 1.5 , -9.34228495],[ 1.15855097, -9.62500095],[ 0.77820796, -9.87500095],[ 0.375 , -10.04763481],[ 0.125 , -10.30924303]]),
10:np.array([[ 1.36287306, -0.87500006],[ 1.71362849, -1.00000095],[ 2.125 , -1.20219012],[ 2.5 , -1.47851789],[ 2.875 , -1.65558016],[ 3.25 , -1.93156286],[ 3.51756485, -2.25000095],[ 3.71385984, -2.75000095],[ 4. , -3.08924393],[ 4.17800309, -3.50000095],[ 4.17793617, -4.12500095],[ 4.23540356, -4.75000095],[ 4.375 , -5.22949127],[ 4.375 , -5.65038056],[ 4.16731965, -6.12500095],[ 3.875 , -6.38552567],[ 3.75 , -6.85037017],[ 3.75 , -7.27857507],[ 3.58179603, -7.75000095],[ 3.42230761, -8.25000095],[ 3.25 , -8.62963346],[ 2.92264071, -9.00000095],[ 2.59493873, -9.25000095],[ 2.32717827, -9.62500095],[ 2.2166115 , -10.12500095]]),
11:np.array([[ 0.35426035, -0.25 ],[ 1.65731761, -0.37500095],[ 2.125 , -0.55998643],[ 2.5 , -0.77162489],[ 2.875 , -1.09600972],[ 3.125 , -1.49656425],[ 3.25 , -1.95980841],[ 3.45068835, -2.37500095],[ 3.58140948, -2.87500095],[ 3.75701028, -3.25000095],[ 3.98728658, -3.75000095],[ 4.10487848, -4.25000095],[ 4.16701711, -4.75000095],[ 4.04112091, -5.25000095],[ 3.875 , -5.62976305],[ 3.625 , -6.0774093 ],[ 3.47749977, -6.50000095],[ 3.58203839, -7.00000095],[ 3.70726543, -7.50000095],[ 3.79253616, -8.00000095],[ 3.77173643, -8.62500095],[ 3.75 , -9.00724733],[ 3.70711898, -9.50000095],[ 3.54929023, -10.00000095],[ 3.33466213, -10.37500095]])}
LFCB2 = {0:np.array([[20,20]]),
1:np.array([[20,20]]),
2:np.array([[20,20]]),
3:np.array([[20,20]]),
4:np.array([[20,20]]),
5:np.array([[20,20]]),
6:np.array([[20,20]]),
7:np.array([[20,20]]),
8:np.array([[20,20]]),
9:np.array([[ 1.83781716, 10.375 ],[ 1.72866315, 9.25 ],[ 1.375 , 8.35046718],[ 0.94157489, 7.5 ],[ 0.60785583, 6.625 ],[ 0.125 , 5.85878339],[-0.125 , 5.08729433],[-0.45404312, 4.125 ],[-0.67122267, 3.125 ],[-0.70982175, 1.875 ],[-0.625 , 0.70237968]]),
10:np.array([[ 1.10582478e+00, 1.03750000e+01],[ 1.27482941e+00, 9.37500000e+00],[ 1.47189276e+00, 8.25000000e+00],[ 1.54974355e+00, 7.12500000e+00],[ 1.46567415e+00, 6.00000000e+00],[ 1.25000048e+00, 4.95411909e+00],[ 1.00000048e+00, 3.95804940e+00],[ 8.36517824e-01, 2.87500000e+00],[ 8.24285231e-01, 1.62500000e+00],[ 8.00172058e-01, 6.25000000e-01],[ 7.50000477e-01, -4.10689476e-01],[ 5.68905547e-01, -1.37500000e+00],[ 4.06326544e-01, -2.25000000e+00],[ 4.76837158e-07, -1.82958695e+00],[-8.74999523e-01, -1.42615912e+00],[-1.49999952, -1.12116823],[-2.0625,-0.49]]),
11:np.array([[-4.63539640e+00, 1.03749990e+01],[-4.49682540e+00, 9.37499905e+00],[-4.31002031e+00, 8.24999905e+00],[-4.11020780e+00, 7.24999905e+00],[-3.78713823e+00, 6.24999905e+00],[-3.37547670e+00, 5.37499905e+00],[-3.01406960e+00, 4.49999905e+00],[-2.71912951e+00, 3.62499905e+00],[-2.32863708e+00, 2.74999905e+00],[-1.87488242e+00, 1.99999905e+00],[-1.27721995e+00, 1.24999905e+00],[-6.34875206e-01, 6.24999046e-01],[-3.43826855e-04, -9.53674316e-07]])}
FFCB_label_x=[3.5,2,4,4.7,5.5,5.5,5.5,4.75,6,6,5.5,5]
FFCB_label_y=[6,3.3,4,7,7.5,7,7,3,4,6.5,6.25,6.25]
RFGF_label_x=[-2,0,1,1,1.5,1,1.5,3,3,3,4,4]
RFGF_label_y=[-7.1,-7,-8.35,-8.25,-8,-8.1,-8.1,-7.1,-8.8,-8.8,-9,-8.8]
LFCB_label_x=[-9.9,-9,-7.25,-8,-8.5,12,12,12,-5.5,-4.5,-5,-7.5]
LFCB_label_y=[6,5.9,6.65,4.5,5,12,12,12,4,6.75,6.5,3.9]
filename = '/lustre/research/weiss/schueth/resdep125m/cm1out_rst_000001.nc'
ds = xr.open_dataset(filename,chunks={'ni':288,'nj':288})
p_base = (ds["prs"][0,:,:,:]/100)
for i,f in enumerate(fils):
print(i)
ds = xr.open_dataset(fils[i],chunks={'ni':288,'nj':288})
time = (ds['time']/np.timedelta64(1, 's'))
x = ds['xh']
y = ds['yh']
z = ds['z']
w = ds['winterp'].isel(time=0)
zvort = ds['zvort'].isel(time=0)
UH=np.sum((w*zvort).isel(nk=slice(find_nearest(z,2),find_nearest(z,6))),axis=0)
#for a 5 km gaussian kernel, sigma=40 with a 125 m gird spacing
filtered_UH=gaussian_filter(UH,sigma=40)
cy,cx = np.unravel_index(np.argmax(filtered_UH),np.shape(filtered_UH))
x=x-x[cx]
y=y-y[cy]
X,Y=np.meshgrid(x,y)
dxx=dx(x)
ref =ds['dbz'].isel(time=0,nk=0)
u = ds['uinterp'].isel(time=0)
v = ds['vinterp'].isel(time=0)
w = ds['winterp'].isel(time=0)
xvort =ds['xvort'].isel(time=0)
yvort =ds['yvort'].isel(time=0)
zvort =ds['zvort'].isel(time=0)
ppert = ds['prspert'].isel(time=0)/100.
th = ds['th'].isel(time=0,nk=0)
qr = ds['qr'].isel(time=0,nk=0)
qi = ds['qi'].isel(time=0,nk=0)
qc = ds['qc'].isel(time=0,nk=0)
qs = ds['qs'].isel(time=0,nk=0)
qg = ds['qg'].isel(time=0,nk=0)
qv = ds['qv'].isel(time=0,nk=0)
trhopert=perturbation(trho(th,qv,qi,qc,qs,qr,qg),trho(th,qv,qi,qc,qs,qr,qg)[0,-1])
te=thetae(qv, th, p_base[0,:,:])
tep = perturbation(te,te[0,-1])
wind = np.sqrt(u**2+v**2+w**2)
svort=(u*xvort+v*yvort+w*zvort)/wind
svorth=(u*xvort+v*yvort)/np.sqrt(u**2+v**2)
skip= (slice(None, None, int(1.25/dxx)), slice(None, None, int(1.25/dxx)))
#vertically sum and multiply by dz to get the formal Riemann sum
dz=25
tr=ax[i].contourf(X,Y,np.sum(svort[find_nearest(z,0):find_nearest(z,1),:,:],axis=0)*dz,np.linspace(-37.5,37.51,100),cmap=cmocean.cm.balance,extend='both')#,alpha=0.85, antialiased=True)
#plot lines of boundaries according to dictionary above
FFCB_line = ax[i].plot(FFCB[i][:,0],FFCB[i][:,1],color='k',alpha=0.4,linewidth=15,ls='--',path_effects=[PathEffects.withStroke(linewidth=22, foreground="w",alpha=0.4)])
ax[i].scatter(LFCB[i][:,0],LFCB[i][:,1],color='w',alpha=0.4,s=1200)
LFCB_line = ax[i].scatter(LFCB[i][:,0],LFCB[i][:,1],color='k',alpha=0.4,s=700)
ax[i].scatter(LFCB2[i][:,0],LFCB2[i][:,1],color='w',alpha=0.4,s=1200)
LFCB2_line = ax[i].scatter(LFCB2[i][:,0],LFCB2[i][:,1],color='k',alpha=0.4,s=700)
RFGF_line = ax[i].plot(RFGF[i][:,0],RFGF[i][:,1],color='k',alpha=0.4,linewidth=15,ls='-',path_effects=[PathEffects.withStroke(linewidth=22, foreground="w",alpha=0.4)])
t2=ax[i].text(FFCB_label_x[i], FFCB_label_y[i], 'FFCB', verticalalignment='center', horizontalalignment='left',c='k', fontsize=70,alpha=0.4)
t2.set_path_effects([PathEffects.withStroke(linewidth=8,foreground='white')])
t2=ax[i].text(RFGF_label_x[i], RFGF_label_y[i], 'RFGF', verticalalignment='center', horizontalalignment='left',c='k', fontsize=70,alpha=0.4)
t2.set_path_effects([PathEffects.withStroke(linewidth=8,foreground='white')])
if i in [0,1,2,3,4,8]:
t2=ax[i].text(LFCB_label_x[i], LFCB_label_y[i], 'LFCB', verticalalignment='center', horizontalalignment='left',c='k', fontsize=70,alpha=0.4)
t2.set_path_effects([PathEffects.withStroke(linewidth=8,foreground='white')])
if i in [9,10,11]:
t2=ax[i].text(LFCB_label_x[i], LFCB_label_y[i], 'LFCBs', verticalalignment='center', horizontalalignment='left',c='k', fontsize=70,alpha=0.4)
t2.set_path_effects([PathEffects.withStroke(linewidth=8,foreground='white')])
db=ax[i].contour(X, Y, ref, [40], colors='black',linewidths=8)
CS_ppert=ax[i].contour(X,Y,ppert[find_nearest(z,0),:,:],np.arange(-2.5,0.1,0.25),colors='k',linewidths=6,linestyles='solid')
CS_ppert=ax[i].contour(X,Y,ppert[find_nearest(z,0),:,:],np.arange(-2.5,0.1,0.25),cmap=cmocean.cm.deep_r,linewidths=5)
ax[i].contour(X,Y,ppert[find_nearest(z,0),:,:],np.arange(-20,-2.5,0.25),colors=matplotlib.colors.to_hex(cmocean.cm.deep_r(0)),linewidths=1.5)
t1=ax[i].text(0.99, 0.99, 'Time = '+str(int(time[0].values))+' s', verticalalignment='top', horizontalalignment='right',transform=ax[i].transAxes, fontsize=65)
t1.set_path_effects([PathEffects.withStroke(linewidth=8,foreground='white')])
t2=ax[i].text(0.025, 0.975, splot[i], verticalalignment='top', horizontalalignment='left',transform=ax[i].transAxes, fontsize=125)
t2.set_path_effects([PathEffects.withStroke(linewidth=13,foreground='white')])
ax[i].set_xlim(-10,10)
ax[i].set_ylim(-10,10)
ax[i].set_yticks(np.arange(-9,10,3))
ax[i].set_xticks(np.arange(-9,10,3))
if i%3 == 0:
ax[i].set_ylabel('Y [km]')
else:
ax[i].set_yticklabels('')
if int(i/3) == 3:
ax[i].set_xlabel('X [km]')
else:
ax[i].set_xticklabels('')
cbar_ax = plt.axes([1.0, 0.0275, 0.035, 0.9625])
cbar=plt.colorbar(CS3, cax=cbar_ax, ticks=np.linspace(-37.5,37.5,11),extend='both')
cbar.set_label(r'0-1 km Integrated Streamwise Vorticity [m s$^{-1}$]')
cbar_ax = plt.axes([0.05, -0.02 ,0.46, 0.015])
cbar=plt.colorbar(CS4, cax=cbar_ax, ticks=np.arange(-2.5,-0.24,0.25), orientation='horizontal')
loc = np.arange(-2.5,-0.24,0.25) + .125
cbar.set_ticks(loc)
cbar.set_ticklabels(np.arange(-2.5,-0.24,0.25))
cbar.set_label('Pressure Perturbation [hPa]')
patch = matplotlib.patches.Ellipse((0.75,-0.015), 0.04,0.03,linestyle='-',linewidth=5,color='k',fill=False,transform=fig.transFigure,zorder=1000)
ax = fig.add_axes([-0.1,-0.1,1,1],facecolor=None)
ax.xaxis.set_visible(False)
ax.yaxis.set_visible(False)
ax.set_zorder(1000)
ax.add_patch(patch)
ax.patch.set_alpha(0)
ax.axis("off")
ax.text(0.85,-0.012, '40 dBZ', verticalalignment='top', horizontalalignment='right',transform=fig.transFigure, fontsize=65)
fig.subplots_adjust(hspace=0.5, wspace=0.5)
plt.tight_layout(w_pad=0)
plt.savefig('/home/aschueth/pythonscripts/evolution_SVC.png', bbox_inches='tight')