-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplotstats.py
More file actions
56 lines (49 loc) · 1.45 KB
/
plotstats.py
File metadata and controls
56 lines (49 loc) · 1.45 KB
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
import matplotlib.pyplot as plt
from netCDF4 import Dataset
from matplotlib import cm
from matplotlib.colors import Normalize
#from panormalize import clippedNorm
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
theFig=plt.figure(1)
theFig.clf()
theAx=theFig.add_subplot(121)
the_file='/tera/phil/nchaparr/sam_ensemble/sam_case2/OUT_STAT/NCHAPP1_testing_doscamiopdata.nc'
the_nc=Dataset(the_file)
tke=the_nc.variables['THETAV'][...]
#tke=np.ma.masked_array(tke,mask=the_mask)
z=the_nc.variables['z'][...]
np.savetxt('/tera/phil/nchaparr/python/Plotting/Sep302013/data/heights', z, delimiter=' ')
print z
time=the_nc.variables['time'][...]
nrows,cols=tke.shape
print nrows
print cols
for nrow in range(nrows):
print nrow
if np.mod(nrow, 4) == 0:
#if nrow < 18:
theAx.plot(tke[nrow,:],z)
theAx.set_title('THETAV')
plt.ylim(0, 2500)
plt.xlim(295, 305)
theAx=theFig.add_subplot(122)
the_file='/tera/phil/nchaparr/sam_ensemble/sam_case2/OUT_STAT/NCHAPP1_testing_doscamiopdata.nc'
the_nc=Dataset(the_file)
tke=the_nc.variables['TVFLUX'][...]
#tke=np.ma.masked_array(tke,mask=the_mask)
z=the_nc.variables['z'][...]
time=the_nc.variables['time'][...]
#print time
nrows,cols=tke.shape
for nrow in range(nrows):
if np.mod(nrow, 4) == 0:
#if nrow < 18:
print nrow
theAx.plot(tke[nrow,:],z)
theAx.set_title('TVFLUX')
plt.ylim(0, 2500)
theFig.canvas.draw()
#theFig.savefig('test8.png',dpi=150)
plt.show()