Package noaa.coastwatch.util
Class MixedGridResampler
java.lang.Object
noaa.coastwatch.util.GridResampler
noaa.coastwatch.util.MixedGridResampler
- Direct Known Subclasses:
ACSPOMixedGridResampler
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:
- The source grid is divided into rectangles of a user-specified size.
- For each rectangle in the source, a polynomial function is derived that maps from destination grid coordinates to source grid coordinates.
- 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 Summary
Modifier and TypeFieldDescriptionstatic final int
The always overwrite mode.static final int
The closer overwrite mode.static final int
The never overwrite mode.protected int
The overwrite mode.protected int
The source coordinate rectangle height.protected int
The source coordinate rectangle width.protected LocationFilter
The source location filter for pixel data.Fields inherited from class noaa.coastwatch.util.GridResampler
destGrids, destTrans, sourceGrids, sourceTrans
-
Constructor Summary
ConstructorDescriptionMixedGridResampler
(EarthTransform sourceTrans, EarthTransform destTrans, int rectWidth, int rectHeight) Creates a new grid resampler from the specified source and destination transforms. -
Method Summary
Modifier and TypeMethodDescriptionvoid
perform
(boolean verbose) Performs the resampling operation on all source / destination pairs.void
setOverwriteMode
(int mode) Sets the overwrite mode.void
setSourceFilter
(LocationFilter filter) Sets the source location filter.Methods inherited from class noaa.coastwatch.util.GridResampler
addGrid
-
Field Details
-
OVERWRITE_NEVER
public static final int OVERWRITE_NEVERThe never overwrite mode.- See Also:
-
OVERWRITE_ALWAYS
public static final int OVERWRITE_ALWAYSThe always overwrite mode.- See Also:
-
OVERWRITE_IF_CLOSER
public static final int OVERWRITE_IF_CLOSERThe closer overwrite mode.- See Also:
-
rectWidth
protected int rectWidthThe source coordinate rectangle width. -
rectHeight
protected int rectHeightThe source coordinate rectangle height. -
overwriteMode
protected int overwriteModeThe overwrite mode. -
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
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 classGridResampler
- Parameters:
verbose
- true for verbose resampling.
-