4.4.1. Datamap

class pyprom.lib.datamap.DataMap(numpy_map, unit, filename)[source]

Base class for Datamap type objects.

__init__(numpy_map, unit, filename)[source]
Parameters
  • numpy_map (numpy.ndarray) – Numpy ndarray representation of raster data

  • unit (str) – unit of this data: valid values are feet, foot, or meter

  • filename (str) – file name.

Raises

Exception (regarding unit)

__weakref__

list of weak references to the object (if defined)

distance(us, them)[source]
Parameters
  • us – Tuple(x, y)

  • them – Tuple(x, y)

Returns

distance.

get(x, y)[source]

Gets elevation from numpy map, and converts units to Meters :param int x: x coordinate in raster data. :param int y: y coordinate in raster data. :return: float

is_map_edge(x, y)[source]

Determine if x, y is on the map edge. :param x: x coord :param y: y coord :return: bool

iterateDiagonal(x, y)[source]

Generator returns 4 closest neighbors to a raster grid location, that is, all points touching excluding the orthogonals.

Parameters
  • x (int) – x coordinate in raster data.

  • y (int) – y coordinate in raster data.

iterateFull(x, y)[source]

Generator returns 8 closest neighbors to a raster grid location, that is, all points touching including the diagonals.

Parameters
  • x (int) – x coordinate in raster data.

  • y (int) – y coordinate in raster data.

iterateOrthogonal(x, y)[source]

Generator returns 4 closest neighbors to a raster grid location, that is, all points touching excluding the diagonals.

Parameters
  • x (int) – x coordinate in raster data.

  • y (int) – y coordinate in raster data.

steepestNeighbor(x, y)[source]

Finds neighbor with steepest slope

Parameters
  • x (int) – x coordinate in raster data.

  • y (int) – y coordinate in raster data.

Returns

tuple(x, y) highest neighbor