Class CompositeFunction

java.lang.Object
noaa.coastwatch.util.chunk.CompositeFunction
All Implemented Interfaces:
ChunkFunction

public class CompositeFunction extends Object implements ChunkFunction
The CompositeFunction class implements a composite function that takes many chunks and collapses them into just one chunk using a reduction operator. If the number of input chunks is less than the minimum valid, or the input chunks contain all invalid data, the function returns null from the apply(java.util.List<noaa.coastwatch.util.chunk.DataChunk>) method. All input chunks must have the same external data type.
Since:
3.5.0
Author:
Peter Hollemans
  • Constructor Details

    • CompositeFunction

      public CompositeFunction(ArrayReduction operator, int minValid, DataChunk protoChunk)
      Creates a new chunk compositing function.
      Parameters:
      operator - the reduction operator to use for compositing input chunk values.
      minValid - the minimum number of valid input values that must be present to form a composite value, at least 1. If the valid input count falls below the minimum, the output at that chunk location is marked as missing.
      protoChunk - the prototype chunk for the function result. The chunk returned by the apply(java.util.List<noaa.coastwatch.util.chunk.DataChunk>) method will be compatible with the prototype.
  • Method Details

    • apply

      public DataChunk apply(List<DataChunk> inputChunks)
      Description copied from interface: ChunkFunction
      Applies some function to a list of chunks.
      Specified by:
      apply in interface ChunkFunction
      Parameters:
      inputChunks - the list of chunks as input to the function.
      Returns:
      the output chunk of the function, or null if no valid output chunk could be computed.