Main Content

matlab.io.hdfeos.sw.defTimePeriod

Namespace: matlab.io.hdfeos.sw

Define time period of interest

Syntax

outpID = defTimePeriod(swathID,start,stop,mode)

Description

outpID = defTimePeriod(swathID,start,stop,mode) defines a time period for a swath. outpID is a swath period ID that can be used to read all the entries of a data field within the time period. The swath structure must have the 'Time' field defined. A cross track is within a time period if a condition is met according to the value of mode:

'MIDPOINT'The midpoint is within the time period.
'ENDPOINT'Either endpoint is within the time period.

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

Examples

import matlab.io.hdfeos.*
swfid = sw.open('swath.hdf');
swathID = sw.attach(swfid,'Example Swath');
starttime =  25;
stoptime = 425;
periodID = sw.defTimePeriod(swathID,starttime,stoptime,'MIDPOINT');
data = sw.extractPeriod(swathID,periodID,'Temperature');
sw.detach(swathID);
sw.close(swfid);