#!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np import netCDF4 as nc import matplotlib.pyplot as plt get_ipython().run_line_magic('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) # 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) # 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) # 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) # In[ ]: