GridData
public class GridPointData extends java.lang.Object implements GridData
data=new double [n][m][5]<\code>
vertex=data[n][m]<\code>
vertex[0] = x <\code>
vertex[1] = y <\code>
vertex[2] = val_1 <\code>
vertex[3] = val_2 <\code>
vertex[4] = val_3 <\code>
<\pre>
Modifier and Type | Field | Description |
---|---|---|
protected double |
bottom |
|
protected boolean |
cellData |
|
protected double[][][] |
data |
|
protected double |
dx |
|
protected double |
dy |
|
protected double |
left |
|
protected java.lang.String[] |
names |
|
protected double |
right |
|
protected double |
top |
Constructor | Description |
---|---|
GridPointData(int ix,
int iy,
int ncomponents) |
Constructor Data2D
|
Modifier and Type | Method | Description |
---|---|---|
GridPointData |
createGridPointData(int ncomponents) |
Creates a new GridPointData object with the same grid points and the given number of components.
|
double |
getBottom() |
Gets the y value for the last row of the grid.
|
int |
getComponentCount() |
Gets the number of data components.
|
java.lang.String |
getComponentName(int i) |
Gets the name of the component,
|
double[][][] |
getData() |
Gets the array containing the data.
|
double |
getDx() |
Gets the change in x between grid columns.
|
double |
getDy() |
Gets the change in y between grid rows.
|
double |
getLeft() |
Gets the x value for the first column in the grid.
|
static XML.ObjectLoader |
getLoader() |
Returns the XML.ObjectLoader for this class.
|
int |
getNx() |
Gets the number of x entries.
|
int |
getNy() |
Gets the number of y entries.
|
double |
getRight() |
Gets the x value for the right column in the grid.
|
double |
getTop() |
Gets the y value for the first row of the grid.
|
double |
getValue(int ix,
int iy,
int component) |
Gets the value of the given component at the given location.
|
double[] |
getVertex(double x,
double y) |
Gets the vertex closest to the specified location
|
double[] |
getZRange(int n) |
Gets the minimum and maximum values of the n-th component.
|
double |
indexToX(int i) |
Gets the x coordinate for the given index.
|
double |
indexToY(int i) |
Gets the y coordinate for the given index.
|
double |
interpolate(double x,
double y,
int index) |
Estimates the value of a component at an untabulated point, (x,y).
|
double[] |
interpolate(double x,
double y,
int[] indexes,
double[] values) |
Estimates multiple sample components at an untabulated point, (x,y).
|
boolean |
isCellData() |
Gets the cellData flag.
|
void |
setCellScale(double _left,
double _right,
double _bottom,
double _top) |
Sets the left, right, bottom, and top of the grid data using a cell model.
|
void |
setCenteredCellScale(double xmin,
double xmax,
double ymin,
double ymax) |
Sets the grid such that the centers of the corner cells match the given coordinates.
|
void |
setComponentName(int i,
java.lang.String name) |
Sets the name of the component.
|
void |
setData(double[][][] newdata) |
Sets the array containing the data.
|
void |
setScale(double _left,
double _right,
double _bottom,
double _top) |
Sets the left, right, bottom, and top of the grid data using a lattice model.
|
void |
setValue(int ix,
int iy,
int component,
double value) |
Sets the value of the given component at the given location.
|
int |
xToIndex(double x) |
Gets closest index from the given x world coordinate.
|
int |
yToIndex(double y) |
Gets closest index from the given y world coordinate.
|
protected double[][][] data
protected double left
protected double right
protected double bottom
protected double top
protected double dx
protected double dy
protected boolean cellData
protected java.lang.String[] names
public GridPointData(int ix, int iy, int ncomponents)
ix
- iy
- ncomponents
- public GridPointData createGridPointData(int ncomponents)
ncomponents
- number of samples dataset.public void setComponentName(int i, java.lang.String name)
setComponentName
in interface GridData
i
- int the component indexname
- Stringpublic java.lang.String getComponentName(int i)
getComponentName
in interface GridData
i
- int the component indexpublic int getComponentCount()
getComponentCount
in interface GridData
public void setScale(double _left, double _right, double _bottom, double _top)
public void setCellScale(double _left, double _right, double _bottom, double _top)
setCellScale
in interface GridData
_left
- _right
- _bottom
- _top
- public void setCenteredCellScale(double xmin, double xmax, double ymin, double ymax)
setCenteredCellScale
in interface GridData
xmin
- xmax
- ymin
- ymax
- public boolean isCellData()
isCellData
in interface GridData
public double getValue(int ix, int iy, int component)
public void setValue(int ix, int iy, int component, double value)
public int getNx()
public int getNy()
public double[] getZRange(int n)
public double[] getVertex(double x, double y)
x
- y
- public double interpolate(double x, double y, int index)
interpolate
in interface GridData
x
- the untabulated xy
- the untabulated yindex
- the component indexpublic double[] interpolate(double x, double y, int[] indexes, double[] values)
interpolate
in interface GridData
x
- untabulated xy
- untabulated yindexes
- to be interpolatedvalues
- array will contain the interpolated valuespublic double[][][] getData()
public void setData(double[][][] newdata)
public final double getLeft()
public final double getRight()
public final double getTop()
public final double getBottom()
public final double getDx()
public final double getDy()
public double indexToX(int i)
public double indexToY(int i)
public int xToIndex(double x)
public int yToIndex(double y)
public static XML.ObjectLoader getLoader()