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

# Class LocalCartesian

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

Known Subclasses:
  - deprecated.EcefCartesian
  - , Ltp

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. |
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) Return this LocalCartesian as a string. |
Inherited from `named._NamedBase`: `__repr__`, `__str__`, `others`, `toRepr` Inherited from `named._Named`: `_DOT_`, `attrs`, `classof`, `copy`, `rename`, `toStr2` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties
| M Get the rotation matrix (`EcefMatrix`).
| 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`).
| lon0 Get origin's longitude (`degrees`).
Inherited from `named._Named`: `classname`, `classnaming`, `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` - Either a `LatLon`, Ltp, Ecef9Tuple or `scalar` latitude of the (goedetic) origin (`degrees`). `lon0` - Optional `scalar` longitude of the (goedetic) origin `scalar` `latlonh0` (`degrees`). `height0` - Optional origin height (`meter`), vertically above (or below) the surface of the ellipsoid. `ecef` - An ECEF converter (EcefKarney). `name` - Optional 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. `TypeError` - Invalid `ecef`, not EcefKarney. Overrides: object.__init__ Note: If B`latlonh0` is Ltp, only the lat-, longitude and height are duplicated, not the ECEF converter.

### 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`, a 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 rotation EcefMatrix (`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 avaialble (`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) |
Return this LocalCartesian as a string. Arguments: `prec` - Optional precision, number of decimal digits (0..9). Returns: This LocalCartesian representation (`str`). Overrides: named._Named.toStr

Property Details

### 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.

### 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.

### 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.