4.2.7. Perimeter¶
-
class
pyprom.lib.containers.perimeter.Perimeter(pointList=None, pointIndex=None, datamap=None, mapEdge=False, mapEdgePoints=None)[source]¶ Container for
Perimetertype lists. A Perimeter is all points Diagonally or Orthogonally neighboring a member of apyprom.lib.containers.multipoint.MultiPoint-
__eq__(other)[source]¶ Determines if this object is equal to another.
Parameters: other – other Perimeterto check.Type: PerimeterReturns: equality Return type: bool Raises: TypeError if other not of Perimeter
-
__getitem__(idx)[source]¶ Gives Perimeter list like get capabilities
Parameters: idx (int) – index value Returns: pyprom.lib.locations.gridpoint.GridPointself.point at idx
-
__init__(pointList=None, pointIndex=None, datamap=None, mapEdge=False, mapEdgePoints=None)[source]¶ Parameters: - pointList (list(
pyprom.lib.locations.gridpoint.GridPoint)) – GridPoints which make up the Perimeter. - pointIndex (dict({X: { Y:
pyprom.lib.locations.gridpoint.GridPoint}}) – Members as a dict(). - datamap (
pyprom.lib.datamap.DataMapobject.) – datamap which thisPerimeteruses. - mapEdge (bool) – is this a map edge?
- mapEdgePoints (list(
pyprom.lib.locations.gridpoint.GridPoint)) – list of Points on the map edge.
- pointList (list(
-
__ne__(other)[source]¶ Determines if this object is not equal to another.
Parameters: other – other Perimeterto check.Type: PerimeterReturns: inequality Return type: bool Raises: TypeError if other not of Perimeter
-
__setitem__(idx, point)[source]¶ Gives Perimeter list like set capabilities
Parameters: - idx (int) – index value
- point (
pyprom.lib.locations.gridpoint.GridPoint) – GridPoint for setitem.
Raises: TypeError if point not of
pyprom.lib.locations.gridpoint.GridPoint
-
__str__()¶ Returns: String representation of this object
-
__unicode__()¶ Returns: String representation of this object
-
__weakref__¶ list of weak references to the object (if defined)
-
append(point)[source]¶ Add a
pyprom.lib.locations.gridpoint.GridPointto this container.Parameters: point ( pyprom.lib.locations.gridpoint.GridPoint) – GridPoint to append.Raises: TypeError if point not of pyprom.lib.locations.gridpoint.GridPoint
-
findHighEdges(elevation)[source]¶ This function returns a list of
pyprom.lib.containers.gridpoint.GridPointContainer. Each container holds a list ofpyprom.lib.locations.gridpoint.GridPointwhich are discontigous so far as the other container is concerned. This is used to identify discontigous sets ofpyprom.lib.locations.gridpoint.GridPointfor determining if this is apyprom.lib.locations.saddle.Saddleor not.Returns: list of GridPointContainers containing HighEdges. Return type: list( pyprom.lib.containers.gridpoint.GridPointContainer)
-
findHighPerimeter(elevation)[source]¶ This function returns all points higher than the passed in elevation and returns them in a GridPointContainer.
Parameters: elevation (int, float) – Returns: GridPointContainer containing high perimeter points. Return type: pyprom.lib.containers.gridpoint.GridPointContainer
-
classmethod
from_dict(perimeterDict, datamap=None)[source]¶ Create this object from dictionary representation
Parameters: - perimeterDict (dict) – dict() representation of this object.
- datamap (
pyprom.lib.datamap.DataMapobject.) – datamap which this Perimeter uses.
Returns: a new Perimeter object.
Return type:
-
iterNeighborDiagonal(point)[source]¶ Iterate through diagonally and orthogonally neighboring
pyprom.lib.locations.gridpoint.GridPointwhich are also members of thisPerimeterParameters: point ( pyprom.lib.locations.gridpoint.GridPoint) – Gridpoint to find neighbors of
-
iterNeighborOrthogonal(point)[source]¶ Iterate through orthogonally neighboring
pyprom.lib.locations.gridpoint.GridPointwhich are also members of thisPerimeterParameters: point ( pyprom.lib.locations.gridpoint.GridPoint) – Gridpoint to find neighbors of
-