import numpy as np
import netCDF4 as nc
import matplotlib.pyplot as plt
%matplotlib inline
f = nc.Dataset('/ocean/vdo/MEOPAR/completed-runs/SalishSeaLake/test25/SalishSea_1ts_20160601_20160601_ptrc_T.nc')
np.unravel_index(np.argmax(f.variables['mytracer'][-1,...]), f.variables['mytracer'][-1,...].shape)
(7, 91, 252)
fig,ax=plt.subplots(1,1,figsize=(10,10))
pmesh=ax.pcolormesh(f.variables['mytracer'][-2,7,:,:],vmin=-5,vmax=5)
fig.colorbar(pmesh)
<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
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)
<matplotlib.colorbar.Colorbar at 0x7f7ff02069e8>
f2 = nc.Dataset('/ocean/vdo/MEOPAR/completed-runs/SalishSeaLake/test25/SalishSea_1ts_20160601_20160601_grid_T.nc')
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)
<matplotlib.colorbar.Colorbar at 0x7f7ff0113ac8>