#!/usr/bin/env python # coding: utf-8 # In[2]: import numpy as np import xarray as xr import math import matplotlib.pyplot as plt get_ipython().run_line_magic('matplotlib', 'inline') # In[4]: ds = xr.open_dataset('/data/jpetrie/MEOPAR/SalishSea/results/d9f69a38-160e-11e6-9b98-0025909a8461/SS5x5_1h_20041019_20041023_ptrc_T.nc') # In[5]: print(ds) # In[9]: print(ds.dims) print(ds.dims['deptht']) # In[10]: ds.data_vars # In[21]: ds.coords['nav_lat'].values # In[16]: ds.attrs # In[10]: # In[50]: data_subset = ds.POC.values[:,:,2,2].T fig, ax = plt.subplots(1, 1,figsize=(15,15)) mesh = ax.pcolormesh(data_subset) fig.colorbar(mesh) mesh.set_clim(vmin=data_subset.min(), vmax=data_subset.max()) # In[46]: data_subset.max()