Extract 0D field = Point, from a H2DField¶
[1]:
# for figures in notebook
%matplotlib inline
# import & initialize epygram
import epygram
epygram.init_env()
# path to file
import os
INPUTS_DIR = os.path.join('..', 'inputs')
[2]:
r = epygram.formats.resource(os.path.join(INPUTS_DIR, 'ICMSHAROM+0022'), 'r')
[3]:
f = r.readfield('SURFTEMPERATURE')
[4]:
pt = f.extract_point(8, 45) # 8°E, 45°N
print(type(pt))
print(pt.data)
<class 'epygram.fields.PointField.PointField'>
279.10697361419653
[5]:
val = f.getvalue_ll(8, 45) # 8°E, 45°N
print(type(val))
print(val)
<class 'float'>
279.10697361419653
[ ]: