Abort file visualizations
import numpy as np
import netCDF4 as nc
import matplotlib.pyplot as plt
import xarray as xr
%matplotlib inline
import numpy.ma as ma
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
abort.vosaline.isel(deptht=0).plot()
plt.plot(153,268,'ro') #sept 10/5
[<matplotlib.lines.Line2D at 0x7fb203b31630>]
tmask = mask.variables['tmask']
init = nc.Dataset('/ocean/vdo/MEOPAR/analysis-sprints/1_output.init.nc')
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)
<matplotlib.colorbar.Colorbar at 0x7fc90d477828>
abort.vosaline.isel(deptht=27).plot()
plt.plot(121,532,'ro') #sept 10/10
[<matplotlib.lines.Line2D at 0x7fc91950bb70>]
abort.vomecrty.isel(deptht=0).plot()
<matplotlib.collections.QuadMesh at 0x7fb0e695e470>
abort.vomecrty.isel(deptht=10).plot()
<matplotlib.collections.QuadMesh at 0x7fb0e6884710>
abort.vozocrtx.isel(deptht=0).plot(figsize=(14,12), vmin=-1, vmax=1)
<matplotlib.collections.QuadMesh at 0x7fc9028aa4a8>
abort.vozocrtx.isel(deptht=10).plot()
<matplotlib.collections.QuadMesh at 0x7fb0e61327f0>
abort.vozocrtx.isel(deptht=20).plot()
<matplotlib.collections.QuadMesh at 0x7fb0e6049eb8>
abort.vovecrtz.isel(deptht=0).plot()
<matplotlib.collections.QuadMesh at 0x7fb0e5f46320>
abort.vovecrtz.isel(deptht=10).plot()
<matplotlib.collections.QuadMesh at 0x7fb0e5ddabe0>
abort.votemper.isel(deptht=27).plot()
plt.plot(121,532,'ro')
[<matplotlib.lines.Line2D at 0x7fb2005cbda0>]
abort.sossheig.plot()
<matplotlib.collections.QuadMesh at 0x7fb21aa18a58>
abort2 = xr.open_dataset('/ocean/vdo/MEOPAR/analysis-sprints/1_output.abort.nc')
abort2.vomecrty.isel(deptht=0).plot()
<matplotlib.collections.QuadMesh at 0x7fb21848e780>
abort.sossheig.plot(figsize=((14,12)), vmin = 0.4, vmax = 1.4)
#plt.plot(309,403,'ro')
<matplotlib.collections.QuadMesh at 0x7fc90c1f3710>
abort2.vosaline.isel(deptht=0).plot()
plt.plot(120,533,'ro') #june 10/5
[<matplotlib.lines.Line2D at 0x7fb201abf630>]
abort2.votemper.isel(deptht=0).plot()
plt.plot(309,403,'ro') #from jun 10/10
[<matplotlib.lines.Line2D at 0x7fc919280f98>]
abort2.votemper.isel(deptht=25).plot()
plt.plot(403,314,'ro') #from mar 10/10
[<matplotlib.lines.Line2D at 0x7fc91b965e80>]
bathy = xr.open_dataset('/ocean/vdo/MEOPAR/analysis-sprints/NEMO-forcing-HS1/1_bathymetry_201702.nc')
coord = xr.open_dataset('/ocean/vdo/MEOPAR/analysis-sprints/NEMO-forcing-HS1/1_coordinates_seagrid_SalishSea201702.nc')
bathy.Bathymetry.plot()
<matplotlib.collections.QuadMesh at 0x7fc91ba24f60>