Package pygeodesy :: Module cartesianBase :: Class CartesianBase |
[frames] | no frames]

# Class CartesianBase

      object --+
               |
    named._Named --+
                   |
    named._NamedBase --+
                       |
       vector3d.Vector3d --+
                           |
                          CartesianBase

Known Subclasses:
  - ellipsoidalBase.CartesianEllipsoidalBase
  - , sphericalBase.CartesianSphericalBase

(INTERNAL) Base class for ellipsoidal and spherical `Cartesian`.

Instance Methods
__init__(self, xyz, y=None, z=None, datum=None, ll=None, name='') New `Cartesian...`. |
convertDatum(self, datum2, datum=None) Convert this cartesian from one datum to an other. |
destinationXyz(self, delta, Cartesian=None, **Cartesian_kwds) Calculate the destination using a local delta from this cartesian. |
to3llh(self, datum=None) DEPRECATED, use property latlonheightdatum or latlonheight. |
toDatum(self, datum2, datum=None) Convert this cartesian from one datum to an other. |
toEcef(self) Convert this cartesian to geodetic (lat-/longitude) coordinates. |
toLatLon(self, datum=None, LatLon=None, **LatLon_kwds) Convert this cartesian to a geodetic (lat-/longitude) point. |
toLocal(self, Xyz=None, ltp=None, **Xyz_kwds) Convert this geocentric cartesian to local `X`, `Y` and `Z`. |
toLtp(self, Ecef=None) Return the local tangent plane (LTP) for this cartesian. |
toNvector(self, Nvector=None, datum=None, **Nvector_kwds) Convert this cartesian to `n-vector` components. |
toStr(self, prec=3, fmt='[%s]', sep=', ') Return the string representation of this cartesian. |
toVector(self, Vector=None, **Vector_kwds) Return this cartesian's components as vector. |
Inherited from `vector3d.Vector3d`: `__abs__`, `__add__`, `__cmp__`, `__div__`, `__eq__`, `__ge__`, `__gt__`, `__le__`, `__lt__`, `__matmul__`, `__mul__`, `__ne__`, `__neg__`, `__pos__`, `__radd__`, `__rmatmul__`, `__rsub__`, `__sub__`, `__truediv__`, `angleTo`, `cmp`, `cross`, `dividedBy`, `dot`, `equals`, `iscolinearWith`, `isequalTo`, `minus`, `nearestOn`, `negate`, `others`, `parse`, `plus`, `rotate`, `rotateAround`, `sum`, `times`, `to2ab`, `to2ll`, `to3xyz`, `trilaterate3d2`, `unit` Inherited from `named._NamedBase`: `__repr__`, `__str__`, `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
| Ecef Get the ECEF class (EcefKarney), lazily.
| datum Property to get and set this cartesian's datum (Datum).
| height Property to get and set the height (`meter`).
| isEllipsoidal Check whether this cartesian is ellipsoidal (`bool` or `None` if unknown).
| isSpherical Check whether this cartesian is spherical (`bool` or `None` if unknown).
| latlon Get this cartesian's (geodetic) lat- and longitude in `degrees` (LatLon2Tuple`(lat, lon)`).
| latlonheight Get this cartesian's (geodetic) lat-, longitude in `degrees` with height (LatLon3Tuple`(lat, lon, height)`).
| latlonheightdatum Get this cartesian's (geodetic) lat-, longitude in `degrees` with height and datum (LatLon4Tuple`(lat, lon, height, datum)`).
| philam Get this cartesian's (geodetic) lat- and longitude in `radians` (PhiLam2Tuple`(phi, lam)`).
| philamheight Get this cartesian's (geodetic) lat-, longitude in `radians` with height (PhiLam3Tuple`(phi, lam, height)`).
| philamheightdatum Get this cartesian's (geodetic) lat-, longitude in `radians` with height and datum (PhiLam4Tuple`(phi, lam, height, datum)`).
Inherited from `vector3d.Vector3d`: `crosserrors`, `euclid`, `length`, `length2`, `x`, `xyz`, `y`, `z` Inherited from `named._Named`: `classname`, `classnaming`, `name`, `named`, `named2`, `named3`, `named4` Inherited from `object`: `__class__`

Method Details

### __init__ (self, xyz, y=None, z=None, datum=None, ll=None, name='') (Constructor) |
New `Cartesian...`. Arguments: `xyz` - An Ecef9Tuple, Vector3Tuple, Vector4Tuple or the `X` coordinate (`scalar`). `y` - The `Y` coordinate (`scalar`) if `xyz` `scalar`. `z` - The `Z` coordinate (`scalar`) if `xyz` `scalar`. `datum` - Optional datum (Datum, Ellipsoid, Ellipsoid2 or a_f2Tuple). `ll` - Optional, original latlon (`LatLon`). `name` - Optional name (`str`). Raises: `TypeError` - Non-scalar `xyz`, `y` or `z` coordinate or `xyz` not an Ecef9Tuple, Vector3Tuple or Vector4Tuple. Overrides: object.__init__

### convertDatum (self, datum2, datum=None) |
Convert this cartesian from one datum to an other. Arguments: `datum2` - Datum to convert to (Datum). `datum` - Datum to convert from (Datum). Returns: The converted point (`Cartesian`). Raises: `TypeError` - `datum2` or `datum` invalid.

### destinationXyz (self, delta, Cartesian=None, **Cartesian_kwds) |
Calculate the destination using a local delta from this cartesian. Arguments: `delta` - Local delta to the destination (XyzLocal, Enu, Ned or Local9Tuple). `Cartesian` - Optional (geocentric) class to return the destination or `None`. `Cartesian_kwds` - Optional, additional `Cartesian` keyword arguments, ignored if `Cartesian=None`. Returns: Destination as a `Cartesian(x, y, z, **Cartesian_kwds)` instance or if `Cartesian=None`, an Ecef9Tuple`(x, y, z, lat, lon, height, C, M, datum)` with `M=None` always. Raises: `TypeError` - Invalid `delta`, `Cartesian` or `Cartesian_kwds`.

### to3llh (self, datum=None) |
DEPRECATED, use property latlonheightdatum or latlonheight. Returns: A LatLon4Tuple`(lat, lon, height, datum)`. Decorators: `@deprecated_method` Note: This method returns a `-4Tuple` and not a `-3Tuple` as its name may suggest.

### toDatum (self, datum2, datum=None) |
Convert this cartesian from one datum to an other. Arguments: `datum2` - Datum to convert to (Datum). `datum` - Datum to convert from (Datum). Returns: The converted point (`Cartesian`). Raises: `TypeError` - `datum2` or `datum` invalid.

### toEcef (self) |
Convert this cartesian to geodetic (lat-/longitude) coordinates. Returns: An Ecef9Tuple`(x, y, z, lat, lon, height, C, M, datum)` with `C` and `M` if available. Raises: `EcefError` - A `.datum` or an ECEF issue.

### toLatLon (self, datum=None, LatLon=None, **LatLon_kwds) |
Convert this cartesian to a geodetic (lat-/longitude) point. Arguments: `datum` - Optional datum (Datum, Ellipsoid, Ellipsoid2 or a_f2Tuple). `LatLon` - Optional class to return the geodetic point (`LatLon`) or `None`. `LatLon_kwds` - Optional, additional `LatLon` keyword arguments, ignored if `LatLon=None`. Returns: The geodetic point (`LatLon`) or if `LatLon` is `None`, an Ecef9Tuple`(x, y, z, lat, lon, height, C, M, datum)` with `C` and `M` if available. Raises: `TypeError` - Invalid `datum` or `LatLon_kwds`.

### toLocal (self, Xyz=None, ltp=None, **Xyz_kwds) |
Convert this geocentric cartesian to local `X`, `Y` and `Z`. Arguments: `Xyz` - Optional class to return `X`, `Y` and `Z` (XyzLocal, Enu, Ned) or `None`. `ltp` - The local tangent plane (LTP) to use, overriding this cartesian's LTP (Ltp). `Xyz_kwds` - Optional, additional `Xyz` keyword arguments, ignored if `Xyz=None`. Returns: An `Xyz` instance or if `Xyz=None`, a Local9Tuple`(x, y, z, lat, lon, height, ltp, ecef, M)` with `M=None` always. Raises: `TypeError` - Invalid `ltp`.

### toLtp (self, Ecef=None) |
Return the local tangent plane (LTP) for this cartesian. Arguments: `Ecef` - Optional ECEF class (EcefKarney, ... EcefYou), overriding this cartesian's `Ecef`.

### toNvector (self, Nvector=None, datum=None, **Nvector_kwds) |
Convert this cartesian to `n-vector` components. Arguments: `Nvector` - Optional class to return the `n-vector` components (`Nvector`) or `None`. `datum` - Optional datum (Datum, Ellipsoid, Ellipsoid2 or a_f2Tuple) overriding this cartesian's datum. `Nvector_kwds` - Optional, additional `Nvector` keyword arguments, ignored if `Nvector=None`. Returns: The `unit, n-vector` components (`Nvector`) or a Vector4Tuple`(x, y, z, h)` if `Nvector` is `None`. Raises: `TypeError` - Invalid `datum`. `ValueError` - The `Cartesian` at origin. Example:
    >>> c = Cartesian(3980581, 97, 4966825)
    >>> n = c.toNvector()  # (x=0.622818, y=0.00002, z=0.782367, h=0.242887)

### toStr (self, prec=3, fmt='[%s]', sep=', ') |
Return the string representation of this cartesian. Arguments: `prec` - Optional number of decimals, unstripped (`int`). `fmt` - Optional enclosing backets format (string). `sep` - Optional separator to join (string). Returns: Cartesian represented as "[x, y, z]" (string). Raises: `AssertionError` - Always, see function notOverloaded. Overrides: named._Named.toStr

### toVector (self, Vector=None, **Vector_kwds) |
Return this cartesian's components as vector. Arguments: `Vector` - Optional class to return the `n-vector` components (Vector3d) or `None`. `Vector_kwds` - Optional, additional `Vector` keyword arguments, ignored if `Vector=None`. Returns: A `Vector` or an Vector3Tuple`(x, y, z)` if `Vector` is `None`. Raises: `TypeError` - Invalid `Vector` or `Vector_kwds`.

Property Details

### Ecef Get the ECEF class (EcefKarney), lazily. Get method: _fget(inst) Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst)

### datum Property to get and set this cartesian's datum (Datum). Get method: datum(self) - Get this cartesian's datum (Datum). Set method: datum(self, datum) - Set this cartesian's `datum` without conversion.

### height Property to get and set the height (`meter`). Get method: height(self) - Get the height (`meter`). Set method: height(self, height) - Set the height.

### isEllipsoidal Check whether this cartesian is ellipsoidal (`bool` or `None` if unknown). Get method: _fget(inst) Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst)

### isSpherical Check whether this cartesian is spherical (`bool` or `None` if unknown). Get method: _fget(inst) Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst)

### latlon Get this cartesian's (geodetic) lat- and longitude in `degrees` (LatLon2Tuple`(lat, lon)`). Get method: _fget(inst) Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst)

### latlonheight Get this cartesian's (geodetic) lat-, longitude in `degrees` with height (LatLon3Tuple`(lat, lon, height)`). Get method: _fget(inst) Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst)

### latlonheightdatum Get this cartesian's (geodetic) lat-, longitude in `degrees` with height and datum (LatLon4Tuple`(lat, lon, height, datum)`). Get method: _fget(inst) Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst)

### philam Get this cartesian's (geodetic) lat- and longitude in `radians` (PhiLam2Tuple`(phi, lam)`). Get method: _fget(inst) Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst)

### philamheight Get this cartesian's (geodetic) lat-, longitude in `radians` with height (PhiLam3Tuple`(phi, lam, height)`). Get method: _fget(inst) Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst)

### philamheightdatum Get this cartesian's (geodetic) lat-, longitude in `radians` with height and datum (PhiLam4Tuple`(phi, lam, height, datum)`). Get method: _fget(inst) Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst)