In [1]:
import numpy as np
import netCDF4 as nc
import matplotlib.pyplot as plt
%matplotlib inline
In [2]:
f = nc.Dataset('/ocean/vdo/MEOPAR/completed-runs/SalishSeaLake/test25/SalishSea_1ts_20160601_20160601_ptrc_T.nc')
In [3]:
np.unravel_index(np.argmax(f.variables['mytracer'][-1,...]), f.variables['mytracer'][-1,...].shape)
Out[3]:
(7, 91, 252)
In [4]:
fig,ax=plt.subplots(1,1,figsize=(10,10))
pmesh=ax.pcolormesh(f.variables['mytracer'][-2,7,:,:],vmin=-5,vmax=5)
fig.colorbar(pmesh)
Out[4]:
<matplotlib.colorbar.Colorbar at 0x7f7ff1c99f60>
/home/vdo/anaconda3/lib/python3.6/site-packages/matplotlib/colors.py:491: RuntimeWarning: overflow encountered in multiply
  xa *= self.N
In [5]:
fig,ax=plt.subplots(1,1,figsize=(10,10))
pmesh=ax.pcolormesh(f.variables['mytracer'][-1,7,100:200,100:200],vmin=-5,vmax=5)
fig.colorbar(pmesh)
Out[5]:
<matplotlib.colorbar.Colorbar at 0x7f7ff02069e8>
In [6]:
f2 = nc.Dataset('/ocean/vdo/MEOPAR/completed-runs/SalishSeaLake/test25/SalishSea_1ts_20160601_20160601_grid_T.nc')
In [7]:
fig,ax=plt.subplots(1,1,figsize=(10,10))
pmesh=ax.pcolormesh(f2.variables['vosaline'][-2,7,100:200,100:200],vmin=26,vmax=30)
fig.colorbar(pmesh)
Out[7]:
<matplotlib.colorbar.Colorbar at 0x7f7ff0113ac8>
In [ ]: