Main Content
matlab.io.hdfeos.gd.extractRegion
Namespace: matlab.io.hdfeos.gd
Read region of interest from field
Syntax
data = extractRegion(gridID,regionID,fieldname)
Description
data = extractRegion(gridID,regionID,fieldname)
extract
data from a subsetted region.
This routine corresponds to the GDextractregion
function
in the HDF-EOS library C API.
Examples
Define and extract a region of interest between 20 and 50 degrees latitude and between -90 and -60 degrees longitude.
import matlab.io.hdfeos.* gfid = gd.open('grid.hdf','read'); gridID = gd.attach(gfid,'PolarGrid'); cornerlat = [20 50]; cornerlon = [-90 -60]; regionID = gd.defBoxRegion(gridID,cornerlat,cornerlon); data = gd.extractRegion(gridID,regionID,'ice_temp'); gd.detach(gridID); gd.close(gfid);