Main Content

matlab.io.hdfeos.gd.getPixValues

Namespace: matlab.io.hdfeos.gd

Read data values for specified pixels

Syntax

data = getPixValues(gridID,rows,cols,fieldname)

Description

data = getPixValues(gridID,rows,cols,fieldname) reads data values for the pixels specified by the zero-based rows and cols coordinates. All entries along the non-geographic dimensions, i.e. NOT XDim and YDim, are returned.

This function corresponds to the GDgetpixvalues function in the HDF-EOS library C API.

Examples

Read the grid field's corner values.

import matlab.io.hdfeos.*
gfid = gd.open('grid.hdf','read');
gridID = gd.attach(gfid,'PolarGrid');
rows = [0 99 99  0];
cols = [0  0 99 99];
data = gd.getPixValues(gridID,rows,cols,'ice_temp');
gd.detach(gridID);
gd.close(gfid);