|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.leeds.ccg.andyt.grids.core.OutOfMemoryErrorHandler
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 ).
Fields inherited from class uk.ac.leeds.ccg.andyt.grids.core.OutOfMemoryErrorHandler |
---|
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 appendToLogFile)
Creates a new instance of Grid2DSquareCellDoubleProcessor. |
Method Summary | |
---|---|
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(Grid2DSquareCellAbstract grid2DSquareCell,
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(Grid2DSquareCellAbstract grid2DSquareCell,
java.lang.String statistic,
java.math.BigDecimal[] resultDimensions,
Grid2DSquareCellDoubleFactory gridFactory,
boolean handleOutOfMemoryError)
Returns an Grid2DSquareCellDouble at a lower level of resolution than grid. |
double |
angle(double x1,
double y1,
double x2,
double y2,
boolean handleOutOfMemoryError)
Returns the clockwise angle in radians to the y axis of the line from (x1,y1) to (x2,y2). |
void |
copyAndSetUpNewLog(java.io.File newLog,
boolean handleOutOfMemoryError)
Copies and sets up a new log. |
double |
distance(double x1,
double y1,
double x2,
double y2,
boolean handleOutOfMemoryError)
Returns the distance between a pair of coordinates |
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(boolean handleOutOfMemoryError)
Returns a copy of this.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] |
Grid2DSquareCellAbstract |
mask(Grid2DSquareCellAbstract grid2DSquareCell,
double min,
double max,
boolean handleOutOfMemoryError)
Returns grid2DSquareCell with the values of cells in the range [min,max] set to its noDataValue. |
Grid2DSquareCellAbstract |
mask(Grid2DSquareCellAbstract grid2DSquareCell,
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. |
Grid2DSquareCellAbstract |
mask(Grid2DSquareCellAbstract grid2DSquareCell,
Grid2DSquareCellAbstract mask,
Grid2DSquareCellAbstractFactory grid2DSquareCellAbstractFactory,
boolean handleOutOfMemoryError)
If grid2DSquareCellAbstractFactory is null then grid2DSquareCell is directly masked and returned, otherwise a new Grid2DSquareCellAbstract result is contructed using grid2DSquareCellAbstractFactory. |
Grid2DSquareCellAbstract |
mask(Grid2DSquareCellAbstract grid2DSquareCellToMask,
Grid2DSquareCellAbstract grid2DSquareCellMask,
GridStatisticsAbstract resultGridStatistics,
java.io.File resultDirectory,
boolean handleOutOfMemoryError)
Returns a new Grid2DSquareCellAbstract which is of the same type and chunk stucture as grid2DSquareCellMask. |
Grid2DSquareCellAbstract |
mask(Grid2DSquareCellAbstract grid2DSquareCell,
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. |
Grid2DSquareCellAbstract |
mask(Grid2DSquareCellAbstract grid,
long startRowIndex,
long startColIndex,
long endRowIndex,
long endColIndex,
Grid2DSquareCellAbstractFactory grid2DSquareCellFactory,
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 |
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. |
void |
swapToFileGrid2DSquareCellChunk(boolean handleOutOfMemoryError)
Attempts to swap to file and clear from the cache a chunk in this.grid2DSquareCells |
void |
swapToFileGrid2DSquareCellChunks()
|
void |
swapToFileGrid2DSquareCellChunks(boolean handleOutOfMemoryError)
Attempts to swap to file and clear from cache seriailsed version of all this.grid2DSquareCells chunks. |
Methods inherited from class uk.ac.leeds.ccg.andyt.grids.core.OutOfMemoryErrorHandler |
---|
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
public java.util.HashSet grid2DSquareCells
public Grid2DSquareCellIntChunkAbstractFactory grid2DSquareCellIntChunkFactory
public Grid2DSquareCellIntChunk64CellMapFactory grid2DSquareCellIntChunk64CellMapFactory
public Grid2DSquareCellIntChunkArrayFactory grid2DSquareCellIntChunkArrayFactory
public Grid2DSquareCellIntChunkJAIFactory grid2DSquareCellIntChunkJAIFactory
public Grid2DSquareCellIntChunkMapFactory grid2DSquareCellIntChunkMapFactory
public Grid2DSquareCellIntChunkRAFFactory grid2DSquareCellIntChunkRAFFactory
public Grid2DSquareCellIntFactory grid2DSquareCellIntFactory
public Grid2DSquareCellDoubleChunkAbstractFactory grid2DSquareCellDoubleChunkFactory
public Grid2DSquareCellDoubleChunk64CellMapFactory grid2DSquareCellDoubleChunk64CellMapFactory
public Grid2DSquareCellDoubleChunkArrayFactory grid2DSquareCellDoubleChunkArrayFactory
public Grid2DSquareCellDoubleChunkJAIFactory grid2DSquareCellDoubleChunkJAIFactory
public Grid2DSquareCellDoubleChunkMapFactory grid2DSquareCellDoubleChunkMapFactory
public Grid2DSquareCellDoubleChunkRAFFactory grid2DSquareCellDoubleChunkRAFFactory
public Grid2DSquareCellDoubleFactory grid2DSquareCellDoubleFactory
public GridStatistics0 gridStatistics0
public GridStatistics1 gridStatistics1
public GridStatisticsAbstract gridStatistics
Constructor Detail |
---|
public Grid2DSquareCellProcessor()
public Grid2DSquareCellProcessor(java.io.File workspace)
workspace
- public Grid2DSquareCellProcessor(java.io.File workspace, boolean appendToLogFile)
workspace
- appendToLogFile
- Method Detail |
---|
public long getTime0()
public java.io.File getWorkspace(boolean handleOutOfMemoryError)
protected java.util.HashSet getGrid2DSquareCells()
public final void swapToFileGrid2DSquareCellChunk(boolean handleOutOfMemoryError)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final void swapToFileGrid2DSquareCellChunks(boolean handleOutOfMemoryError)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final void swapToFileGrid2DSquareCellChunks()
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 swap 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 swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public void copyAndSetUpNewLog(java.io.File newLog, boolean handleOutOfMemoryError) throws java.io.IOException
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.
java.io.IOException
public void log(java.lang.String string, boolean handleOutOfMemoryError)
string
- The message to log.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap 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)
logIndentation
- The indentation of string.string
- The message to log.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final double distance(double x1, double y1, double x2, double y2, boolean handleOutOfMemoryError)
x1
- - the x coordinte of one pointy1
- - the y coordinte of one pointx2
- - the x coordinte of another pointy2
- - the y coordinte of another pointhandleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final double angle(double x1, double y1, double x2, double y2, boolean handleOutOfMemoryError)
x1
- - the x coordinte of one pointy1
- - the y coordinte of one pointx2
- - the x coordinte of another pointy2
- - the y coordinte of another pointhandleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellAbstract mask(Grid2DSquareCellAbstract grid2DSquareCellToMask, Grid2DSquareCellAbstract grid2DSquareCellMask, GridStatisticsAbstract resultGridStatistics, java.io.File resultDirectory, boolean handleOutOfMemoryError)
grid2DSquareCellToMask
- The Grid2DSquareCellAbstract that is copied for masking.grid2DSquareCellMask
- The Grid2DSquareCellAbstract to use as a mask.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.
Warning!!! The grid2DSquareCellToMask and grid2DSquareCellMask are assumed to be
coincident and have the same origin.public Grid2DSquareCellAbstract mask(Grid2DSquareCellAbstract grid2DSquareCell, Grid2DSquareCellAbstract mask, Grid2DSquareCellAbstractFactory grid2DSquareCellAbstractFactory, boolean handleOutOfMemoryError)
grid2DSquareCell
- The Grid2DSquareCellAbstract to be masked.mask
- The Grid2DSquareCellAbstract mask.grid2DSquareCellAbstractFactory
- the Grid2DSquareCellAbstractFactory
used to generate result.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellAbstract mask(Grid2DSquareCellAbstract grid2DSquareCell, double min, double max, boolean handleOutOfMemoryError)
grid2DSquareCell
- 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 swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellAbstract mask(Grid2DSquareCellAbstract grid2DSquareCell, double xmin, double ymin, double xmax, double ymax, boolean handleOutOfMemoryError)
grid2DSquareCell
- the Grid2DSquareCellAbstract 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 swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellAbstract mask(Grid2DSquareCellAbstract grid2DSquareCell, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex, boolean handleOutOfMemoryError)
grid2DSquareCell
- 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 swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellAbstract mask(Grid2DSquareCellAbstract grid, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex, Grid2DSquareCellAbstractFactory grid2DSquareCellFactory, 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.grid2DSquareCellFactory
- The Grid2DSquareCellAbstractFactory used to
generate result.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap 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 swap 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 swap 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 swap 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 swap 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 swap 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 swap 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 swap 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 swap 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 swap 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 swap 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 swap 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 swap 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 swap 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 swap 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 swap 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 swap 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.dimensionConstraints
- weight
- The value grid2DSquareCellDoubleToAdd values are multiplied
by.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap 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 swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble aggregate(Grid2DSquareCellAbstract grid2DSquareCell, int cellFactor, java.lang.String statistic, int rowOffset, int colOffset, Grid2DSquareCellDoubleFactory gridFactory, boolean handleOutOfMemoryError)
grid2DSquareCell
- 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 swap 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(Grid2DSquareCellAbstract grid2DSquareCell, java.lang.String statistic, java.math.BigDecimal[] resultDimensions, Grid2DSquareCellDoubleFactory gridFactory, boolean handleOutOfMemoryError)
grid2DSquareCell
- 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 swap 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.protected double[][] getRowProcessInitialData(Grid2DSquareCellDouble grid, int cellDistance, long row)
protected double[][] getRowProcessData(Grid2DSquareCellDouble grid, double[][] previous, int cellDistance, long row, long col)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |