Main Content


Subset on monotonic field or dimension


regionID_out = defVrtRegion(swathID,regionID,vertObj,range)


regionID_out = defVrtRegion(swathID,regionID,vertObj,range) subsets on a monotonic field or contiguous elements of a dimension. Whereas defBoxRegion and defTimePeriod subset along the 'Track' dimension, this routine allows the user to subset along any dimension. regionID specifies the subsetted region from a previous call. vertObj specifies the dimension by which to subset. range specifies the minimum and maximum values for vertObj.

If there is no current subsetted region, regionID should be 'noprevsub'.

vertObj can be either a dimension or a field. If it is a dimension, then range should consist of dimension indices. If vertObj corresponds to a field, then range should consist of the minimum and maximum field values. vertObj must be one-dimensional in this case, and the its values must be monotonic.

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


swfid ='swath.hdf');
swathID = sw.attach(swfid,'Example Swath');
regionID = sw.defVrtRegion(swathID,'noprevsub','Bands',[450 600]);
data = sw.extractRegion(swathID,regionID,'Spectra');