4.2.10. SpotElevationContainer

class pyprom.lib.containers.spot_elevation.SpotElevationContainer(spotElevationList)[source]

Container for Spot Elevation type lists. Allows for various list transformations.

This is intended to be inherited from, namely for: pyprom.lib.containers.saddles.SaddlesContainer, pyprom.lib.containers.summits.SummitsContainer, and pyprom.lib.containers.runoffs.RunOffsContainer

__eq__(other)[source]

Determines if SpotElevationContainer is equal to another.

Parameters

other – other SpotElevationContainer to check.

Type

SpotElevationContainer

Returns

equality

Return type

bool

Raises

TypeError if other not of SpotElevationContainer

__getitem__(idx)[source]

Gives SpotElevationContainer list like get capabilities

Parameters

idx (int) – index value

Returns

pyprom.lib.locations.spot_elevation.SpotElevation self.point at idx

__init__(spotElevationList)[source]
Parameters

spotElevationList (pyprom.lib.locations.spot_elevation.SpotElevation) – list of SpotElevation objects which will reside in this container.

__len__()[source]
Returns

number of items in self.points

Return type

int

__ne__(other)[source]

Determines if SpotElevationContainer is not equal to another.

Parameters

other – other SpotElevationContainer to check.

Type

SpotElevationContainer

Returns

equality

Return type

bool

Raises

TypeError if other not of SpotElevationContainer

__repr__()[source]
Returns

String representation of this object

__setitem__(idx, spotElevation)[source]

Gives SpotElevationContainer list like set capabilities

Parameters
Raises

TypeError if spotElevation not of pyprom.lib.locations.spot_elevation.SpotElevation

__str__()
Returns

String representation of this object

__unicode__()
Returns

String representation of this object

append(spotElevation)[source]

Append a pyprom.lib.locations.spot_elevation.SpotElevation to this container.

Parameters

spotElevation (pyprom.lib.locations.spot_elevation.SpotElevation) – SpotElevation to append.

Raises

TypeError if point not of pyprom.lib.locations.spot_elevation.SpotElevation

by_id(id)[source]

Returns member SpotElevation derivative by ID if it exists. :param string id: string ID of SpotElevation derivative :return: SpotElevation derivative object

elevationRange(lower=- 100000, upper=100000)[source]

Returns all members of this container within a certain elevation range in feet

Parameters
  • lower (int, float) – lower limit in feet

  • upper (int, float) – upper limit in feet

Returns

all points in range between lower and upper (exclusive)

Return type

SpotElevationContainer

elevationRangeMetric(lower=- 100000, upper=100000)[source]

Returns all members of this container within a certain elevation range using meters

Parameters
  • lower (int, float) – lower limit in meters

  • upper (int, float) – upper limit in meters

Returns

all points in range between lower and upper (exclusive)

Return type

SpotElevationContainer

extend(spotElevations)[source]

Extend a list of pyprom.lib.locations.spot_elevation.SpotElevation to this container.

Parameters

spotElevations – list of SpotElevations to append.

Raises

TypeError if point not of pyprom.lib.locations.spot_elevation.SpotElevation

classmethod from_dict(spotElevationContainerDict, datamap=None)[source]

Create this object from dictionary representation

Parameters
Returns

a new SpotElevationContainer

Return type

SpotElevationContainer

property highest
Returns

list of highest pyprom.lib.locations.spot_elevation.SpotElevation object(s) found in this container

Return type

list(pyprom.lib.locations.spot_elevation.SpotElevation)

index(spotElevation)[source]

Returns the index that this pyprom.lib.locations.spot_elevation.SpotElevation or child object occurs. if none, return None

Parameters

gridPoint (pyprom.lib.locations.spot_elevation.SpotElevation) – Gridpoint to find index of.

Returns

index in points list where this spotElevation exists

Return type

int, None

property lowest
Returns

list of lowest pyprom.lib.locations.spot_elevation.SpotElevation object(s) found in this container

Return type

list(pyprom.lib.locations.spot_elevation.SpotElevation)

radius(lat, long, value, unit='m')[source]

Returns all members of this container within a certain radius.

Parameters
  • lat (float, int) – latitude of center in dotted decimal

  • long (float, int) – longitude of center in dotted decimal

  • value (float, int) – number of units of distance

  • unit (str) – type of unit (m, km, mi, ft)

Returns

SpotElevationContainer loaded with results.

Return type

SpotElevationContainer

rectangle(lat1, long1, lat2, long2)[source]

Returns all members of this container in a rectangle of (lat1, long1) - (lat2, long2)

Parameters
  • lat1 (float, int) – latitude of point 1

  • long1 (float, int) – longitude of point 1

  • lat2 (float, int) – latitude of point 2

  • long2 (float, int) – longitude of point 2

Returns

SpotElevationContainer loaded with all points within (inclusive) the specified rectangle.

Return type

SpotElevationContainer

to_dict()[source]

Create the dictionary representation of this object.

Returns

dict() representation of SpotElevationContainer

Return type

dict()