Package pygeodesy :: Module ltp :: Class LocalCartesian |
[frames] | no frames]

# Class LocalCartesian

      object --+
               |
    named._Named --+
                   |
    named._NamedBase --+
                       |
                      LocalCartesian

Known Subclasses:
  - Ltp
  - , ChLVa
  - , ChLVe

Conversion between geodetic `(lat, lon, height)` and local cartesian `(x, y, z)` coordinates with geodetic origin `(lat0, lon0, height0)`, transcoded from Karney's C++ class LocalCartesian.

The `z` axis is normal to the ellipsoid, the `y` axis points due North. The plane `z = -height0` is tangent to the ellipsoid.

The conversions all take place via geocentric coordinates using a geocentric EcefKarney, by default the WGS84 datum/ellipsoid.

See Also: Class Ltp.

Instance Methods
__init__(self, latlonh0=0, lon0=0, height0=0, ecef=None, name='') New LocalCartesian converter. |
__eq__(self, other) Compare this and an other instance. |
forward(self, latlonh, lon=None, height=0, M=False, name='') Convert geodetic `(lat, lon, height)` to local cartesian `(x, y, z)`. |
reset(self, latlonh0=0, lon0=0, height0=0, name='') Reset the (geodetic) origin. |
reverse(self, xyz, y=None, z=None, M=False, name='') Convert local `(x, y, z)` to geodetic `(lat, lon, height)`. |
toStr(self, prec=9, **unused) Return this LocalCartesian as a string. |
Inherited from `named._NamedBase`: `__repr__`, `__str__`, `others`, `toRepr` Inherited from `named._Named`: `__imatmul__`, `__matmul__`, `__rmatmul__`, `attrs`, `classof`, `copy`, `dup`, `methodname`, `rename`, `toStr2` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties
| datum Get the ECEF converter's datum (Datum).
| ecef Get the ECEF converter (EcefKarney).
| height0 Get origin's height (`meter`).
| lat0 Get origin's latitude (`degrees`).
| latlonheight0 Get the origin's lat-, longitude and height (LatLon3Tuple`(lat, lon, height)`).
| lon0 Get origin's longitude (`degrees`).
| M Get the rotation matrix (`EcefMatrix`).
Inherited from `named._Named`: `classname`, `classnaming`, `iteration`, `name`, `named`, `named2`, `named3`, `named4` Inherited from `object`: `__class__`

Method Details

### __init__ (self, latlonh0=0, lon0=0, height0=0, ecef=None, name='') (Constructor) |
New LocalCartesian converter. Arguments: `latlonh0` - The (geodetic) origin (`LatLon`, LatLon4Tuple, Ltp or Ecef9Tuple) or the `scalar` latitude of the (goedetic) origin (`degrees`). `lon0` - Optional longitude of the (goedetic) origin for `scalar` `latlonh0` and `height0` (`degrees`). `height0` - Optional origin height (`meter`), vertically above (or below) the surface of the ellipsoid. `ecef` - An ECEF converter (EcefKarney only). `name` - Optional name (`str`). Raises: `LocalError` - If `latlonh0` not `LatLon`, LatLon4Tuple, Ltp or Ecef9Tuple or `latlonh0`, `lon0` or `height0` invalid, non-`scalar`. `TypeError` - Invalid `ecef` or not EcefKarney. Overrides: object.__init__ Note: If B`latlonh0` is an Ltp, only the lat-, longitude and height are duplicated, not the ECEF converter.

### __eq__ (self, other) (Equality operator) |
Compare this and an other instance. Arguments: `other` - The other ellipsoid (LocalCartesian or Ltp). Returns: `True` if equal, `False` otherwise.

### forward (self, latlonh, lon=None, height=0, M=False, name='') |
Convert geodetic `(lat, lon, height)` to local cartesian `(x, y, z)`. Arguments: `latlonh` - Either a `LatLon`, an Ltp, an Ecef9Tuple or `scalar` (geodetic) latitude (`degrees`). `lon` - Optional `scalar` (geodetic) longitude for `scalar` `latlonh` (`degrees`). `height` - Optional height (`meter`), vertically above (or below) the surface of the ellipsoid. `M` - Optionally, return the concatenated rotation EcefMatrix, iff available (`bool`). `name` - Optional name (`str`). Returns: A Local9Tuple`(x, y, z, lat, lon, height, ltp, ecef, M)` with local `x`, `y`, `z`, geodetic `(lat`, `lon`, `height`, this `ltp`, `ecef` (Ecef9Tuple) with geocentric `x`, `y`, `z` (and geodetic `lat`, `lon`, `height`) and the concatenated rotation matrix `M` (EcefMatrix) if requested. Raises: `LocalError` - If `latlonh` not `scalar`, `LatLon`, Ltp, Ecef9Tuple or invalid or if `lon` not `scalar` for `scalar` `latlonh` or invalid or if `height` invalid.

### reset (self, latlonh0=0, lon0=0, height0=0, name='') |
Reset the (geodetic) origin. Arguments: `latlonh0` - Either a `LatLon`, an Ecef9Tuple or `scalar` latitude of the origin (`degrees`). `lon0` - Optional `scalar` longitude of the origin for `scalar` `latlonh0` (`degrees`). `height0` - Optional origin height (`meter`), vertically above (or below) the surface of the ellipsoid. `name` - Optional, new name (`str`). Raises: `LocalError` - If `latlonh0` not `LatLon`, Ecef9Tuple, `scalar` or invalid or if `lon0` not `scalar` for `scalar` `latlonh0` or invalid or if `height0` invalid.

### reverse (self, xyz, y=None, z=None, M=False, name='') |
Convert local `(x, y, z)` to geodetic `(lat, lon, height)`. Arguments: `xyz` - A local (XyzLocal, Enu, Ned, Aer, Local9Tuple) or local `x` coordinate (`scalar`). `y` - Local `y` coordinate for `scalar` `xyz` and `z` (`meter`). `z` - Local `z` coordinate for `scalar` `xyz` and `y` (`meter`). `M` - Optionally, return the concatenated rotation EcefMatrix, iff available (`bool`). `name` - Optional name (`str`). Returns: An Local9Tuple`(x, y, z, lat, lon, height, ltp, ecef, M)` with local `x`, `y`, `z`, geodetic `lat`, `lon`, `height`, this `ltp`, an `ecef` (Ecef9Tuple) with the geocentric `x`, `y`, `z` (and geodetic `lat`, `lon`, `height`) and the concatenated rotation matrix `M` (EcefMatrix) if requested. Raises: `LocalError` - Invalid `xyz` or `scalar` `x` or `y` and/or `z` not `scalar` for `scalar` `xyz`.

### toStr (self, prec=9, **unused) |
Return this LocalCartesian as a string. Arguments: `prec` - Precision, number of (decimal) digits (0..9). Returns: This LocalCartesian representation (`str`). Overrides: named._Named.toStr

Property Details

### datum Get the ECEF converter's datum (Datum). Get method: datum(self) - Get the ECEF converter's datum (Datum). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### ecef Get the ECEF converter (EcefKarney). Get method: ecef(self) - Get the ECEF converter (EcefKarney). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### height0 Get origin's height (`meter`). Get method: height0(self) - Get origin's height (`meter`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### lat0 Get origin's latitude (`degrees`). Get method: lat0(self) - Get origin's latitude (`degrees`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### latlonheight0 Get the origin's lat-, longitude and height (LatLon3Tuple`(lat, lon, height)`). Get method: latlonheight0(self) - Get the origin's lat-, longitude and height (LatLon3Tuple`(lat, lon, height)`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### lon0 Get origin's longitude (`degrees`). Get method: lon0(self) - Get origin's longitude (`degrees`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### M Get the rotation matrix (`EcefMatrix`). Get method: M(self) - Get the rotation matrix (`EcefMatrix`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.