Plot the z/p characteristics of a Hybrid-Pressure vertical coordinate

(cf. python package pyvgrid from PyPI and its command-line tool mkvgrid to build new vertical coordinates)

[1]:
# import & initialize epygram
import epygram
epygram.init_env()

import os
INPUTS_DIR = os.path.join('..', 'inputs')
# [2025/01/16-17:43:10][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]:
# open resource in read mode
r = epygram.open(os.path.join(INPUTS_DIR, 'ICMSHAROM+0022'), 'r')
hybridP_geo = r.readfield('S058TEMPERATURE').geometry.vcoordinate
[3]:
vmean = "LAPRXPK=False"  # or 'geometric' or 'arithmetic'
[4]:
vg = r.geometry.vcoordinate.to_vgrid(vertical_mean=vmean,
                                     vgrid_name=r.container.basename)
[5]:
# y and x may be among ('z', 'p', 'level', 'pthickness', 'zthickness')
fig = vg.bokeh_plot_y_vs_x('level', 'pthickness')
[6]:
# Save and open html output file:
# vg.bokeh_fig_to_html(fig)

# which will look like:

title

[7]:
print(vg.write_AB_to_namelist())
None
[ ]: