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, **lon00_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, ecef=None, **lon00_name) Reset this converter, see LocalCartesian.__init__ for more details. |
reverse(self, xyz, y=None, z=None, M=False, **lon00_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`, `renamed`, `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).
| ellipsoid Get the ECEF converter's ellipsoid (Ellipsoid).
| height0 Get the origin's height (`meter`).
| lat0 Get the origin's latitude (`degrees`).
| latlonheight0 Get the origin's lat-, longitude and height (LatLon3Tuple`(lat, lon, height)`).
| lon0 Get the origin's longitude (`degrees`).
| lon00 Get the arbitrary, polar longitude (`degrees`).
| M Get the rotation matrix (`EcefMatrix`).
Inherited from `named._Named`: `classname`, `classnaming`, `iteration`, `name`, `named`, `named2`, `named3`, `named4`, `sizeof` Inherited from `object`: `__class__`

Method Details

### __init__ (self, latlonh0=0, lon0=0, height0=0, ecef=None, **lon00_name) (Constructor) |
New LocalCartesian converter. Arguments: `latlonh0` - The (geodetic) origin (`LatLon`, LatLon4Tuple, Ltp LocalCartesian or Ecef9Tuple) or the `scalar` latitude of the (goedetic) origin (`degrees`). `lon0` - Longitude of the (goedetic) origin (`degrees`), required if `latlonh0` is `scalar`, ignored otherwise. `height0` - Optional height (`meter`, conventionally) at the (goedetic) origin perpendicular to and above (or below) the ellipsoid's surface, like `lon0`. `ecef` - An ECEF converter (EcefKarney only), like `lon0`. `lon00_name` - Optional `name=NN` (`str`) and keyword argument `lon00=lon0` for the arbitrary polar longitude (`degrees`), see method `reverse` and property `lon00` for further details. Raises: `LocalError` - If `latlonh0` not `LatLon`, LatLon4Tuple, Ltp, LocalCartesian or Ecef9Tuple or `latlonh0`, `lon0`, `height0` or `lon00` invalid. `TypeError` - Invalid `ecef` or not EcefKarney. Overrides: object.__init__ Note: If B`latlonh0` is an Ltp or LocalCartesian, only `lat0`, `lon0`, `height0` and polar `lon00` are copied, 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`, Ltp, Ecef9Tuple or `scalar` (geodetic) latitude (`degrees`). `lon` - Optional `scalar` (geodetic) longitude for `scalar` `latlonh` (`degrees`). `height` - Optional height (`meter`, conventionally) perpendicular to and above (or below) the ellipsoid's surface. `M` - Optionally, return the concatenated rotation EcefMatrix, iff available (`bool`). `name` - Optional `name=NN` (`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.

### reverse (self, xyz, y=None, z=None, M=False, **lon00_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`). `lon00_name` - Optional `name=NN` (`str`) and keyword argument `lon00=lon0` for the arbitrary polar longitude (`degrees`), overriding see the property `lon00=lon0` value. The polar longitude (`degrees`) is returned with polar latitudes `abs(lat0) == 90` for local `x=0` and `y=0` locations. 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.

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

### height0 Get the origin's height (`meter`). Get method: height0(self) - Get the 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 the origin's latitude (`degrees`). Get method: lat0(self) - Get the 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 the origin's longitude (`degrees`). Get method: lon0(self) - Get the origin's longitude (`degrees`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### lon00 Get the arbitrary, polar longitude (`degrees`). Get method: lon00(self) - Get the arbitrary, polar longitude (`degrees`). Set method: lon00(self, lon00) - Set the arbitrary, polar longitude (`degrees`). 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.