4.2.7. Perimeter

class pyprom.lib.containers.perimeter.Perimeter(pointList=None, pointIndex=None, datamap=None, mapEdge=False, mapEdgePoints=None)[source]

Container for Perimeter type lists. A Perimeter is all points Diagonally or Orthogonally neighboring a member of a pyprom.lib.containers.multipoint.MultiPoint

__eq__(other)[source]

Determines if this object is equal to another.

Parameters:other – other Perimeter to check.
Type:Perimeter
Returns: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.GridPoint self.point at idx
__init__(pointList=None, pointIndex=None, datamap=None, mapEdge=False, mapEdgePoints=None)[source]
Parameters:
__iter__()[source]
Returns:self.points as iterator
__len__()[source]
Returns:number of items in self.points
Return type:int
__ne__(other)[source]

Determines if this object is not equal to another.

Parameters:other – other Perimeter to check.
Type:Perimeter
Returns:inequality
Return type:bool
Raises:TypeError if other not of Perimeter
__repr__()[source]
Returns:String representation of this object
__setitem__(idx, point)[source]

Gives Perimeter list like set capabilities

Parameters:
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.GridPoint to 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 of pyprom.lib.locations.gridpoint.GridPoint which are discontigous so far as the other container is concerned. This is used to identify discontigous sets of pyprom.lib.locations.gridpoint.GridPoint for determining if this is a pyprom.lib.locations.saddle.Saddle or 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.DataMap object.) – datamap which this Perimeter uses.
Returns:

a new Perimeter object.

Return type:

Perimeter

iterNeighborDiagonal(point)[source]

Iterate through diagonally and orthogonally neighboring pyprom.lib.locations.gridpoint.GridPoint which are also members of this Perimeter

Parameters:point (pyprom.lib.locations.gridpoint.GridPoint) – Gridpoint to find neighbors of
iterNeighborOrthogonal(point)[source]

Iterate through orthogonally neighboring pyprom.lib.locations.gridpoint.GridPoint which are also members of this Perimeter

Parameters:point (pyprom.lib.locations.gridpoint.GridPoint) – Gridpoint to find neighbors of
to_dict()[source]

Create the dictionary representation of this object.

Returns:dict() representation of Perimeter
Return type:dict()