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

  • parent – Parent saddle These are Saddle which from this Saddle is derived.

  • singleSummit (bool) – kwarg for Saddles disqualified for being linked to a Single Summit.

  • basinSaddle (bool) – kwarg for Saddles disqualified for being a Basin Saddle.

  • basinSaddleAlternatives (list) – kwarg for Saddles which are basin saddles of equivalent height :type basinSaddleAlternatives: list(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)

disown_children()[source]
disown_children disassociates this saddle from all child

Saddle

property 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

property domains
Returns

list of SummitDomains associated with this Saddle

emancipate()[source]

Emancipate disassociates this saddle from its parent Saddle

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

high_shore_shortest_path(datamap)[source]

Finds the two closest opposing high shore points. This follows a path inside the saddle. Also returns the midpoint.

Parameters

datamap (pyprom.lib.datamap.DataMap) – Datamap required for distance calculations.

Returns

HS1, HS2, Midpoint

property 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)

soft_delete()[source]

Soft deletes this Saddle, that is, disassociates itself from other saddle attributes

property 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()