Package hec.heclib.grid
Class GridData
java.lang.Object
hec.heclib.grid.GridData
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat[]
getData()
int
double
getValueAt
(int x, int y) return the value at the position x,yint
initGridData
(float[] array, GridInfo gridInfo) void
initGridInfo
(GridInfo gridInfo) int
roundValues
(int precision) public int roundValues(int precision) Rounds off values in the data array to the decimal precision given.void
setData
(float[] data) int
setValueAt
(int x, int y, double value) Sets the value at position x,yint
setValueAt
(int x, int y, float value) Sets the value at position x,yvoid
show
(double ge) void
show
(double ge, PrintStream out) int
-
Constructor Details
-
GridData
Copy Constructor. Makes a copy of given GridData object.- Parameters:
gridData
-
-
GridData
public GridData() -
GridData
-
-
Method Details
-
getData
public float[] getData() -
getGridInfo
-
initGridData
-
show
public void show(double ge) -
show
-
getValueAt
public double getValueAt(int x, int y) return the value at the position x,y -
setValueAt
public int setValueAt(int x, int y, float value) Sets the value at position x,y- Parameters:
x
-y
-value
-- Returns:
- 0 if there is no error, otherwise -1
-
setValueAt
public int setValueAt(int x, int y, double value) Sets the value at position x,y- Parameters:
x
-y
-value
-- Returns:
- 0 if there is no error, otherwise -1
-
updateStatistics
public int updateStatistics() -
roundValues
public int roundValues(int precision) public int roundValues(int precision) Rounds off values in the data array to the decimal precision given. This reduces the number of unique values in the array, resulting in more effective data compression when we use the ZLIB deflate method.- Parameters:
precision
- Number of decimal places of precision: 0 rounds to whole numbers 1 to tenths, etc.- Returns:
- Status: 0 indicates success
-
getNumberMissing
public int getNumberMissing()- Returns:
-
setData
public void setData(float[] data) -
initGridInfo
-