4.1.5. Saddle

class pyprom.lib.locations.saddle.Saddle(latitude, longitude, elevation, *args, **kwargs)[source]
Saddle object stores relevant saddle data.
A Saddle is by definition a point, or set of equal height points
(MultiPoint) which have at least 2 non contiguous sets of points
around the Perimeter that are higher than the point or Multipoint.
These are called “High Shores”. A Saddle is a Child object of

Examples:

Single Point Saddle:
v------high shore
[0][2][0]
[0][1][0]   [1] = Saddle
[0][3][0]
^------high shore

MultiPoint Saddle:
v--------high shore
[0][2][0][0]
[0][1][1][0]  [1][1] = Saddle
[0][3][0][0]
^-----high shore

__hash__()[source]

hash takes into account the lat, long, and elevation of the saddle As well as a hash of all the highShores. This is a costly calculation and should probably be avoided if possible.

Returns:Hash representation of this object
Return type:str
__init__(latitude, longitude, elevation, *args, **kwargs)[source]
Parameters:
  • latitude (int, float) – latitude in dotted decimal
  • longitude (int, float) – longitude in dotted decimal
  • elevation (int, float) – elevation in meters
  • multiPoint (pyprom.lib.containers.multipoint.MultiPoint, None) – MultiPoint object
  • highShores (list(pyprom.lib.containers.gridPoint.GridPointContainer)) – list of GridPointContainers representing a highShore
  • edge (bool) – Does this Saddle have an edge Effect?
  • id (str) – kwarg for id
  • children (list) – list of child Saddles. These are Saddle derived from this Saddle
  • singleSummit (bool) – kwarg for Saddles disqualified for being linked to a Single Summit.
  • basinSaddle (bool) – kwarg for Saddles disqualified for being a Basin Saddle.
  • disqualified (bool) – kwarg for a generic disqualified Saddle.
__repr__()[source]
Returns:String representation of this object
__str__()
Returns:String representation of this object
__unicode__()
Returns:String representation of this object
addSummitLinker(linker)[source]

Add a pyprom.lib.containers.linker.Linker to this Saddle. This in effect links a pyprom.lib.locations.summit.Summit to this Saddle.

Parameters:linker (pyprom.lib.containers.linker.Linker) – linker to add.
all_neighbors(filterDisqualified=True)[source]

all_neighbors will return all neighboring saddles by way of the connected summit. This function deliberately makes no effort to filter out redundant neighbors.

Parameters:filterDisqualified (bool) – Filter out disqualified linkers.
Returns:list of neighboring saddles by way of neighboring summits.
Return type:list(Saddle)
disqualified
Returns:if any values that indicate disqualification are set, return True.
Return type:bool
disqualify_self_and_linkers(basinSaddle=False, singleSummit=False)[source]

Disqualify this Saddle and linked pyprom.lib.containers.linker.Linker s

Parameters:
  • basinSaddle (bool) – set basinSaddle
  • singleSummit (bool) – set singleSummit
feature_neighbors()[source]
Returns:returns all linked Summits. This is, in effect, an interface.
Return type:list(pyprom.lib.locations.summit.Summit)
classmethod from_dict(saddleDict, datamap=None)[source]

Create this object from dictionary representation

Parameters:
  • saddleDict (dict) – dict representation of this object.
  • datamap (pyprom.lib.datamap.DataMap) – Datamap to build this object from.
Returns:

a new Saddle object.

Return type:

Saddle

neighbors

neighbors will return all neighboring saddles by way of the connected summit. This function will filter out redundant neighbors.

Parameters:filterDisqualified (bool) – Filter out disqualified linkers.
Returns:list of unique neighboring saddles by way of neighboring summits excluding self.
Return type:list(Saddle)
summits_set
Returns:set of linked Summits
Return type:set(pyprom.lib.locations.summit.Summit)
to_dict(referenceById=True)[source]

Create the dictionary representation of this object.

Parameters:referenceById (bool) – reference Summits by ID.
Returns:dict() representation of Saddle
Return type:dict()