Interface SourceSampleConfigurer


  • public interface SourceSampleConfigurer
    A SourceSampleConfigurer is used to define the source samples processed by a PointOperator.

    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 Detail

      • defineSample

        void defineSample​(int index,
                          String name,
                          Product product)
        Defines a sample for a RasterDataNode in the given product.
        Parameters:
        index - The index of the sample within the sample arrays passed to computeSample() or computePixel() methods.
        name - The name of a RasterDataNode 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 to computeSample() or computePixel() methods.
        dataType - The data type of the computed sample. See TYPE_X constants in ProductData.
        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 to computeSample() or computePixel() 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 to computeSample() or computePixel() 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 to computeSample() or computePixel() methods.
        raster - The index of the source sample that will be filtered.