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
A
SampleOperator 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 -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidcomputeSample(int x, int y, Sample[] sourceSamples, WritableSample targetSample) Computes a single target sample from the given source samples.final voidcomputeTile(Band targetBand, Tile targetTile, ProgressMonitor pm) Overridden to call thecomputeSamplemethod 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, prepareInputsMethods 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
-
Constructor Details
-
SampleOperator
public SampleOperator()
-
-
Method Details
-
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
configureSourceSamplesmethod. 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 thecomputeSamplemethod for every pixel in the given tile's rectangle.- Overrides:
computeTilein 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
-