|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectObjectiveAnalysis
public class ObjectiveAnalysis
Computes values at the location of grid cells from a set of values at random locations.
This class is typically used for computing values on a regular grid (the output) from a
set of values at random locations (the input). However the class can also be used for
creating non-regular grids. For creating a non-regular grid, user should subclass
ObjectiveAnalysis and override the getOutputLocation(...)
method.
| analytics/geotk-analytics (download) | View source code for this class |
| Constructor Summary | |
|---|---|
ObjectiveAnalysis(Rectangle2D gridRegion,
int nx,
int ny,
PixelOrientation cellLocation)
Creates a new instance for interpolating values in the given region. |
|
| Method Summary | |
|---|---|
protected double |
correlation(Point2D.Double P1,
Point2D.Double P2)
Returns the correlation between the values at the two given points. |
RenderedImage |
createImage()
Creates an image from the values interpolated at the locations defined by the getOutputLocation(...) method. |
int |
getOutputLength()
Returns the number of points to be computed by this instance. |
Point2D.Double |
getOutputLocation(int index,
Point2D.Double dest)
Returns the (x,y) coordinate of the point evaluated at the given index. |
double[] |
interpolate(double[] dest)
Uses the values given to the setInputs(...) |
float[] |
interpolate(float[] dest)
Uses the values given to the setInputs(...) |
void |
setInputs(double[] xp,
double[] yp,
double[] zp)
Sets the input values at the given points. |
void |
setInputs(float[] xp,
float[] yp,
float[] zp)
Sets the input values at the given points. |
void |
setInputs(Vector xp,
Vector yp,
Vector zp)
Sets the input values at the given points. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ObjectiveAnalysis(Rectangle2D gridRegion,
int nx,
int ny,
PixelOrientation cellLocation)
gridRegion - The grid bounding box. The maximal ordinates are inclusive.nx - The number of grid cells along the x axis.ny - The number of grid cells along the y axis.cellLocation - The position to evaluate in each grid cell.| Method Detail |
|---|
public void setInputs(double[] xp,
double[] yp,
double[] zp)
interpolate methods for interpolating new values
at the locations defined by getOutputLocation(int, Point2D.Double).
This convenience method wraps the given arrays in Vector objects
and delegates to setInputs(Vector, Vector, Vector).
xp - The x ordinates of a random set of points.yp - The y ordinates of a random set of points.zp - The z values at the (x,y) coordinates
defined by the xp and yp arguments.
public void setInputs(float[] xp,
float[] yp,
float[] zp)
interpolate methods for interpolating new values
at the locations defined by getOutputLocation(int, Point2D.Double).
This convenience method wraps the given arrays in Vector objects
and delegates to setInputs(Vector, Vector, Vector).
xp - The x ordinates of a random set of points.yp - The y ordinates of a random set of points.zp - The z values at the (x,y) coordinates
defined by the xp and yp arguments.
public void setInputs(Vector xp,
Vector yp,
Vector zp)
interpolate methods for interpolating new values
at the locations defined by getOutputLocation(int, Point2D.Double).
xp - The x ordinates of a random set of points.yp - The y ordinates of a random set of points.zp - The z values at the (x,y) coordinates
defined by the xp and yp arguments.public int getOutputLength()
interpolate(...) method will
return an array of this length.
public Point2D.Double getOutputLocation(int index,
Point2D.Double dest)
values[index] where values is the
array returned by the interpolate(...) method.
If the dest argument is non-null, then the result will be written in the given
Point2D instance and this method returns dest. Otherwise this method
returns a newly allocated Point2D instance.
index - Index (in the [0 … length-1]
range) of an interpolated value.dest - A pre-allocated Point2D to reuse, or null if none.
public double[] interpolate(double[] dest)
setInputs(...)
method for interpolating new values at the locations defined by the
getOutputLocation(...) method. The results are stored in
the given array if it is not-null, or in a newly allocated array otherwise.
This method performs the following steps:
dest is null, then a new array is allocated with
new double[getOutputLength()].getOutputLocation(i, ...).xp, yp and zp vector using the
Objective Analysis algorithm.
dest - A pre-allocated array, or null if none.
getOutputLength().public float[] interpolate(float[] dest)
setInputs(...)
method for interpolating new values at the locations defined by the
getOutputLocation(...) method. This method performs the
same work than interpolate(double[]), but using single-precision numbers
instead than double-precision.
dest - A pre-allocated array, or null if none.
getOutputLength().public RenderedImage createImage()
getOutputLocation(...) method. The
default implementation assumes that the locations are defined in a row-major fashion,
with the row on the top of the image first and the row at the bottom of the image last.
protected double correlation(Point2D.Double P1,
Point2D.Double P2)
P1 and P2 are the location of measurement stations and time series
are available for those stations, then this method shall returns the correlation
coefficient between the data at station 1 and the data at station 2.
This method should be overridden by subclasses, typically with a correlation estimated from the distance between the two stations. The value returned by this method must be in the [0…1] range.
Default implementation
Current implementation assumes that the correlation has a gaussian distribution,
with a value approaching zero as the distance between the two stations increase.
The calibration coefficients in current implementation are totally arbitrary and
may change in any future version.
P1 - The first location. Implementors shall not modify this value.P2 - The second location. Implementors shall not modify this value.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||