Plotting wind: barbs, wind speedΒΆ

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

# import & initialize epygram
import epygram
epygram.init_env()

import os
INPUTS_DIR = os.path.join('..', 'inputs')
[2]:
r = epygram.formats.resource(os.path.join(INPUTS_DIR, 'ICMSHAROM+0022'), 'r')
[3]:
u = r.readfield('CLSVENT.MERIDIEN')
v = r.readfield('CLSVENT.ZONAL')
uv = epygram.fields.make_vector_field(u,v)
[4]:
fig, ax = uv.cartoplot(subsampling=10, vector_plot_method='barbs', subzone='CI',
                       # ! user got to know the very nature of the field he is plotting:
                       components_are_projected_on='lonlat',
                       map_factor_correction=False)
../../_images/gallery_A.1-H2D_plots_09.wind_plot_4_0.png
[5]:
# or if you don't want wind speed:
fig, ax = uv.cartoplot(subsampling=10, vector_plot_method='barbs', subzone='CI',
                       # ! user got to know the very nature of the field he is plotting:
                       components_are_projected_on='lonlat',
                       plot_method=None)
../../_images/gallery_A.1-H2D_plots_09.wind_plot_5_0.png
[6]:
# or if you want to plot module only:
ff = uv.to_module()
fig, ax = ff.cartoplot(subzone='CI')
../../_images/gallery_A.1-H2D_plots_09.wind_plot_6_0.png
[ ]: