Extract a subarray, keeping projectionΒΆ
[1]:
%matplotlib inline
# for figures in notebook
# import & initialize epygram
import epygram
epygram.init_env()
import os
INPUTS_DIR = os.path.join('..', 'inputs')
[2]:
# open resource in read mode
r = epygram.formats.resource(os.path.join(INPUTS_DIR, 'ICMSHAROM+0022'), 'r')
[3]:
f = r.readfield('SURFTEMPERATURE')
print(type(f.geometry))
print(f.geometry.dimensions)
z = f.extract_subarray(10, 45, 25, 105)
print(type(z.geometry))
print(z.geometry.dimensions)
<class 'epygram.geometries.ProjectedGeometry.ProjectedGeometry'>
{'X': 250, 'Y': 250, 'X_CIzone': 240, 'Y_CIzone': 240, 'X_Iwidth': 16, 'Y_Iwidth': 16, 'X_Czone': 208, 'Y_Czone': 208, 'X_CIoffset': 0, 'Y_CIoffset': 0}
<class 'epygram.geometries.ProjectedGeometry.ProjectedGeometry'>
{'X': 36, 'Y': 81}
[ ]: