#!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np import matplotlib.pyplot as plt import netCDF4 as nc get_ipython().run_line_magic('matplotlib', 'inline') # In[2]: with nc.Dataset('/data/eolson/MEOPAR/NEMO-forcing-new/grid/mesh_mask201702.nc') as mesh: tmask=mesh.variables['tmask'][:,:,:,:] # In[4]: get_ipython().system('ls /data/sallen/results/MEOPAR/202007/202007D-nociliates') # In[8]: f0=nc.Dataset('/data/sallen/results/MEOPAR/202007/202007D-nociliates/SalishSea_1d_20150101_20150105_ptrc_T_20150101-20150101.nc') # In[9]: f0.variables['ciliates'] # In[10]: np.max(np.ma.masked_where(tmask==0,f0.variables['ciliates'])) # In[16]: fig,ax=plt.subplots(1,1,figsize=(5,10)) m=ax.pcolormesh(np.sum(np.ma.masked_where(f0.variables['ciliates'][0,:,:,:]==0, f0.variables['ciliates'][0,:,:,:]),0)) plt.colorbar(m) # In[17]: fig,ax=plt.subplots(1,1,figsize=(5,10)) m=ax.pcolormesh(np.sum(np.ma.masked_where(tmask[0,:,:,:]==0, f0.variables['ciliates'][0,:,:,:]),0)) plt.colorbar(m) # In[21]: friv=nc.Dataset('/results/forcing/rivers/R201702DFraCElse_y2015m01d01.nc') # In[23]: friv.variables['rorunoff'] # In[26]: fig,ax=plt.subplots(1,2,figsize=(10,10)) m=ax[0].pcolormesh(np.sum(np.ma.masked_where(tmask[0,:,:100,100:200]==0, f0.variables['ciliates'][0,:,:100,100:200]),0)) plt.colorbar(m,ax=ax[0]) m=ax[1].pcolormesh(np.ma.masked_where(friv.variables['rorunoff'][0,:100,100:200]==0, friv.variables['rorunoff'][0,:100,100:200])) plt.colorbar(m,ax=ax[1]) # In[27]: f2=nc.Dataset('/data/sallen/results/MEOPAR/202007/202007D-nociliates/SalishSea_1d_20150516_20150520_ptrc_T_20150518-20150518.nc') # In[28]: fig,ax=plt.subplots(1,1,figsize=(5,10)) m=ax.pcolormesh(np.sum(np.ma.masked_where(f2.variables['ciliates'][0,:,:,:]==0, f2.variables['ciliates'][0,:,:,:]),0)) plt.colorbar(m) # In[ ]: