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

# Class CartesianBase

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

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

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

Instance Methods
__init__(self, x_xyz, y=None, z=None, datum=None, ll=None, name='') New `Cartesian...`. |
cassini(self, pointB, pointC, alpha, beta, useZ=False) 3-Point resection between this and 2 other points using Cassini's method. |
collins(self, pointB, pointC, alpha, beta, useZ=False) DEPRECATED, use method collins5. |
collins5(self, pointB, pointC, alpha, beta, useZ=False) 3-Point resection between this and 2 other points using Collins' method. |
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. |
hartzell(self, los=None, earth=None) Compute the intersection of a Line-Of-Sight (los) from this certesian Point-Of-View (pov) with this cartesian's ellipsoid surface. |
height4(self, earth=None, normal=True, Cartesian=None, **Cartesian_kwds) Compute the height of this cartesian above or below and the projection on this datum's ellipsoid surface. |
pierlot(self, point2, point3, alpha12, alpha23, useZ=False) 3-Point resection between this and two other points using Pierlot's method `ToTal`. |
tienstra(self, pointB, pointC, alpha, beta=None, gamma=None, useZ=False) DEPRECATED, use method tienstra7. |
tienstra7(self, pointB, pointC, alpha, beta=None, gamma=None, useZ=False) 3-Point resection between this and two other points using Tienstra's formula. |
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, height=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. |
toTransform(self, transform, inverse=False, datum=None) Return a new cartesian by applying a Helmert transform to this cartesian. |
toVector(self, Vector=None, **Vector_kwds) Return this cartesian's components as vector. |
Inherited from `vector3d.Vector3d`: `circin6`, `circum3`, `circum4_`, `iscolinearWith`, `meeus2`, `nearestOn`, `nearestOn6`, `parse`, `radii11`, `soddy4`, `trilaterate2d2`, `trilaterate3d2` Inherited from `vector3dBase.Vector3dBase`: `__abs__`, `__add__`, `__bool__`, `__cmp__`, `__div__`, `__divmod__`, `__eq__`, `__floordiv__`, `__format__`, `__ge__`, `__gt__`, `__iadd__`, `__idiv__`, `__imatmul__`, `__imul__`, `__int__`, `__isub__`, `__itruediv__`, `__le__`, `__long__`, `__lt__`, `__matmul__`, `__mod__`, `__mul__`, `__ne__`, `__neg__`, `__nonzero__`, `__pos__`, `__pow__`, `__radd__`, `__rdiv__`, `__rdivmod__`, `__rfloordiv__`, `__rmatmul__`, `__rmod__`, `__rmul__`, `__round__`, `__rpow__`, `__rsub__`, `__rtruediv__`, `__sub__`, `__truediv__`, `__trunc__`, `angleTo`, `apply`, `cmp`, `cross`, `dividedBy`, `dot`, `equals`, `equirectangular`, `intermediateTo`, `isconjugateTo`, `isequalTo`, `minus`, `negate`, `others`, `plus`, `rotate`, `rotateAround`, `sum`, `times`, `times_`, `to2ab`, `to2ll`, `to3xyz`, `unit` Inherited from `named._NamedBase`: `__repr__`, `__str__`, `toRepr` Inherited from `named._Named`: `_DOT_`, `attrs`, `classof`, `copy`, `dup`, `rename`, `toStr2` Inherited from `object`: `__delattr__`, `__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 Get 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 `vector3dBase.Vector3dBase`: `crosserrors`, `euclid`, `length`, `length2`, `x`, `x2y2z2`, `xyz`, `y`, `z` Inherited from `named._Named`: `classname`, `classnaming`, `name`, `named`, `named2`, `named3`, `named4` Inherited from `object`: `__class__`

Method Details

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

### cassini (self, pointB, pointC, alpha, beta, useZ=False) |
3-Point resection between this and 2 other points using Cassini's method. Arguments: `pointB` - Second point (`Cartesian`, Vector3d, `Vector3Tuple`, `Vector4Tuple` or `Vector2Tuple` if `useZ=False`). `pointC` - Center point (`Cartesian`, Vector3d, `Vector3Tuple`, `Vector4Tuple` or `Vector2Tuple` if `useZ=False`). `alpha` - Angle subtended by triangle side `b` from `pointA` to `pointC` (`degrees`, non-negative). `beta` - Angle subtended by triangle side `a` from `pointB` to `pointC` (`degrees`, non-negative). `useZ` - If `True`, use and interpolate the Z component, otherwise force `z=0` (`bool`). Returns: The survey point, an instance of this (sub-)class. Raises: `ResectionError` - Near-coincident, -colinear or -concyclic points or negative or invalid `alpha` or `beta`. `TypeError` - Invalid `pointA`, `pointB` or `pointM`. Note: Typically, `pointC` is between this and `pointB`. See Also: Three Point Resection Problem and function pygeodesy.cassini.

### collins (self, pointB, pointC, alpha, beta, useZ=False) |
DEPRECATED, use method collins5. Decorators: `@deprecated_method`

### collins5 (self, pointB, pointC, alpha, beta, useZ=False) |
3-Point resection between this and 2 other points using Collins' method. Arguments: `pointB` - Second point (`Cartesian`, Vector3d, `Vector3Tuple`, `Vector4Tuple` or `Vector2Tuple` if `useZ=False`). `pointC` - Center point (`Cartesian`, Vector3d, `Vector3Tuple`, `Vector4Tuple` or `Vector2Tuple` if `useZ=False`). `alpha` - Angle subtended by triangle side `b` from `pointA` to `pointC` (`degrees`, non-negative). `beta` - Angle subtended by triangle side `a` from `pointB` to `pointC` (`degrees`, non-negative). `useZ` - If `True`, use and interpolate the Z component, otherwise force `z=0` (`bool`). Returns: Collins5Tuple`(pointP, pointH, a, b, c)` with survey `pointP`, auxiliary `pointH`, each an instance of this (sub-)class and triangle sides `a`, `b` and `c`. Raises: `ResectionError` - Near-coincident, -colinear or -concyclic points or negative or invalid `alpha` or `beta`. `TypeError` - Invalid `pointB` or `pointM`. Note: Typically, `pointC` is between this and `pointB`. See Also: Collins' methode and function pygeodesy.collins5.

### 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 is None`. Returns: Destination as a `Cartesian(x, y, z, **Cartesian_kwds)` instance or if `Cartesian is None`, an Ecef9Tuple`(x, y, z, lat, lon, height, C, M, datum)` with `M=None` always. Raises: `TypeError` - Invalid `delta`, `Cartesian` or `Cartesian_kwds`.

### hartzell (self, los=None, earth=None) |
Compute the intersection of a Line-Of-Sight (los) from this certesian Point-Of-View (pov) with this cartesian's ellipsoid surface. Arguments: `los` - Line-Of-Sight, direction to earth (Vector3d) or `None` to point to the ellipsoid's center. `earth` - The earth model (Datum, Ellipsoid, Ellipsoid2, a_f2Tuple or `scalar` radius in `meter`) overriding this cartesian's `datum` ellipsoid. Returns: The ellipsoid intersection (`Cartesian`). Raises: `IntersectionError` - Null `pov` or `los` vector, this `pov` is inside the ellipsoid or `los` points outside the ellipsoid or in an opposite direction. `TypeError` - Invalid `los` or no `datum`. See Also: Function `hartzell` for further details.

### height4 (self, earth=None, normal=True, Cartesian=None, **Cartesian_kwds) |
Compute the height of this cartesian above or below and the projection on this datum's ellipsoid surface. Arguments: `earth` - A datum, ellipsoid or earth radius overriding this datum (Datum, Ellipsoid, Ellipsoid2, a_f2Tuple or `meter`, conventionally). `normal` - If `True` the projection is the nearest point on the ellipsoid's surface, otherwise the intersection of the radial line to the center and the ellipsoid's surface. `Cartesian` - Optional class to return the height and projection (`Cartesian`) or `None`. `Cartesian_kwds` - Optional, additional `Cartesian` keyword arguments, ignored if `Cartesian is None`. Returns: An instance of `Cartesian` or if `Cartesian is None`, a Vector4Tuple`(x, y, z, h)` with the projection `x`, `y` and `z` coordinates and height `h` in `meter`, conventionally. Raises: `TypeError` - Invalid `earth`. Note: Use keyword argument `height=0` to override `Cartesian.height` to {0} or any other `scalar`, conventionally in `meter`. See Also: Ellipsoid.height4 for more information.

### pierlot (self, point2, point3, alpha12, alpha23, useZ=False) |
3-Point resection between this and two other points using Pierlot's method `ToTal`. Arguments: `point2` - Second point (`Cartesian`, Vector3d, `Vector3Tuple`, `Vector4Tuple` or `Vector2Tuple` if `useZ=False`). `point3` - Third point (`Cartesian`, Vector3d, `Vector3Tuple`, `Vector4Tuple` or `Vector2Tuple` if `useZ=False`). `alpha12` - Angle subtended from this point to `point2` (`degrees`). `alpha23` - Angle subtended from `point2` to `point3` (`degrees`). `useZ` - If `True`, interpolate the Z component, otherwise use `z=0` (`bool`). Returns: The survey (or robot) point, an instance of this (sub-)class. Raises: `ResectionError` - Near-coincident, -colinear or -concyclic points or invalid `alpha12` or `alpha23`. `TypeError` - Invalid `point2` or `point3`. Note: This point, `point2` and `point3` are ordered counter-clockwise. See Also: V. Pierlot, M. Van Droogenbroeck, "A New Three Object Triangulation Algorithm for Mobile Robot Positioning", 18 Triangulation Algorithms for 2D Positioning (also known as the Resection Problem) and functions pygeodesy.pierlot.

### tienstra (self, pointB, pointC, alpha, beta=None, gamma=None, useZ=False) |
DEPRECATED, use method tienstra7. Decorators: `@deprecated_method`

### tienstra7 (self, pointB, pointC, alpha, beta=None, gamma=None, useZ=False) |
3-Point resection between this and two other points using Tienstra's formula. Arguments: `pointB` - Second point (`Cartesian`, Vector3d, `Vector3Tuple`, `Vector4Tuple` or `Vector2Tuple` if `useZ=False`). `pointC` - Third point (`Cartesian`, Vector3d, `Vector3Tuple`, `Vector4Tuple` or `Vector2Tuple` if `useZ=False`). `alpha` - Angle subtended by triangle side `a` from `pointB` to `pointC` (`degrees`, non-negative). `beta` - Angle subtended by triangle side `b` from this to `pointC` (`degrees`, non-negative) or `None` if `gamma is not None`. `gamma` - Angle subtended by triangle side `c` from this to `pointB` (`degrees`, non-negative) or `None` if `beta is not None`. `useZ` - If `True`, use and interpolate the Z component, otherwise force `z=0` (`bool`). Returns: Tienstra7Tuple`(pointP, A, B, C, a, b, c)` with survey `pointP`, an instance of this (sub-)class and triangle angle `A` at this point, `B` at `pointB` and `C` at `pointC` in `degrees` and triangle sides `a`, `b` and `c`. Raises: `ResectionError` - Near-coincident, -colinear or -concyclic points or sum of `alpha`, `beta` and `gamma` not `360` or negative `alpha`, `beta` or `gamma`. `TypeError` - Invalid `pointB` or `pointC`. Note: This point, `pointB` and `pointC` are ordered clockwise. See Also: 3-Point Resection Solver, V. Pierlot, M. Van Droogenbroeck, "A New Three Object Triangulation...", 18 Triangulation Algorithms... and function pygeodesy.tienstra7.

### 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, height=None, LatLon=None, **LatLon_kwds) |
Convert this cartesian to a geodetic (lat-/longitude) point. Arguments: `datum` - Optional datum (Datum, Ellipsoid, Ellipsoid2 or a_f2Tuple). `height` - Optional height, overriding the converted height (`meter`), iff `LatLon` is not `None`. `LatLon` - Optional class to return the geodetic point (`LatLon`) or `None`. `LatLon_kwds` - Optional, additional `LatLon` keyword arguments, ignored if `LatLon is 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 is None`. Returns: An `Xyz` instance or if `Xyz is 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 is 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). Overrides: named._Named.toStr

### toTransform (self, transform, inverse=False, datum=None) |
Return a new cartesian by applying a Helmert transform to this cartesian. Arguments: `transform` - Transform to apply (Transform). `inverse` - Apply the inverse of the Helmert transform (`bool`). `datum` - Datum for the transformed cartesian (Datum), overriding this cartesian's datum. Returns: The transformed cartesian (`Cartesian`). Raises: `Valuerror` - If `inverse=True` and `datum` is not Datums`.WGS84`.

### 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 is 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: Ecef(self) - Get the ECEF class (EcefKarney), lazily. Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### 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 Get the height (`meter`). Get method: height(self) - Get the height (`meter`). Set method: height(self, height) - Set the height. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### isEllipsoidal Check whether this cartesian is ellipsoidal (`bool` or `None` if unknown). Get method: isEllipsoidal(self) - Check whether this cartesian is ellipsoidal (`bool` or `None` if unknown). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### isSpherical Check whether this cartesian is spherical (`bool` or `None` if unknown). Get method: isSpherical(self) - Check whether this cartesian is spherical (`bool` or `None` if unknown). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### latlon Get this cartesian's (geodetic) lat- and longitude in `degrees` (LatLon2Tuple`(lat, lon)`). Get method: latlon(self) - Get this cartesian's (geodetic) lat- and longitude in `degrees` (LatLon2Tuple`(lat, lon)`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### latlonheight Get this cartesian's (geodetic) lat-, longitude in `degrees` with height (LatLon3Tuple`(lat, lon, height)`). Get method: latlonheight(self) - Get this cartesian's (geodetic) lat-, longitude in `degrees` with 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.

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

### philam Get this cartesian's (geodetic) lat- and longitude in `radians` (PhiLam2Tuple`(phi, lam)`). Get method: philam(self) - Get this cartesian's (geodetic) lat- and longitude in `radians` (PhiLam2Tuple`(phi, lam)`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

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

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