GeoEco.Datasets.Virtual.WindFetchGrid.ComputeFetch
- classmethod WindFetchGrid.ComputeFetch(array, landValue, cellSize, directions, maxDistPerDir=None, padByMaxDistPerDir=True, reportProgress=True)
Compute mean wind fetch distance to for a 2D
numpy.ndarrayrepresenting land and water.Requires: Python scipy module.
- Parameters:
array (instance of <class 'object'>) –
numpy.ndarrayrepresenting land and water. Must have 2 dimensions. This array must have 2 dimensions. The shape of this array must not be less than [1, 1]. This array must have one of the following dtypes꞉'int8','uint8','int16','uint16','int32','uint32','int64','uint64','float32','float64','float128'.landValue (
object) – Value of array that represents land. May benumpy.nan. All other cells are assumed to be water.cellSize (
float) – Cell size of array. Cells are assumed to be square. The cell size is the length or width of the cell. Must be greater than 0.0.directions (
listoffloat) – Directions, in degrees, for which wind fetch distance should be computed and averaged. Typically these range from 0 to 360 by a small (but not too small) increment such as 15 degrees, e.g.list(range(0, 360, 15)). Minimum length꞉ 1.maxDistPerDir (
float, optional) – Maximum allowed wind fetch distance in each direction. If provided, then each time fetch distance is calculated for a specific direction, it is compared against this maximum value. Wherever fetch in the calculated direction is larger, it will be rounded down to the maximum value. This will be done for each direction in turn, prior to averaging all of the directions into a mean. Use this parameter to prevent a few extremely long distances from dominating the mean. Minimum value꞉ 0.0.padByMaxDistPerDir (
bool, optional) – If True (the default) and the MaxDistPerDir parameter is given, then the grid will be automatically padded on all sides by water before fetch is computed. Use this option when you want the edges of the grid to be considered open ocean rather than land, and you want to prevent fetch from decreasing along the edges as if land was there. If False or MaxDistPerDir is not given, then the edges will be considered land.reportProgress (
bool, optional) – If True, progress messages will be logged periodically as the computation proceeds.
- Returns:
A
float32numpy.ndarrayrepresenting the mean distance to land cells in grid in the given directions.- Return type:
instance of <class ‘object’>