|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.leeds.ccg.andyt.grids.utilities.ErrorHandler uk.ac.leeds.ccg.andyt.grids.process.Grid2DSquareCellProcessor
public class Grid2DSquareCellProcessor
A class holding methods for processing an individual Grid2DSquareCellAbstract or multiple Grid2DSquareCellAbstracts. TODO: Implement a general replace method ( depricate/replace mask methods ).
Field Summary | |
---|---|
protected java.util.HashSet |
grid2DSquareCells
A collection of the Grid2dSquareCellAbstracts being processed |
protected java.io.PrintWriter |
log
The log for recording progress and information about the processing. |
protected int |
logIndentation
The log indentation (how many spaces before a log message line is output). |
protected long |
startTime
For storing the start time of the processing. |
protected java.io.File |
workspace
The workspace directory for the processing. |
Fields inherited from class uk.ac.leeds.ccg.andyt.grids.utilities.ErrorHandler |
---|
handleOutOfMemoryErrorFalse, handleOutOfMemoryErrorTrue, memoryReserve |
Constructor Summary | |
---|---|
Grid2DSquareCellProcessor()
Creates a new instance of Grid2DSquareCellDoubleProcessor |
|
Grid2DSquareCellProcessor(java.io.File workspace)
Creates a new instance of Grid2DSquareCellDoubleProcessor. |
|
Grid2DSquareCellProcessor(java.io.File workspace,
boolean append)
Creates a new instance of Grid2DSquareCellDoubleProcessor. |
Method Summary | |
---|---|
Grid2DSquareCellDouble |
add(Grid2DSquareCellDouble grid0,
Grid2DSquareCellDouble grid1,
boolean data,
Grid2DSquareCellDoubleFactory gridFactory,
boolean handleOutOfMemoryError)
TODO: 1. |
Grid2DSquareCellDouble |
addToGrid(Grid2DSquareCellDouble grid,
double value,
boolean handleOutOfMemoryError)
Returns grid with value added to every cell via AbstractGrid2DSquareCellDouble.addToCell(value) |
Grid2DSquareCellDouble |
addToGrid(Grid2DSquareCellDouble grid,
double value,
Grid2DSquareCellDoubleFactory gridFactory,
boolean handleOutOfMemoryError)
Returns a copy of grid with value added to every cell via AbstractGrid2DSquareCellDouble.addToCell(value) |
Grid2DSquareCellDouble |
addToGrid(Grid2DSquareCellDouble grid,
java.io.File file,
java.lang.String type,
boolean handleOutOfMemoryError)
Returns grid with values added from a file. |
Grid2DSquareCellDouble |
addToGrid(Grid2DSquareCellDouble grid,
Grid2DSquareCellAbstract.CellID[] cellIDs,
double value,
boolean handleOutOfMemoryError)
Returns grid with value added to every cell via Grid2DSquareCellDouble.addToCell(value) |
Grid2DSquareCellDouble |
addToGrid(Grid2DSquareCellDouble grid,
Grid2DSquareCellDouble gridToAdd,
boolean handleOutOfMemoryError)
Returns grid with values added from gridToAdd |
Grid2DSquareCellDouble |
addToGrid(Grid2DSquareCellDouble grid2DSquareCellDouble,
Grid2DSquareCellDouble grid2DSquareCellDoubleToAdd,
double weight,
boolean handleOutOfMemoryError)
Returns a Grid2DSquareCellDouble with values of grid2DSquareCellDouble added with values from grid2DSquareCellDoubleToAdd multiplied by weight. |
protected Grid2DSquareCellDouble |
addToGrid(Grid2DSquareCellDouble grid2DSquareCellDouble,
Grid2DSquareCellDouble grid2DSquareCellDoubleToAdd,
long startRowIndex,
long startColIndex,
long endRowIndex,
long endColIndex,
java.math.BigDecimal[] dimensionConstraints,
double weight,
boolean handleOutOfMemoryError)
Returns a Grid2DSquareCellDouble with values of grid2DSquareCellDouble added with values from grid2DSquareCellDoubleToAdd (with row index between startRowIndex, endRowIndex and column index between startColIndex, endColIndex) multiplied by weight. |
Grid2DSquareCellDouble |
addToGrid(Grid2DSquareCellDouble grid2DSquareCellDouble,
Grid2DSquareCellDouble grid2DSquareCellDoubleToAdd,
long startRowIndex,
long startColIndex,
long endRowIndex,
long endColIndex,
double weight,
boolean handleOutOfMemoryError)
Returns a Grid2DSquareCellDouble with values of grid2DSquareCellDouble added with values from grid2DSquareCellDoubleToAdd (with row index between startRowIndex, endRowIndex and column index between startColIndex, endColIndex) multiplied by weight. |
Grid2DSquareCellDouble |
addToGrid(Grid2DSquareCellDouble grid,
java.util.HashSet cellIDs,
double value,
boolean handleOutOfMemoryError)
Returns grid with value added to all cells with IDs as Integers in cellKeys. |
Grid2DSquareCellDouble |
addToGrid(Grid2DSquareCellDouble grid,
java.util.HashSet cellIDs,
double value,
Grid2DSquareCellDoubleFactory gridFactory,
boolean handleOutOfMemoryError)
Returns a copy of grid with value added to all cells with IDs as Integer keys in cellIDKeys |
Grid2DSquareCellDouble |
aggregate(Grid2DSquareCellDouble grid,
int cellFactor,
java.lang.String statistic,
int rowOffset,
int colOffset,
Grid2DSquareCellDoubleFactory gridFactory,
boolean handleOutOfMemoryError)
Returns an Grid2DSquareCellDouble at a lower level of resolution than grid. |
Grid2DSquareCellDouble |
aggregate(Grid2DSquareCellDouble grid,
java.lang.String statistic,
java.math.BigDecimal[] resultDimensions,
Grid2DSquareCellDoubleFactory gridFactory,
boolean handleOutOfMemoryError)
Returns an Grid2DSquareCellDouble at a lower level of resolution than grid. |
void |
copyAndSetUpNewLog(java.io.File newLog,
boolean handleOutOfMemoryError)
Copies the log |
Grid2DSquareCellDouble |
distanceToDataValue(Grid2DSquareCellDouble grid0,
Grid2DSquareCellDoubleFactory gridFactory,
boolean handleOutOfMemoryError)
Returns a new Grid2DSquareCellDouble the values of which are the distance to the nearest data value TODO: Optimise as it is currently very slow and inefficient!!! |
Grid2DSquareCellDouble |
divide(Grid2DSquareCellDouble grid0,
Grid2DSquareCellDouble grid1,
Grid2DSquareCellDoubleFactory gridFactory,
double defaultValue,
boolean handleOutOfMemoryError)
|
void |
freeMemoryOrThrowError()
Attempts to: clear the memory reserve, cache a seriailized version of a Chunk of a Grid2DSquareCellAbstract in this.grid2DSquareCells then clear it. |
protected java.util.HashSet |
getGrid2DSquareCells()
Returns this.grid2DSquareCells |
protected double[][] |
getRowProcessData(Grid2DSquareCellDouble grid,
double[][] previous,
int cellDistance,
long row,
long col)
Returns a double[][] based on previous which has been shuffled |
protected double[][] |
getRowProcessInitialData(Grid2DSquareCellDouble grid,
int cellDistance,
long row)
Returns a double[][] of grid values |
long |
getTime0()
Returns a copy of this.startTime. |
java.io.File |
getWorkspace()
Returns a copy of this.workspace |
protected void |
initWorkspace(java.io.File workspace)
Initialises workspace. |
Grid2DSquareCellDouble |
linearRescale(Grid2DSquareCellDouble grid,
double min,
double max,
boolean handleOutOfMemoryError)
Returns grid with values linearly rescaled into the range [min,max]. |
Grid2DSquareCellDouble |
linearRescale(Grid2DSquareCellDouble grid,
double min,
double max,
Grid2DSquareCellDoubleFactory gridFactory,
boolean handleOutOfMemoryError)
Returns a new Grid2DSquareCellDouble that is a copy of grid, but with values linearly rescaled into the range [min,max]. |
void |
log(int logIndentation,
java.lang.String string,
boolean handleOutOfMemoryError)
Writes string to log file and the console (standard output) indenting string by logIndentation amount of white-space. |
void |
log(java.lang.String string,
boolean handleOutOfMemoryError)
Writes string to log file and the console (standard output) |
Grid2DSquareCellDouble |
logRescale(Grid2DSquareCellDouble grid,
double min,
double max,
boolean handleOutOfMemoryError)
Returns grid with values linearly scaled to range [1.0d,1000000.0d] then logged using Math.log(double) and then linearly scaled into the range [min,max] |
Grid2DSquareCellDouble |
logRescale(Grid2DSquareCellDouble grid,
double min,
double max,
Grid2DSquareCellDoubleFactory gridFactory,
boolean handleOutOfMemoryError)
Returns a new Grid2DSquareCellDouble that is a copy of grid, but with values linearly scaled to range [1.0d,1000000.0d] then logged using Math.log(double) and then linearly scaled into the range [min,max] |
Grid2DSquareCellDouble |
mask(Grid2DSquareCellAbstract grid2DSquareCellToMask,
Grid2DSquareCellAbstract grid2DSquareCellMask,
boolean handleOutOfMemoryError)
Returns a Grid2DSquareCellAbstract identical to grid2DSquareCellToMask but with cells coincident with grid2DSquareCellMask if their centroids intersect a cell of mask that has a noDataValue. |
Grid2DSquareCellDouble |
mask(Grid2DSquareCellDouble grid,
double min,
double max,
boolean handleOutOfMemoryError)
Returns grid with the values of cells in the range [min,max] set to its noDataValue. |
Grid2DSquareCellDouble |
mask(Grid2DSquareCellDouble grid,
double xmin,
double ymin,
double xmax,
double ymax,
boolean handleOutOfMemoryError)
Returns grid with the value of cells that's centroids intersect the rectangle given by (xmin,ymin,xmax,ymax) set to its noDataValue. |
Grid2DSquareCellDouble |
mask(Grid2DSquareCellDouble grid,
Grid2DSquareCellDouble mask,
Grid2DSquareCellDoubleFactory gridFactory,
boolean handleOutOfMemoryError)
Returns a new Grid2DSquareCellDouble that is a copy of grid, but masked using mask. |
Grid2DSquareCellDouble |
mask(Grid2DSquareCellDouble grid,
long startRowIndex,
long startColIndex,
long endRowIndex,
long endColIndex,
boolean handleOutOfMemoryError)
Returns grid with the value of cells that intersect rectangle given by (startRowIndex,startColIndex,endRowIndex,endColIndex) set to its noDataValue. |
Grid2DSquareCellDouble |
mask(Grid2DSquareCellDouble grid,
long startRowIndex,
long startColIndex,
long endRowIndex,
long endColIndex,
Grid2DSquareCellDoubleFactory gridFactory,
boolean handleOutOfMemoryError)
Returns a new Grid2DSquareCellDouble that is a copy of grid, but with the value of cells in grid that intersect rectangle given by (startRowIndex,startColIndex,endRowIndex,endColIndex) set to its noDataValue. |
Grid2DSquareCellDouble |
minus(Grid2DSquareCellDouble grid0,
Grid2DSquareCellDouble grid1,
boolean data,
Grid2DSquareCellDoubleFactory gridFactory,
boolean handleOutOfMemoryError)
TODO: 1. |
Grid2DSquareCellDouble |
multiply(Grid2DSquareCellDouble grid0,
Grid2DSquareCellDouble grid1,
Grid2DSquareCellDoubleFactory gridFactory,
boolean handleOutOfMemoryError)
|
Grid2DSquareCellDouble |
replace(Grid2DSquareCellDouble grid2DSquareCell,
long[] cellConstraints,
java.math.BigDecimal[] dimensionsConstraints,
double minValueInRangeToBeReplaced,
double maxValueInRangeToBeReplaced,
double valueToInsert,
boolean handleOutOfMemoryError)
Returns a Grid2DSquareCellDouble identical to grid2DSquareCell but with cells with values in range given by (minValueInRangeToBeReplaced, maxValueInRangeToBeReplaced) replaced with valueToInsert, boolean handleOutOfMemoryError ) { coincident with grid2DSquareCellMask if their centroids intersect a cell of mask that has a noDataValue. |
Grid2DSquareCellDouble |
setValueALittleBitLarger(Grid2DSquareCellDouble grid,
java.util.HashSet cellIDs,
boolean handleOutOfMemoryError)
Returns grid with value of cells with keys in cellKeys set to a value a little bit larger. |
Grid2DSquareCellDouble |
setValueALittleBitLarger(Grid2DSquareCellDouble grid,
java.util.HashSet cellIDs,
Grid2DSquareCellDoubleFactory gridFactory,
boolean handleOutOfMemoryError)
Returns a new Grid2DSquareCellDouble that is a copy of grid, but with value of cells with keys in cellKeys set to a value a little bit larger. |
Grid2DSquareCellDouble |
setValueALittleBitSmaller(Grid2DSquareCellDouble grid,
java.util.HashSet cellIDKeys,
boolean handleOutOfMemoryError)
Returns grid with value of cells with keys in cellKeys set to a value a little bit smaller. |
Grid2DSquareCellDouble |
setValueALittleBitSmaller(Grid2DSquareCellDouble grid,
java.util.HashSet cellIDs,
Grid2DSquareCellDoubleFactory gridFactory,
boolean handleOutOfMemoryError)
Returns a new Grid2DSquareCellDouble that is a copy of grid, but with value of cells with keys in cellKeys set to a value a little bit smaller. |
void |
setWorkspace(java.io.File workspace,
boolean handleOutOfMemoryError)
Changes workspace to that passed in if it can be created. |
void |
setWorkspace(java.io.File workspace,
boolean copyLogFile,
boolean handleOutOfMemoryError)
Changes workspace to that passed in if it can be created. |
Methods inherited from class uk.ac.leeds.ccg.andyt.grids.utilities.ErrorHandler |
---|
clearMemoryReserve, initMemoryReserve, initMemoryReserve |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected long startTime
protected java.io.PrintWriter log
protected int logIndentation
protected java.io.File workspace
protected java.util.HashSet grid2DSquareCells
Constructor Detail |
---|
public Grid2DSquareCellProcessor()
public Grid2DSquareCellProcessor(java.io.File workspace)
workspace
- public Grid2DSquareCellProcessor(java.io.File workspace, boolean append)
workspace
- append
- Method Detail |
---|
public long getTime0()
public java.io.File getWorkspace()
protected java.util.HashSet getGrid2DSquareCells()
protected void initWorkspace(java.io.File workspace)
workspace
- The workspace to initialise.public final void freeMemoryOrThrowError()
public void setWorkspace(java.io.File workspace, boolean handleOutOfMemoryError)
workspace
- The workspace to change to.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public void setWorkspace(java.io.File workspace, boolean copyLogFile, boolean handleOutOfMemoryError)
workspace
- The workspace to change to.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public void copyAndSetUpNewLog(java.io.File newLog, boolean handleOutOfMemoryError)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public void log(java.lang.String string, boolean handleOutOfMemoryError)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public void log(int logIndentation, java.lang.String string, boolean handleOutOfMemoryError)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble replace(Grid2DSquareCellDouble grid2DSquareCell, long[] cellConstraints, java.math.BigDecimal[] dimensionsConstraints, double minValueInRangeToBeReplaced, double maxValueInRangeToBeReplaced, double valueToInsert, boolean handleOutOfMemoryError)
grid2DSquareCellToReplaceValues
- The Grid2DSquareCellDouble to replace
cells with value replaceValue.mask
- The Grid2DSquareCellDouble mask.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.
TODO:public Grid2DSquareCellDouble mask(Grid2DSquareCellAbstract grid2DSquareCellToMask, Grid2DSquareCellAbstract grid2DSquareCellMask, boolean handleOutOfMemoryError)
grid2DSquareCellToReplaceValues
- The Grid2DSquareCellDouble to replace
cells with value replaceValue.mask
- The Grid2DSquareCellDouble mask.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.
TODO:public Grid2DSquareCellDouble mask(Grid2DSquareCellDouble grid, Grid2DSquareCellDouble mask, Grid2DSquareCellDoubleFactory gridFactory, boolean handleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be maskedmask
- the Grid2DSquareCellDouble maskgridFactory
- the Grid2DSquareCellDoubleFactory used to
generate result.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble mask(Grid2DSquareCellDouble grid, double min, double max, boolean handleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be maskedmin
- the minimum value in the rangemax
- the maximum value in the rangehandleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble mask(Grid2DSquareCellDouble grid, double xmin, double ymin, double xmax, double ymax, boolean handleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be maskedxmin
- the minimum x-coordinate of the masking rectangleymin
- the minimum y-coordinate of the masking rectanglexmax
- the maximum x-coordinate of the masking rectangleymax
- the maximum y-coordinate of the masking rectanglehandleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble mask(Grid2DSquareCellDouble grid, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex, boolean handleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be maskedstartRowIndex
- the index of the first row to be maskedstartColIndex
- the index of the first column to be maskedendRowIndex
- the index of the final row to be maskedendColIndex
- the index of the final column to be maskedhandleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble mask(Grid2DSquareCellDouble grid, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex, Grid2DSquareCellDoubleFactory gridFactory, boolean handleOutOfMemoryError)
grid
- The Grid2DSquareCellDouble to be masked.startRowIndex
- The index of the first row to be masked.startColIndex
- The index of the first column to be masked.endRowIndex
- The index of the final row to be masked.endColIndex
- The index of the final column to be masked.gridFactory
- The Grid2DSquareCellDoubleFactory used to
generate result.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble linearRescale(Grid2DSquareCellDouble grid, double min, double max, boolean handleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be processed.min
- the minimum value in the rescaled range.max
- the maximum value in the rescaled range.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble linearRescale(Grid2DSquareCellDouble grid, double min, double max, Grid2DSquareCellDoubleFactory gridFactory, boolean handleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be processed.min
- the minimum value in the rescaled range.max
- the maximum value in the rescaled range.gridFactory
- the Grid2DSquareCellDoubleFactory used to
generate result.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble logRescale(Grid2DSquareCellDouble grid, double min, double max, boolean handleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be processedmin
- the minimum value in the rescaled rangemax
- the maximum value in the rescaled rangehandleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble logRescale(Grid2DSquareCellDouble grid, double min, double max, Grid2DSquareCellDoubleFactory gridFactory, boolean handleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be processedmin
- the minimum value in the rescaled rangemax
- the maximum value in the rescaled rangegridFactory
- the Grid2DSquareCellDoubleFactory used to
generate result.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble setValueALittleBitLarger(Grid2DSquareCellDouble grid, java.util.HashSet cellIDs, boolean handleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be processedcellIDs
- handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble setValueALittleBitLarger(Grid2DSquareCellDouble grid, java.util.HashSet cellIDs, Grid2DSquareCellDoubleFactory gridFactory, boolean handleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be processedcellIDs
- gridFactory
- the Grid2DSquareCellDoubleFactory used to
generate result.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble setValueALittleBitSmaller(Grid2DSquareCellDouble grid, java.util.HashSet cellIDKeys, boolean handleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be processedcellIDKeys
- handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble setValueALittleBitSmaller(Grid2DSquareCellDouble grid, java.util.HashSet cellIDs, Grid2DSquareCellDoubleFactory gridFactory, boolean handleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be processedcellIDs
- gridFactory
- the Grid2DSquareCellDoubleFactory used to
generate result.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble addToGrid(Grid2DSquareCellDouble grid, java.util.HashSet cellIDs, double value, boolean handleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be processedcellIDs
- value
- the value to be addedhandleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble addToGrid(Grid2DSquareCellDouble grid, java.util.HashSet cellIDs, double value, Grid2DSquareCellDoubleFactory gridFactory, boolean handleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be processedcellIDs
- value
- the value to be addedgridFactory
- the Grid2DSquareCellDoubleFactory used to
generate result.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble addToGrid(Grid2DSquareCellDouble grid, double value, boolean handleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be processedvalue
- the value to be addedhandleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble addToGrid(Grid2DSquareCellDouble grid, Grid2DSquareCellAbstract.CellID[] cellIDs, double value, boolean handleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be processedvalue
- the value to be addedhandleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble addToGrid(Grid2DSquareCellDouble grid, double value, Grid2DSquareCellDoubleFactory gridFactory, boolean handleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be processedvalue
- the value to be addedgridFactory
- the Grid2DSquareCellDoubleFactory used to
generate result.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble addToGrid(Grid2DSquareCellDouble grid, Grid2DSquareCellDouble gridToAdd, boolean handleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be processedgridToAdd
- the Grid2DSquareCellDouble from which values are
addedhandleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble addToGrid(Grid2DSquareCellDouble grid2DSquareCellDouble, Grid2DSquareCellDouble grid2DSquareCellDoubleToAdd, double weight, boolean handleOutOfMemoryError)
grid2DSquareCellDouble
- The Grid2DSquareCellDouble to be processed.grid2DSquareCellDoubleToAdd
- The Grid2DSquareCellDouble from which
values are added.weight
- The value grid2DSquareCellDoubleToAdd values are multiplied
by.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble addToGrid(Grid2DSquareCellDouble grid2DSquareCellDouble, Grid2DSquareCellDouble grid2DSquareCellDoubleToAdd, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex, double weight, boolean handleOutOfMemoryError)
grid2DSquareCellDouble
- The Grid2DSquareCellDouble to be processed.grid2DSquareCellDoubleToAdd
- The Grid2DSquareCellDouble from which
values are added.startRowIndex
- The index of the first row from which
grid2DSquareCellDoubleToAdd values are added.startColIndex
- the index of the first column from which
grid2DSquareCellDoubleToAdd values are added.endRowIndex
- the index of the final row from which
grid2DSquareCellDoubleToAdd values are added.endColIndex
- the index of the final column from which
grid2DSquareCellDoubleToAdd values are added.weight
- The value grid2DSquareCellDoubleToAdd values are multiplied
by.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.protected Grid2DSquareCellDouble addToGrid(Grid2DSquareCellDouble grid2DSquareCellDouble, Grid2DSquareCellDouble grid2DSquareCellDoubleToAdd, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex, java.math.BigDecimal[] dimensionConstraints, double weight, boolean handleOutOfMemoryError)
grid2DSquareCellDouble
- The Grid2DSquareCellDouble to be processed.grid2DSquareCellDoubleToAdd
- The Grid2DSquareCellDouble from which
values are added.startRowIndex
- The index of the first row from which
grid2DSquareCellDoubleToAdd values are added.startColIndex
- the index of the first column from which
grid2DSquareCellDoubleToAdd values are added.endRowIndex
- the index of the final row from which
grid2DSquareCellDoubleToAdd values are added.endColIndex
- the index of the final column from which
grid2DSquareCellDoubleToAdd values are added.dimensionContraints
- weight
- The value grid2DSquareCellDoubleToAdd values are multiplied
by.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.
TODO: Check that reasonable answers are returned for intersections and aggregations.public Grid2DSquareCellDouble addToGrid(Grid2DSquareCellDouble grid, java.io.File file, java.lang.String type, boolean handleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be processedfile
- the file contining values to be added.type
- the type of file.
Supported types include "xyv", "xy", "idxy" )handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble minus(Grid2DSquareCellDouble grid0, Grid2DSquareCellDouble grid1, boolean data, Grid2DSquareCellDoubleFactory gridFactory, boolean handleOutOfMemoryError)
data
- controls if result is produced even if one of the inputs is a
NoData valuehandleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble add(Grid2DSquareCellDouble grid0, Grid2DSquareCellDouble grid1, boolean data, Grid2DSquareCellDoubleFactory gridFactory, boolean handleOutOfMemoryError)
data
- controls if result is produced even if one of the inputs is a
NoData valuehandleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.addToGrid(Grid2DSquareCellDouble,Grid2DSquareCellDouble,boolean)
public Grid2DSquareCellDouble multiply(Grid2DSquareCellDouble grid0, Grid2DSquareCellDouble grid1, Grid2DSquareCellDoubleFactory gridFactory, boolean handleOutOfMemoryError)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.
TODO:
1. Documentiation
2. Change so Grid2DSquareCellDouble are Grid2DSquareCellAbstractpublic Grid2DSquareCellDouble divide(Grid2DSquareCellDouble grid0, Grid2DSquareCellDouble grid1, Grid2DSquareCellDoubleFactory gridFactory, double defaultValue, boolean handleOutOfMemoryError)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.
TODO:
1. Documentiation
2. Change so Grid2DSquareCellDouble are Grid2DSquareCellAbstractpublic Grid2DSquareCellDouble aggregate(Grid2DSquareCellDouble grid, int cellFactor, java.lang.String statistic, int rowOffset, int colOffset, Grid2DSquareCellDoubleFactory gridFactory, boolean handleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be processedcellFactor
- the number of times wider/higher the aggregated grid
cells are to bestatistic
- "sum", "mean", "max", or "min" depending on what
aggregate of values are wantedrowOffset
- the number of rows above or below the origin of grid
where the aggregation is to start.
> 0 result yllcorner will be above grid yllcorner
< 0 result yllcorner will be below grid yllcornercolOffset
- the number of columns above or below the origin of grid
where the aggregation is to start.
> 0 result xllcorner will be right of grid xllcorner
< 0 result xllcorner will be left of grid xllcornergridFactory
- the Abstract2DSquareCellDoubleFactory used to create
result and temporary AbstractGrid2DSquareCellDoubles.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.
NB. In the calculation of the sum and the mean if there is a cell in grid which has a data value then
the result which incorporates that cell has a data value. For this result cell, any of the cells in
grid which have noDataValues their value is taken as that of the average of its nearest cells with
a value.
In the calculation of the max and the min noDataValues are simply ignored.
Formerly noDataValues were treated as the average of values within a result cell.
TODO: implement median, mode and variance aggregations.public Grid2DSquareCellDouble aggregate(Grid2DSquareCellDouble grid, java.lang.String statistic, java.math.BigDecimal[] resultDimensions, Grid2DSquareCellDoubleFactory gridFactory, boolean handleOutOfMemoryError)
grid
- The Grid2DSquareCellDouble to be processedstatistic
- "sum", "mean", "max", or "min" depending on what aggregate of values are wantedresultDimensions
- gridFactory
- The Abstract2DSquareCellDoubleFactory used to create gridshandleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.
Use this aggregate method if result is to have a new spatial frame.
NB. In the calculation of the sum and the mean if there is a cell in grid which has a data value then
the result which incorporates that cell has a data value. For this result cell, any of the cells in
grid which have noDataValues their value is taken as that of the average of its nearest cells with
a value.
In the calculation of the max and the min noDataValues are simply ignored.
Formerly noDataValues were treated as the average of values within a result cell.
TODO: implement median, mode and variance aggregations.public Grid2DSquareCellDouble distanceToDataValue(Grid2DSquareCellDouble grid0, Grid2DSquareCellDoubleFactory gridFactory, boolean handleOutOfMemoryError)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.protected double[][] getRowProcessInitialData(Grid2DSquareCellDouble grid, int cellDistance, long row)
protected double[][] getRowProcessData(Grid2DSquareCellDouble grid, double[][] previous, int cellDistance, long row, long col)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |