Interpolate (resample) on a lon/lat regular gridΒΆ
!!! FIXME: resampling to/from Gauss grids is currently broken
[1]:
%matplotlib inline
# for figures in notebook
# import & initialize epygram
import epygram
epygram.init_env()
import os
INPUTS_DIR = os.path.join('..', 'inputs')
# [2025/01/16-17:42:49][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]:
gauss = epygram.open(os.path.join(INPUTS_DIR, 'analysis.full-arpege.tl149-c24.fa'), 'r')
lam = epygram.open(os.path.join(INPUTS_DIR, 'ICMSHAROM+0022'), 'r')
[3]:
fg = gauss.readfield('SURFTEMPERATURE')
[4]:
#fgl = fg.resample_on_regularll(dict(lonmin=-10, lonmax=15, latmin=35, latmax=55),
# resolution_in_degrees=0.2,
# reduce_data=False)
[5]:
#fgl.geometry
[6]:
#fig, ax = fgl.cartoplot()
[7]:
fl = lam.readfield('SURFTEMPERATURE')
[8]:
flr = fl.resample_on_regularll(dict(lonmin=-5, lonmax=15, latmin=40, latmax=50),
resolution_in_degrees=0.5,
reduce_data=False,
subzone='CI')
[9]:
fig, ax = flr.cartoplot()
/home/mary/venvs/epygram/lib/python3.10/site-packages/matplotlib/colors.py:744: RuntimeWarning: overflow encountered in multiply
xa *= self.N
/home/mary/venvs/epygram/lib/python3.10/site-packages/matplotlib/colors.py:744: RuntimeWarning: overflow encountered in multiply
xa *= self.N
/home/mary/venvs/epygram/lib/python3.10/site-packages/matplotlib/colors.py:744: RuntimeWarning: overflow encountered in multiply
xa *= self.N
[ ]: