<jupyter_start><jupyter_text>Compare March 14, 2016 currents with OceanViewer<jupyter_code>import netCDF4 as nc
import matplotlib.pyplot as plt
import numpy as np
import pytz

from salishsea_tools import tidetools, viz_tools, nc_tools
from nowcast import research_VENUS
%matplotlib inline
ts=0
fU = nc.Dataset('/results/SalishSea/nowcast/14mar16/SalishSea_1h_20160314_20160314_grid_U.nc')
u = fU.variables['vozocrtx'][ts,0,:,:]

fV = nc.Dataset('/results/SalishSea/nowcast/14mar16/SalishSea_1h_20160314_20160314_grid_V.nc')
v = fV.variables['vomecrty'][ts,0,:,:]

t = nc_tools.timestamp(fU,ts)

print(t.to('US/Pacific'))<jupyter_output>2016-03-13T17:30:00-07:00<jupyter_text>Weird. Oceanviewer is reading the first time as 18:30 PDT - but I think 17:30 PDT or 16:30 PST are correct. 00:30 UTC should be -8 hours to PST which is 4:30pm which is 16:30Maybe the first time in Oceanviewer isn't t=0 on the NEMO file or I am totally confused about timezones?Better trust the time reported on OceanViewer and compare 1830 PDT<jupyter_code>ts=1
fU = nc.Dataset('/results/SalishSea/nowcast/14mar16/SalishSea_1h_20160314_20160314_grid_U.nc')
u = fU.variables['vozocrtx'][ts,0,:,:]

fV = nc.Dataset('/results/SalishSea/nowcast/14mar16/SalishSea_1h_20160314_20160314_grid_V.nc')
v = fV.variables['vomecrty'][ts,0,:,:]

t = nc_tools.timestamp(fU,ts)

print(t.to('US/Pacific'))
grid_B = nc.Dataset('/data/nsoontie/MEOPAR/NEMO-forcing/grid/bathy_meter_SalishSea2.nc')
bathy, X, Y = tidetools.get_bathy_data(grid_B)
Xs=X[1:,1:]
Ys=Y[1:,1:]

mesh_mask = nc.Dataset('/data/nsoontie/MEOPAR/NEMO-forcing/grid/mesh_mask_SalishSea2.nc')

umask = 1- mesh_mask.variables['umask'][0,0,:,:]
vmask = 1- mesh_mask.variables['vmask'][0,0,:,:]
um = np.ma.array(u,mask=umask)
vm = np.ma.array(v,mask=vmask)
urot, vrot = research_VENUS.unstag_rot(um,vm)

uunstag, vunstag = viz_tools.unstagger(um, vm)<jupyter_output><empty_output><jupyter_text>Rotated<jupyter_code>fig,ax = plt.subplots(1,1,figsize=(10,10))

st=10
ax.quiver(Xs[::st,::st],Ys[::st,::st],urot[::st,::st],vrot[::st,::st])
viz_tools.plot_coastline(ax,grid_B,coords='map')<jupyter_output><empty_output><jupyter_text>Not Rotated<jupyter_code>fig,ax = plt.subplots(1,1,figsize=(10,10))

st=10
ax.quiver(Xs[::st,::st],Ys[::st,::st],uunstag[::st,::st],vunstag[::st,::st])
viz_tools.plot_coastline(ax,grid_B,coords='map')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1648444070647603, 'fraction_numerical': 0.07232968881412952, 'mean_word_length': 7.910112359550562, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '628304', 'license': 'Apache-2.0', 'n_tokens_mistral': 1183, 'n_tokens_neox': 1070, 'n_words': 152, 'path': 'Nancy/nowcast/Currents for comparison with Ocean Viewer.ipynb', 'repo_name': 'SalishSeaCast/analysis', 'size': '2378'}