Interface SourceSampleConfigurer
-
public interface SourceSampleConfigurer
ASourceSampleConfigurer
is used to define the source samples processed by aPointOperator
.The definition of a sample is given by its index within the pixel (a pixel comprises one or more samples) and the name of a
RasterDataNode
in one of the source products.Sample can also be computed on the fly, either by band maths expressions or by filters. See the various
#defineComputedSample(...)
methods.This interface is not intended to be implemented by clients.
- Since:
- SNAP 2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
defineComputedSample(int index, int dataType, String expression, Product... sourceProducts)
Defines an intermediate source sample computed from a band math expression.void
defineComputedSample(int index, int sourceIndex, GeneralFilterBand.OpType opType, Kernel structuringElement)
Defines an intermediate source sample computed from a non-linear image filter.void
defineComputedSample(int index, int sourceIndex, Kernel kernel)
Defines an intermediate source sample computed from a linear image convolution.void
defineComputedSample(int index, RasterDataNode raster)
Defines an intermediate source sample computed from the given raster.void
defineSample(int index, String name)
Defines a sample for aRasterDataNode
.void
defineSample(int index, String name, Product product)
Defines a sample for aRasterDataNode
in the given product.void
setValidPixelMask(String maskExpression)
Defines a mask that identifies valid pixels (region of interest) using a Boolean expression.
-
-
-
Method Detail
-
setValidPixelMask
void setValidPixelMask(String maskExpression)
Defines a mask that identifies valid pixels (region of interest) using a Boolean expression. The framework evaluates the expression for each target pixel. If the mask evaluates to zero, all the target samples are set to their no-data values. Otherwise the respectivecomputePixel
orcomputeSample
are called.- Parameters:
maskExpression
- The Boolean valid-pixel mask expression.- See Also:
RasterDataNode.setNoDataValueUsed(boolean)
,RasterDataNode.setGeophysicalNoDataValue(double)
-
defineSample
void defineSample(int index, String name)
Defines a sample for aRasterDataNode
.- Parameters:
index
- The index of the sample within the sample arrays passed tocomputeSample()
orcomputePixel()
methods.name
- The name of aRasterDataNode
to which the sample belongs.
-
defineSample
void defineSample(int index, String name, Product product)
Defines a sample for aRasterDataNode
in the given product.- Parameters:
index
- The index of the sample within the sample arrays passed tocomputeSample()
orcomputePixel()
methods.name
- The name of aRasterDataNode
to which the sample belongs.product
- The product in which to find the raster data node's name.
-
defineComputedSample
void defineComputedSample(int index, int dataType, String expression, Product... sourceProducts)
Defines an intermediate source sample computed from a band math expression.The method effectively creates a
VirtualBand
from which it computes the source samples.If multiple source products are used a reference number
Product.setRefNo(int)
has to be assigned.- Parameters:
index
- The index of the sample within the sample arrays passed tocomputeSample()
orcomputePixel()
methods.dataType
- The data type of the computed sample. SeeTYPE_X
constants inProductData
.expression
- The band maths expression.sourceProducts
- Source products that are referenced in the expression.
-
defineComputedSample
void defineComputedSample(int index, int sourceIndex, Kernel kernel)
Defines an intermediate source sample computed from a linear image convolution.The method effectively creates a
ConvolutionFilterBand
from which it computes the source samples.- Parameters:
index
- The index of the sample within the sample arrays passed tocomputeSample()
orcomputePixel()
methods.sourceIndex
- The index of the source sample that will be filtered.kernel
- The image convolution kernel.
-
defineComputedSample
void defineComputedSample(int index, int sourceIndex, GeneralFilterBand.OpType opType, Kernel structuringElement)
Defines an intermediate source sample computed from a non-linear image filter.The method effectively creates a
GeneralFilterBand
from which it computes the source samples.- Parameters:
index
- The index of the sample within the sample arrays passed tocomputeSample()
orcomputePixel()
methods.sourceIndex
- The index of the source sample that will be filtered.opType
- The filter operation to be applied to pixels identified by the structuring element.structuringElement
- The structuring element is a Boolean kernel identifying the pixel positions to be filtered.
-
defineComputedSample
void defineComputedSample(int index, RasterDataNode raster)
Defines an intermediate source sample computed from the given raster.The raster is usually either a component of the source products or not attached to any product at all. However, it must not be a component of the target product.
- Parameters:
index
- The index of the sample within the sample arrays passed tocomputeSample()
orcomputePixel()
methods.raster
- The index of the source sample that will be filtered.
-
-