Recompute u/v from psi/khi (Arpege)¶
[1]:
# for figures in notebook
%matplotlib inline
# import & initialize epygram
import epygram
epygram.init_env()
# [2025/01/16-17:42:17][epygram.formats][<module>:0072][INFO]: Format: HDF5SAF is deactivated at runtime (Error: No module named 'h5py'). Please deactivate from config.implemented_formats or fix error.
[2]:
import os
INPUTS_DIR = os.path.join('..', 'inputs')
# open resource in read mode
r = epygram.open(os.path.join(INPUTS_DIR, 'analysis.full-arpege.tl149-c24.fa'), 'r')
[3]:
psi = r.readfield('S050FONC.COURANT')
khi = r.readfield('S050POT.VITESSE')
# re-compute u/v from psi/khi
uv = epygram.fields.psikhi2uv(psi, khi)
Setup spectral transform
End Setup spectral transform
[4]:
fig, ax = uv.cartoplot(subsampling=5, vector_plot_method='quiver',
components_are_projected_on='grid')
Be careful to projections of wind components !¶
[5]:
# wrong projection:
fig, ax = uv.cartoplot(subsampling=5, vector_plot_method='quiver',
components_are_projected_on='lonlat')
and stretched grids !¶
[6]:
# map factor due to stretching:
fig, ax = uv.cartoplot(subsampling=5, vector_plot_method='quiver',
components_are_projected_on='grid',
map_factor_correction=False)
# [2025/01/16-17:42:20][epygram._plugins.with_cartopy.H2DVectorField][_cartoplot_set_figure_and_module:0048][WARNING]: check carefully *map_factor_correction* w.r.t. dilatation_coef
# [2025/01/16-17:42:20][epygram.geometries.GaussGeometry][reproject_wind_on_lonlat:0704][WARNING]: check carefully *map_factor_correction* w.r.t. dilatation_coef
[ ]: