Package org.esa.snap.core.dataop.barithm
Class RasterDataLoop
java.lang.Object
org.esa.snap.core.dataop.barithm.RasterDataLoop
A utility class which is used to iterate over all pixels within a region of a data raster and to evaluate
any number of
Terms on each pixel.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceRepresents the body to be evaluated for each pixel within the raster. -
Constructor Summary
ConstructorsConstructorDescriptionRasterDataLoop(int offsetX, int offsetY, int regionWidth, int regionHeight, Term[] terms, ProgressMonitor pm) Creates an instance of this class for the given region and terms.RasterDataLoop(RasterDataEvalEnv rasterDataEvalEnv, Term[] terms, ProgressMonitor pm) Creates an instance of this class for the given region and terms. -
Method Summary
Modifier and TypeMethodDescriptionvoidEvaluates thebodyby calling itseval()method.voidforEachPixel(RasterDataLoop.Body body, String message) Evaluates thebodyby calling itseval()method.intintintintTerm[]getTerms()
-
Constructor Details
-
RasterDataLoop
public RasterDataLoop(int offsetX, int offsetY, int regionWidth, int regionHeight, Term[] terms, ProgressMonitor pm) Creates an instance of this class for the given region and terms.- Parameters:
offsetX- the X-offset of the region.offsetY- the Y-offset of the region.regionWidth- the width of the region.regionHeight- the height of the region.terms- an array of terms.pm- a monitor to inform the user about progress
-
RasterDataLoop
Creates an instance of this class for the given region and terms.- Parameters:
rasterDataEvalEnv- the raster data evaluation environment passed to the term evaluationterms- an array of terms.pm- a monitor to inform the user about progress
-
-
Method Details
-
getOffsetX
public int getOffsetX() -
getOffsetY
public int getOffsetY() -
getRegionWidth
public int getRegionWidth() -
getRegionHeight
public int getRegionHeight() -
getTerms
-
forEachPixel
Evaluates thebodyby calling itseval()method. This method just delegates toforEachPixel(body, null).- Parameters:
body- the object whoseevalmethod is called.- Throws:
IOException- if the raster data could not be read.
-
forEachPixel
Evaluates thebodyby calling itseval()method.- Parameters:
body- the object whoseevalmethod is called.message- the progress message- Throws:
IOException- if the raster data could not be read.
-