Package pygeodesy :: Module points :: Class _Array2LatLon
[frames] | no frames]

Class _Array2LatLon

       object --+            
                |            
    _abcoll.Sized --+        
                    |        
       object --+   |        
                |   |        
 _abcoll.Iterable --+        
                    |        
       object --+   |        
                |   |        
_abcoll.Container --+        
                    |        
     _abcoll.Sequence --+    
                        |    
              _Basequence --+
                            |
                           _Array2LatLon
Known Subclasses:

(INTERNAL) Base class for Numpy2LatLon or Tuple2LatLon.

Nested Classes

Inherited from _abcoll.Sized: __metaclass__

Instance Methods
 
__init__(self, array, ilat=0, ilon=1, LatLon=None, shape=())
Handle a NumPy or Tuple array as a sequence of LatLon points.
 
__contains__(self, latlon)
Check for a specific lat-/longitude.
 
__getitem__(self, index)
Return row[index] as LatLon or return a Numpy2LatLon slice.
 
__iter__(self)
Yield rows as LatLon.
 
__len__(self)
Return the number of rows.
 
__repr__(self)
Return a string representation.
 
__reversed__(self)
Yield rows as LatLon in reverse order.
 
__str__(self)
Return a string representation.
integer
count(self, latlon)
Count the number of rows with a specific lat-/longitude.
 
find(self, latlon, *start_end)
Find the first row with a specific lat-/longitude.
 
findall(self, latlon, *start_end)
Yield indices of all rows with a specific lat-/longitude.
integer
index(self, latlon, *start_end)
Find index of the first row with a specific lat-/longitude.
 
point(self, row)
Instantiate a point LatLon.
 
rfind(self, latlon, *start_end)
Find the last row with a specific lat-/longitude.
 
subset(self, indices)
Return a subset of the NumPy array.

Inherited from _Basequence: copy, dup

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__

Class Methods

Inherited from _abcoll.Sized: __subclasshook__

Class Variables
  __abstractmethods__ = frozenset([])
Properties
  ilat
Get the latitudes column index (int).
  ilon
Get the longitudes column index (int).
  shape
Get the shape of the NumPy array or the Tuples as Shape2Tuple(nrows, ncols).

Inherited from _Basequence: epsilon, isNumpy2, isPoints2, isTuple2

Inherited from object: __class__

Method Details

__init__ (self, array, ilat=0, ilon=1, LatLon=None, shape=())
(Constructor)

 

Handle a NumPy or Tuple array as a sequence of LatLon points.

Overrides: object.__init__

__contains__ (self, latlon)
(In operator)

 

Check for a specific lat-/longitude.

Arguments:
  • latlon - Point (LatLon, LatLon2Tuple or 2-tuple (lat, lon)).
Returns:
True if latlon is present, False otherwise.
Raises:
  • TypeError - Invalid latlon.
Overrides: _abcoll.Container.__contains__

__getitem__ (self, index)
(Indexing operator)

 

Return row[index] as LatLon or return a Numpy2LatLon slice.

Overrides: _abcoll.Sequence.__getitem__

__iter__ (self)

 

Yield rows as LatLon.

Overrides: _abcoll.Iterable.__iter__

__len__ (self)
(Length operator)

 

Return the number of rows.

Overrides: _abcoll.Sized.__len__

__repr__ (self)
(Representation operator)

 

Return a string representation.

Overrides: object.__repr__

__reversed__ (self)

 

Yield rows as LatLon in reverse order.

Overrides: _abcoll.Sequence.__reversed__

__str__ (self)
(Informal representation operator)

 

Return a string representation.

Overrides: object.__str__

count (self, latlon)

 

Count the number of rows with a specific lat-/longitude.

Arguments:
  • latlon - Point (LatLon, LatLon2Tuple or 2-tuple (lat, lon)).
Returns: integer
Count (int).
Raises:
  • TypeError - Invalid latlon.
Overrides: _abcoll.Sequence.count

find (self, latlon, *start_end)

 

Find the first row with a specific lat-/longitude.

Arguments:
  • latlon - Point (LatLon) or 2-tuple (lat, lon).
  • start_end - Optional [start[, end]] index (integers).
Returns:
Index or -1 if not found (int).
Raises:
  • TypeError - Invalid latlon.

findall (self, latlon, *start_end)

 

Yield indices of all rows with a specific lat-/longitude.

Arguments:
  • latlon - Point (LatLon, LatLon2Tuple or 2-tuple (lat, lon)).
  • start_end - Optional [start[, end]] index (int).
Returns:
Indices (iterable).
Raises:
  • TypeError - Invalid latlon.

index (self, latlon, *start_end)

 

Find index of the first row with a specific lat-/longitude.

Arguments:
  • latlon - Point (LatLon, LatLon2Tuple or 2-tuple (lat, lon)).
  • start_end - Optional [start[, end]] index (int).
Returns: integer
Index (int).
Raises:
  • IndexError - Point not found.
  • TypeError - Invalid latlon.
Overrides: _abcoll.Sequence.index

point (self, row)

 

Instantiate a point LatLon.

Arguments:
  • row - Array row (numpy.array).
Returns:
Point (LatLon).
Overrides: _Basequence.point

rfind (self, latlon, *start_end)

 

Find the last row with a specific lat-/longitude.

Arguments:
  • latlon - Point (LatLon, LatLon2Tuple or 2-tuple (lat, lon)).
  • start_end - Optional [start[, end]] index (int).
Returns:
Index or -1 if not found (int).
Raises:
  • TypeError - Invalid latlon.

Note: Keyword order, first stop, then start.

subset (self, indices)

 

Return a subset of the NumPy array.

Arguments:
  • indices - Row indices (range or int[]).
Returns:
Sub-array (numpy.array).
Raises:
  • IndexError - Out-of-range indices value.
  • TypeError - If indices is not a range nor an int[].

Note: A subset is different from a slice in 2 ways: (a) the subset is typically specified as a list of (un-)ordered indices and (b) the subset allocates a new, separate NumPy array while a slice is just an other view of the original NumPy array.


Property Details

ilat

Get the latitudes column index (int).

Get method:
ilat(self) - Get the latitudes column index (int).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

ilon

Get the longitudes column index (int).

Get method:
ilon(self) - Get the longitudes column index (int).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

shape

Get the shape of the NumPy array or the Tuples as Shape2Tuple(nrows, ncols).

Get method:
shape(self) - Get the shape of the NumPy array or the Tuples as Shape2Tuple(nrows, ncols).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.