In [ ]:
%matplotlib inline
%load_ext autoreload
%autoreload 2

In [ ]:
import numpy as np
import matplotlib.pyplot as plt
import netCDF4 as nc
#
import tools
import standard

In [ ]:
fname = '../../examples/example_data/data.nc'
f = nc.Dataset(fname)
lon = f.variables['longitude'][:]
lat = f.variables['latitude'][:]
u = f.variables['u'][:]
v = f.variables['v'][:]
vo = f.variables['vo'][:]

In [ ]:
uu, info = tools.prep_data(u,'tzyx')
vv, _ = tools.prep_data(v,'tzyx')
a = standard.WindHorizontal(uu,vv,lons,lats,'lonlat')
vo2 = a.vort_z()
vo4d = tools.recover_data(vo2,info)

In [ ]:
fig, ax = plt.subplots()
c = ax.contourf(vo[0,0,100:200,:]-vo4d[0,0,100:200,:])
plt.colorbar(c, ax=ax)
fig, (ax1, ax2) = plt.subplots(nrows=2,figsize=(12,10))
c1 = ax1.contourf(vo[0,0,10:230,:])
plt.colorbar(c1,ax=ax1)
c2 = ax2.contourf(vo4d[0,0,10:230,:])
plt.colorbar(c2,ax=ax2)