Compute vor/div from u/vΒΆ

[1]:
# for figures in notebook
%matplotlib inline

# import & initialize epygram
import epygram
epygram.init_env()
[2]:
import os
INPUTS_DIR = os.path.join('..', 'inputs')
# open resource in read mode
r = epygram.formats.resource(os.path.join(INPUTS_DIR, 'ICMSHAROM+0022'), 'r')
[3]:
u = r.readfield('S080WIND.U.PHYS')
v = r.readfield('S080WIND.V.PHYS')
# re-compute u/v from psi/khi
uv = epygram.fields.make_vector_field(u, v)
spgeom = u.spectral_geometry
uv.sp2gp()
[4]:
fig, ax = uv.cartoplot(subsampling=5, vector_plot_method='quiver',
                       components_are_projected_on='grid')
../../_images/gallery_C-data_06.wind_transformations_vordiv_4_0.png
[5]:
# fields need to be spectral to compute vor/div : spectral derivatives are used
uv.gp2sp(spgeom)
vor, div = uv.compute_vordiv()
[6]:
# map factor due to stretching:
fig, ax = vor.cartoplot()
fig, ax = div.cartoplot()
../../_images/gallery_C-data_06.wind_transformations_vordiv_6_0.png
../../_images/gallery_C-data_06.wind_transformations_vordiv_6_1.png
[ ]: