Main Content
matlab.io.hdfeos.gd.defBoxRegion
Namespace: matlab.io.hdfeos.gd
Define region of interest by latitude and longitude
Syntax
regionID = defBoxRegion(gridID,cornerLat,cornerLon)
Description
regionID = defBoxRegion(gridID,cornerLat,cornerLon)
defines
a latitude-longitude box region as a subset region for a grid. regionID
can
be used to read all the entries of a data field within the region.
This function corresponds to the GDdefboxregion
function
in the HDF-EOS library C API.
Examples
Define 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);