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 point from one to an other datum. |
to3llh(self, datum=None) DEPRECATED, use method `toLatLon`. |
toEcef(self) Convert this cartesian to geodetic coordinates. |
toLatLon(self, datum=None, LatLon=None, **kwds) Convert this cartesian point to a geodetic point. |
toNvector(self, Nvector=None, datum=None, **kwds) Convert this cartesian to `n-vector` components. |
toStr(self, prec=3, fmt=`'``[%s]``'`, sep=`'``,` `'`) Return the string representation of this cartesian. |
Inherited from `vector3d.Vector3d`: `__abs__`, `__add__`, `__cmp__`, `__div__`, `__eq__`, `__ge__`, `__gt__`, `__le__`, `__lt__`, `__matmul__`, `__mul__`, `__ne__`, `__neg__`, `__pos__`, `__radd__`, `__rmatmul__`, `__rsub__`, `__sub__`, `__truediv__`, `angleTo`, `cross`, `dividedBy`, `dot`, `equals`, `isequalTo`, `minus`, `negate`, `others`, `parse`, `plus`, `rotate`, `rotateAround`, `sum`, `times`, `to2ab`, `to2ll`, `to3xyz`, `unit` Inherited from `named._NamedBase`: `__repr__`, `__str__`, `toStr2` Inherited from `named._Named`: `classof`, `copy` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties
| Ecef Get the ECEF class (EcefKarney or EcefVeness).
| datum Get this point's datum (Datum).
Inherited from `vector3d.Vector3d`: `crosserrors`, `length`, `x`, `y`, `z` Inherited from `named._Named`: `classname`, `classnaming`, `name`, `named`, `named2` Inherited from `object`: `__class__`

Method Details

### __init__(self, xyz, y=None, z=None, datum=None, ll=None, name=`'````'`) (Constructor) |
New `Cartesian...`. Parameters: `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). `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 point from one to an other datum. Parameters: `datum2` - Datum to convert to (Datum). `datum` - Datum to convert from (Datum). Returns: The converted point (`Cartesian`). Raises: `TypeError` - `datum2` or `datum` not a Datum.

### to3llh(self, datum=None) |
DEPRECATED, use method `toLatLon`. Convert this cartesian to geodetic lat-, longitude and height. Parameters: `datum` - Optional datum to use (Datum). Returns: A LatLon4Tuple`(lat, lon, height, datum)`. Raises: `TypeError` - Invalid `datum`.

### toEcef(self) |
Convert this cartesian to geodetic 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, **kwds) |
Convert this cartesian point to a geodetic point. Parameters: `datum` - Optional datum (Datum) or `None`. `LatLon` - Optional (sub-)class to return the geodetic point (`LatLon`) or `None`. `kwds` - Optional, additional `LatLon` keyword arguments, ignored if `LatLon=None`. Returns: The `LatLon` point or if `LatLon=None`, an Ecef9Tuple`(x, y, z, lat, lon, height, C, M, datum)` with `C` and `M` if available. Raises: `TypeError` - Invalid `datum` or `kwds`.

### toNvector(self, Nvector=None, datum=None, **kwds) |
Convert this cartesian to `n-vector` components. Parameters: `Nvector` - Optional (sub-)class to return the `n-vector` components (`Nvector`) or `None`. `datum` - Optional datum (Datum) overriding this cartesian's datum. `kwds` - Optional, additional `Nvector` keyword arguments, ignored if `Nvector=None`. Returns: Unit vector `Nvector` or a Vector4Tuple`(x, y, z, h)` if `Nvector`=None. Raises: `ValueError` - The `Cartesian` at origin.

### toStr(self, prec=3, fmt=`'``[%s]``'`, sep=`'``,` `'`) |
Return the string representation of this cartesian. Parameters: `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

Property Details

### Ecef Get the ECEF class (EcefKarney or EcefVeness). Get Method: Ecef(self) - Get the ECEF class (EcefKarney or EcefVeness). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### datum Get this point's datum (Datum). Get Method: datum(self) - Get this point's datum (Datum). Set Method: datum(self, datum) - Set this geocentric point's `datum` without conversion.