Package org.esa.snap.core.gpf.pointop
Class SampleOperator
- java.lang.Object
-
- org.esa.snap.core.gpf.Operator
-
- org.esa.snap.core.gpf.pointop.PointOperator
-
- org.esa.snap.core.gpf.pointop.SampleOperator
-
public abstract class SampleOperator extends PointOperator
ASampleOperator
may serve as a handy base class for an operator that computes a single target sample from any number of source samples.- Since:
- BEAM 4.9, revised in SNAP 2.0
-
-
Constructor Summary
Constructors Constructor Description SampleOperator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
computeSample(int x, int y, Sample[] sourceSamples, WritableSample targetSample)
Computes a single target sample from the given source samples.void
computeTile(Band targetBand, Tile targetTile, ProgressMonitor pm)
Overridden to call thecomputeSample
method for every pixel in the given tile's rectangle.-
Methods inherited from class org.esa.snap.core.gpf.pointop.PointOperator
checkRasterSize, configureSourceSamples, configureTargetProduct, configureTargetSamples, createTargetProduct, dispose, initialize, prepareInputs
-
Methods inherited from class org.esa.snap.core.gpf.Operator
canComputeTile, canComputeTileStack, checkForCancellation, computeTileStack, doExecute, ensureSceneGeoCoding, ensureSingleRasterSize, ensureSingleRasterSize, execute, finalize, getId, getLogger, getParameter, getParameter, getProductManager, getSourceProduct, getSourceProduct, getSourceProductId, getSourceProducts, getSourceTile, getSourceTile, getSpi, getTargetProduct, getTargetProperty, setLogger, setParameter, setParameterDefaultValues, setRequiresAllBands, setSourceProduct, setSourceProduct, setSourceProducts, setSpi, setTargetProduct, stopTileComputationObservation, update
-
-
-
-
Method Detail
-
computeSample
protected abstract void computeSample(int x, int y, Sample[] sourceSamples, WritableSample targetSample)
Computes a single target sample from the given source samples.The number of source samples is the maximum defined source sample index plus one. Source samples are defined by using the sample configurer in the
configureSourceSamples
method. Attempts to read from source samples at undefined sample indices will cause undefined behaviour.- Parameters:
x
- The current pixel's X coordinate.y
- The current pixel's Y coordinate.sourceSamples
- The source samples (= source pixel).targetSample
- The single target sample.
-
computeTile
public final void computeTile(Band targetBand, Tile targetTile, ProgressMonitor pm) throws OperatorException
Overridden to call thecomputeSample
method for every pixel in the given tile's rectangle.- Overrides:
computeTile
in classOperator
- Parameters:
targetBand
- The target band.targetTile
- The current tile associated with the target band to be computed.pm
- A progress monitor which should be used to determine computation cancellation requests.- Throws:
OperatorException
- If an error occurs during computation of the target raster
-
-