Main Content

matlab.io.hdfeos.sw.readField

Namespace: matlab.io.hdfeos.sw

Read data from swath field

Syntax

data = readField(swathID,fieldname)
data = readField(swathID,fieldname,start,count)
data = readField(swathID,fieldname,start,count,stride)

Description

data = readField(swathID,fieldname) reads an entire swath field.

data = readField(swathID,fieldname,start,count) reads a contiguous hyperslab of data from the swath field fieldname. The start input specifies the zero-based index of the first element to be read. count specifies the number of elements along each dimension to read.

data = readField(swathID,fieldname,start,count,stride) reads a strided hyperslab of data from the swath field fieldname. The stride input specifies the inter-element spacing along each dimension.

This function corresponds to the SWreadfield function in the HDF-EOS library C API, but because MATLAB® uses FORTRAN-style ordering, the start, count, and stride parameters are reversed with respect to the C library API.

Examples

import matlab.io.hdfeos.*
swfid = sw.open('swath.hdf');
swathID = sw.attach(swfid,'Example Swath');
data = sw.readField(swathID,'Longitude');
sw.detach(swathID);
sw.close(swfid);