|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opensha.commons.data.xyz.AbstractXYZ_DataSet
org.opensha.commons.data.xyz.EvenlyDiscrXYZ_DataSet
public class EvenlyDiscrXYZ_DataSet
This class represents an evenly discretized XYZ dataset. Data is stored as an array, and set/get operations will use the closest point in the data if it's not exact.
| Constructor Summary | |
|---|---|
EvenlyDiscrXYZ_DataSet(double[][] data,
double minX,
double minY,
double gridSpacing)
|
|
EvenlyDiscrXYZ_DataSet(int nx,
int ny,
double minX,
double minY,
double gridSpacing)
|
|
| Method Summary | |
|---|---|
double |
bilinearInterpolation(double x,
double y)
Bilinear interpolation. |
Object |
clone()
|
boolean |
contains(double x,
double y)
Returns true if the dataset contains the given point, false otherwise. |
boolean |
contains(Point2D point)
Returns true if the dataset contains the given point, false otherwise. |
XYZ_DataSet |
copy()
Returns a shallow copy of this XYZ_DataSet. |
double |
get(double x,
double y)
Gets the value at the given point. |
double |
get(int index)
Gets the value at the given index. |
double |
get(int xInd,
int yInd)
|
double |
get(Point2D point)
Gets the value at the given point. |
double |
getGridSpacing()
Get the grid spacing of this evenly discretized dataset |
double |
getMaxX()
Returns the maximum X value in this dataset. |
double |
getMaxY()
Returns the maximum Y value in this dataset. |
double |
getMinX()
Returns the minimum X value in this dataset. |
double |
getMinY()
Returns the minimum Y value in this dataset. |
int |
getNumX()
|
int |
getNumY()
|
Point2D |
getPoint(int index)
Gets the point at the given index. |
double |
getX(int xIndex)
|
double |
getY(int yIndex)
|
int |
indexOf(double x,
double y)
Returns the index of the given point, or -1 if it isn't in the dataset. |
int |
indexOf(Point2D point)
Returns the index of the given point, or -1 if it isn't in the dataset. |
static EvenlyDiscrXYZ_DataSet |
readXYZBinFile(String fileNamePrefix)
|
void |
set(double x,
double y,
double z)
Sets the value at the given point. |
void |
set(int index,
double z)
Sets the value at the given index. |
void |
set(int xInd,
int yInd,
double z)
|
void |
set(Point2D point,
double z)
Sets the value at the given point. |
int |
size()
Returns the size of this dataset. |
void |
writeXYZBinFile(String fileNamePrefix)
|
| Methods inherited from class org.opensha.commons.data.xyz.AbstractXYZ_DataSet |
|---|
abs, add, exp, exp, getMaxZ, getMinZ, getPointList, getValueList, log, log10, pow, scale, setAll, writeXYZFile, writeXYZFile |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EvenlyDiscrXYZ_DataSet(int nx,
int ny,
double minX,
double minY,
double gridSpacing)
public EvenlyDiscrXYZ_DataSet(double[][] data,
double minX,
double minY,
double gridSpacing)
| Method Detail |
|---|
public double getMaxX()
XYZ_DataSet
getMaxX in interface XYZ_DataSetgetMaxX in class AbstractXYZ_DataSetpublic double getMaxY()
XYZ_DataSet
getMaxY in interface XYZ_DataSetgetMaxY in class AbstractXYZ_DataSetpublic double getMinX()
XYZ_DataSet
getMinX in interface XYZ_DataSetgetMinX in class AbstractXYZ_DataSetpublic double getMinY()
XYZ_DataSet
getMinY in interface XYZ_DataSetgetMinY in class AbstractXYZ_DataSetpublic double getGridSpacing()
public int getNumX()
public int getNumY()
public void writeXYZBinFile(String fileNamePrefix)
throws IOException
IOException
public static EvenlyDiscrXYZ_DataSet readXYZBinFile(String fileNamePrefix)
throws IOException
IOExceptionpublic double getX(int xIndex)
public double getY(int yIndex)
public void set(Point2D point,
double z)
XYZ_DataSet
point - - the point at which to setz - - the value to set
public void set(double x,
double y,
double z)
XYZ_DataSet
x - - the x value of the point at which to sety - - the y value of the point at which to setz - - the value to set
public void set(int index,
double z)
XYZ_DataSet
index - - the index of the point to be setz - - the value to set
public double get(double x,
double y)
XYZ_DataSet
x - - the x value of the point at which to gety - - the y value of the point at which to get
public double bilinearInterpolation(double x,
double y)
x - y -
IllegalArgumentException - if x or y is outside of the allowable rangepublic double get(int index)
XYZ_DataSet
index - - the index of the point at which to get
public int size()
XYZ_DataSet
public void set(int xInd,
int yInd,
double z)
public double get(int xInd,
int yInd)
public double get(Point2D point)
XYZ_DataSet
point - - the point at which to get
public Point2D getPoint(int index)
XYZ_DataSet
index - - the index of the point to get
public int indexOf(Point2D point)
XYZ_DataSet
point - - the point at which to return the index
public boolean contains(Point2D point)
XYZ_DataSet
point - - the point to check
point is not null and is contained by the dataset, false otherwise
public boolean contains(double x,
double y)
XYZ_DataSet
x - - the x value of the point to checky - - the y value of the point to check
public Object clone()
clone in class Objectpublic XYZ_DataSet copy()
XYZ_DataSetXYZ_DataSet. Internal points are not cloned.
XYZ_DataSet
public int indexOf(double x,
double y)
XYZ_DataSet
x - - the x value of the point at which to return the indexy - - the y value of the point at which to return the index
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||