Class MixedGridResampler

java.lang.Object
noaa.coastwatch.util.GridResampler
noaa.coastwatch.util.MixedGridResampler
Direct Known Subclasses:
ACSPOMixedGridResampler

public class MixedGridResampler extends GridResampler
The MixedGridResampler class performs generic data resampling between 2D earth transforms using a mix of forward and inverse resampling methods. The steps are as follows:
  1. The source grid is divided into rectangles of a user-specified size.
  2. For each rectangle in the source, a polynomial function is derived that maps from destination grid coordinates to source grid coordinates.
  3. For each coordinate in each rectangle in the destination grid, a source coordinate is computed and data from the source grid transferred to the destination.
Since:
3.1.9
Author:
Peter Hollemans
  • Field Details

    • OVERWRITE_NEVER

      public static final int OVERWRITE_NEVER
      The never overwrite mode.
      See Also:
    • OVERWRITE_ALWAYS

      public static final int OVERWRITE_ALWAYS
      The always overwrite mode.
      See Also:
    • OVERWRITE_IF_CLOSER

      public static final int OVERWRITE_IF_CLOSER
      The closer overwrite mode.
      See Also:
    • rectWidth

      protected int rectWidth
      The source coordinate rectangle width.
    • rectHeight

      protected int rectHeight
      The source coordinate rectangle height.
    • overwriteMode

      protected int overwriteMode
      The overwrite mode.
    • sourceFilter

      protected LocationFilter sourceFilter
      The source location filter for pixel data.
  • Constructor Details

    • MixedGridResampler

      public MixedGridResampler(EarthTransform sourceTrans, EarthTransform destTrans, int rectWidth, int rectHeight)
      Creates a new grid resampler from the specified source and destination transforms.
      Parameters:
      sourceTrans - the source earth transform.
      destTrans - the destination earth transform.
      rectWidth - the source rectangle width.
      rectHeight - the source rectangle height.
  • Method Details

    • setSourceFilter

      public void setSourceFilter(LocationFilter filter)
      Sets the source location filter. When set, the filter is used to determine if a source grid location should be used in the registration. By default, all source grid locations are used if they map to a destination location.
      Parameters:
      filter - the source location filter, or null for none.
    • setOverwriteMode

      public void setOverwriteMode(int mode)

      Sets the overwrite mode. If during the resampling, more than one source pixel is mapped to the same destination pixel, the overwrite mode is used to determine if the old value should be overwritten with the new value:

      • OVERWRITE_NEVER - Keep the first data value and never overwrite it.
      • OVERWRITE_ALWAYS - Always overwrite the data value with a new value. This is the default.
      • OVERWRITE_IF_CLOSER - Only overwrite the data value if the new value is closer in physical location to the destination than the previous value.
      Parameters:
      mode - the new overwrite mode value.
    • perform

      public void perform(boolean verbose)
      Description copied from class: GridResampler
      Performs the resampling operation on all source / destination pairs.
      Specified by:
      perform in class GridResampler
      Parameters:
      verbose - true for verbose resampling.