Abort file visualizations

In [1]:
import numpy as np
import netCDF4 as nc
import matplotlib.pyplot as plt
import xarray as xr
%matplotlib inline
import numpy.ma as ma
In [2]:
abort = xr.open_dataset('/ocean/vdo/MEOPAR/1_output.abort.nc')
mask = nc.Dataset('/ocean/vdo/MEOPAR/analysis-sprints/1_mesh_mask.nc')
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-2-21637047f7c6> in <module>()
----> 1 abort = xr.open_dataset('/ocean/vdo/MEOPAR/1_output.abort.nc')
      2 mask = nc.Dataset('/ocean/vdo/MEOPAR/analysis-sprints/1_mesh_mask.nc')

/home/vdo/anaconda3/lib/python3.6/site-packages/xarray/backends/api.py in open_dataset(filename_or_obj, group, decode_cf, mask_and_scale, decode_times, autoclose, concat_characters, decode_coords, engine, chunks, lock, cache, drop_variables)
    289         if engine == 'netcdf4':
    290             store = backends.NetCDF4DataStore(filename_or_obj, group=group,
--> 291                                               autoclose=autoclose)
    292         elif engine == 'scipy':
    293             store = backends.ScipyDataStore(filename_or_obj,

/home/vdo/anaconda3/lib/python3.6/site-packages/xarray/backends/netCDF4_.py in __init__(self, filename, mode, format, group, writer, clobber, diskless, persist, autoclose)
    208                                    diskless=diskless, persist=persist,
    209                                    format=format)
--> 210         self.ds = opener()
    211         self._autoclose = autoclose
    212         self._isopen = True

/home/vdo/anaconda3/lib/python3.6/site-packages/xarray/backends/netCDF4_.py in _open_netcdf4_group(filename, mode, group, **kwargs)
    183     import netCDF4 as nc4
    184 
--> 185     ds = nc4.Dataset(filename, mode=mode, **kwargs)
    186 
    187     with close_on_error(ds):

netCDF4/_netCDF4.pyx in netCDF4._netCDF4.Dataset.__init__ (netCDF4/_netCDF4.c:13231)()

OSError: No such file or directory
In [24]:
abort.vosaline.isel(deptht=0).plot()
plt.plot(153,268,'ro')   #sept 10/5
Out[24]:
[<matplotlib.lines.Line2D at 0x7fb203b31630>]
In [30]:
tmask = mask.variables['tmask']
In [28]:
init = nc.Dataset('/ocean/vdo/MEOPAR/analysis-sprints/1_output.init.nc')
In [55]:
fig,ax = plt.subplots(1,1)
jj=265
masked = ma.masked_array(init.variables['votemper'][0,:,jj,:],mask = 1-tmask[0,:,jj,:])
mesh = ax.pcolormesh(masked)
fig.colorbar(mesh)
Out[55]:
<matplotlib.colorbar.Colorbar at 0x7fc90d477828>
In [12]:
abort.vosaline.isel(deptht=27).plot()
plt.plot(121,532,'ro')   #sept 10/10
Out[12]:
[<matplotlib.lines.Line2D at 0x7fc91950bb70>]
In [6]:
abort.vomecrty.isel(deptht=0).plot()
Out[6]:
<matplotlib.collections.QuadMesh at 0x7fb0e695e470>
In [7]:
abort.vomecrty.isel(deptht=10).plot()
Out[7]:
<matplotlib.collections.QuadMesh at 0x7fb0e6884710>
In [67]:
abort.vozocrtx.isel(deptht=0).plot(figsize=(14,12), vmin=-1, vmax=1)
Out[67]:
<matplotlib.collections.QuadMesh at 0x7fc9028aa4a8>
In [9]:
abort.vozocrtx.isel(deptht=10).plot()
Out[9]:
<matplotlib.collections.QuadMesh at 0x7fb0e61327f0>
In [10]:
abort.vozocrtx.isel(deptht=20).plot()
Out[10]:
<matplotlib.collections.QuadMesh at 0x7fb0e6049eb8>
In [11]:
abort.vovecrtz.isel(deptht=0).plot()
Out[11]:
<matplotlib.collections.QuadMesh at 0x7fb0e5f46320>
In [12]:
abort.vovecrtz.isel(deptht=10).plot()
Out[12]:
<matplotlib.collections.QuadMesh at 0x7fb0e5ddabe0>
In [29]:
abort.votemper.isel(deptht=27).plot()
plt.plot(121,532,'ro')
Out[29]:
[<matplotlib.lines.Line2D at 0x7fb2005cbda0>]
In [5]:
abort.sossheig.plot()
Out[5]:
<matplotlib.collections.QuadMesh at 0x7fb21aa18a58>