-
-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathSurfaceRunoff.py
More file actions
18 lines (18 loc) · 750 Bytes
/
SurfaceRunoff.py
File metadata and controls
18 lines (18 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from netCDF4 import Dataset
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
ldas = Dataset('201108290000.LDASOUT_DOMAIN1', 'r')
ldas_vars = ldas.variables
VolumetricSoilMoisture = ldas_vars['SOIL_W'][:]
VSM_Layer0 = np.flip(VolumetricSoilMoisture[0,:,0,:], 0)
VSM_Layer1 = np.flip(VolumetricSoilMoisture[0,:,1,:], 0)
VSM_Layer2 = np.flip(VolumetricSoilMoisture[0,:,2,:], 0)
VSM_Layer3 = np.flip(VolumetricSoilMoisture[0,:,3,:], 0)
SurfaceRunoff = ldas_vars['UGDRNOFF'][:]
SurfaceRunoff = np.flip(SurfaceRunoff[0,:,:], 0)
fig = plt.figure(figsize=(6,6),dpi=200)
im = plt.imshow(SurfaceRunoff, vmin=0.0, vmax=300)
cb = fig.colorbar(im, orientation='horizontal')
cb.set_label('Surface runoff (mm)')
plt.savefig('SurfaceRunoff.pdf')