-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfigure_rainfall_forcing_panels_4x2.py
107 lines (79 loc) · 2.83 KB
/
figure_rainfall_forcing_panels_4x2.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
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 30 15:41:30 2016
@author: raul
"""
import OrographicFor as of
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from matplotlib import rcParams
from rv_utilities import discrete_cmap
rcParams['mathtext.default'] = 'sf'
rcParams['xtick.labelsize'] = 15
rcParams['ytick.labelsize'] = 15
rcParams['legend.fontsize'] = 15
dates = {0:{'t0':'2003-01-12','t1':'2003-01-15','vmax':20},
1:{'t0':'2003-01-21','t1':'2003-01-24','vmax':25},
2:{'t0':'2003-02-15','t1':'2003-02-17','vmax':18},
3:{'t0':'2004-01-09','t1':'2004-01-10','vmax':90},
4:{'t0':'2004-02-02','t1':'2004-02-03','vmax':40},
5:{'t0':'2004-02-16','t1':'2004-02-19','vmax':100},
6:{'t0':'2004-02-25','t1':'2004-02-26','vmax':95}}
scale=1.1
plt.figure(figsize=(11*scale,11*scale))
gs0 = gridspec.GridSpec(4, 2,
wspace=0.2,
hspace=0.3)
ax = []
ax.append(plt.subplot(gs0[0],gid='(a) 12-14Jan03'))
ax.append(plt.subplot(gs0[1],gid='(b) 21-23Jan03'))
ax.append(plt.subplot(gs0[2],gid='(c) 15-16Feb03'))
ax.append(plt.subplot(gs0[3],gid='(d) 09Jan04'))
ax.append(plt.subplot(gs0[4],gid='(e) 02Feb04'))
ax.append(plt.subplot(gs0[5],gid='(f) 16-18Feb04'))
ax.append(plt.subplot(gs0[6],gid='(g) 25Feb04'))
source='/localdata/SURFACE/climatology/'
matfs = ['avg60_CZC03_nortype.mat',
'avg60_CZC04_nortype.mat']
cmap = discrete_cmap(7, base_cmap='Set1')
for c in range(7):
if c == 3:
leg_bool=True
else:
leg_bool=False
if c in [0,1,2]:
matfile=source+matfs[0]
else:
matfile=source+matfs[1]
t0=dates[c]['t0']
t1=dates[c]['t1']
hax = of.plot(ax[c],
matfile,t0,t1,
legend = leg_bool,
add = ('bulk','upslope'),
lcolors = (cmap(0),cmap(1)),
ylims = ([0,100], [0,35]),
second_axis = 'bulk',
lw = 2,
legend_loc = (0.75,0.7,0.2,0.2),
# ylim = [0, dates[c]['vmax']],
xtickfreq = '12H',
)
if c == 5:
txt = r'$\leftarrow UTC \left[\stackrel{day}{time}\right]$'
hax[0].set_xlabel(txt,fontsize=20)
if c not in [0]:
hax[0].set_ylabel('')
if c not in [3]:
hax[1].set_ylabel('')
if c not in [5]:
hax[0].set_xlabel('')
if c in [0,1,2]:
hax[1].set_yticks([])
ax[c].text(0.05,0.95,ax[c].get_gid(),size=14,va='top',
weight='bold',transform=ax[c].transAxes,
backgroundcolor='w',clip_on=True)
#plt.show()
fname='/home/raul/Desktop/fig_rainfall_forcing.png'
plt.savefig(fname, dpi=300, format='png',papertype='letter',
bbox_inches='tight')