Package pygeodesy :: Module ecef :: Class EcefCartesian |
[frames] | no frames]

# Class EcefCartesian

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

Conversion between geodetic `(lat, lon, height)` and local cartesian `(x, y, z)` coordinates with a local cartesian origin at `(lat0, lon0, height0)` transcibed from on Karney's C++ class LocalCartesian.

The `z` axis is normal to the ellipsoid, the `y` axis points due North. The plane `z = -heighth0` is tangent to the ellipsoid.

The conversions all take place via geocentric coordinates using a geocentric EcefKarney, by default the WGS84 datum/ellipsoid.

Instance Methods
__init__(self, latlonh0=0, lon0=0, height0=0, ecef=EcefKarney(a=6378137.0, f=0.003352811, datum=Datum(name='WGS84`...`, name=`'````'`) New EcefCartesian converter. |
forward(self, latlonh, lon=None, height=0, M=False) Convert from geodetic `(lat, lon, height)` to local cartesian `(x, y, z)`. |
reset(self, latlonh0=0, lon0=0, height0=0, name=`'````'`) Reset the local cartesian origin. |
reverse(self, xyz, y=None, z=None, M=False) Convert from local cartesian `(x, y, z)` to geodetic `(lat, lon, height)`. |
toStr(self, prec=9) Return this EcefCartesian as a string. |
Inherited from `named._NamedBase`: `__repr__`, `__str__`, `others`, `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 converter (EcefKarney).
| height0 Get origin's height (`meter`).
| lat0 Get origin's latitude (`degrees`).
| lon0 Get origin's longitude (`degrees`).
| M Get the rotation matrix (`EcefMatrix`).
Inherited from `named._Named`: `classname`, `classnaming`, `name`, `named`, `named2` Inherited from `object`: `__class__`

Method Details

### __init__(self, latlonh0=0, lon0=0, height0=0, ecef=EcefKarney(a=6378137.0, f=0.003352811, datum=Datum(name='WGS84`...`, name=`'````'`) (Constructor) |
New EcefCartesian converter. Parameters: `latlonh0` - Either a `LatLon`, an Ecef9Tuple or `scalar` latitude in `degrees` of the cartesian origin. `lon0` - Optional `scalar` longitude of the cartesian origin in `degrees` for `scalar` `latlonh0`. `height0` - Optional height of the cartesian origin in `meter`, vertically above (or below) the surface of the ellipsoid. `ecef` - An EXEC converter (EcefKarney). `name` - Optional name (`str`). Raises: `EcefError` - If `latlonh0` not `LatLon`, Ecef9Tuple or `scalar` or `lon0` not `scalar` for `scalar` `latlonh0` or `abs(lat0)` exceeds 90°. `TypeError` - Invalid `ecef`, not EcefKarney. Overrides: object.__init__

### forward(self, latlonh, lon=None, height=0, M=False) |
Convert from geodetic `(lat, lon, height)` to local cartesian `(x, y, z)`. Parameters: `latlonh` - Either a `LatLon`, an Ecef9Tuple or `scalar` latitude in `degrees`. `lon` - Optional `scalar` longitude in `degrees` for `scalar` `latlonh`. `height` - Optional height in `meter`, vertically above (or below) the surface of the ellipsoid. `M` - Optionally, return the rotation EcefMatrix (`bool`). Returns: An Ecef9Tuple`(x, y, z, lat, lon, height, C, M, datum)` with geocentric `(x, y, z)` coordinates for the given geodetic ones `(lat, lon, height)`, case `C` 0, optional EcefMatrix `M` and `datum` if available. Raises: `EcefError` - If `latlonh` not `LatLon`, Ecef9Tuple or `scalar` or `lon` not `scalar` for `scalar` `latlonh` or `abs(lat)` exceeds 90°. See Also: Note at method EcefKarney.forward.

### reset(self, latlonh0=0, lon0=0, height0=0, name=`'````'`) |
Reset the local cartesian origin. Parameters: `latlonh0` - Either a `LatLon`, an Ecef9Tuple or `scalar` latitude in `degrees` of the cartesian origin. `lon0` - Optional, `scalar` longitude of the cartesian origin in `degrees` for `scalar` `latlonh0`. `height0` - Optional, height of the cartesian origin in `meter`, vertically above (or below) the surface of the ellipsoid. `name` - Optional, new name (`str`). Raises: `EcefError` - If `latlonh0` not `LatLon`, Ecef9Tuple or `scalar` or `lon0` not `scalar` for `scalar` `latlonh0` or `abs(lat)` exceeds 90°.

### reverse(self, xyz, y=None, z=None, M=False) |
Convert from local cartesian `(x, y, z)` to geodetic `(lat, lon, height)`. Parameters: `xyz` - Either an Ecef9Tuple, an `(x, y, z)` 3-tuple or `scalar` local cartesian `x` coordinate in `meter`. `y` - Local cartesian `y` coordinate in `meter` for `scalar` `xyz` and `z`. `z` - Local cartesian `z` coordinate in `meter` for `scalar` `xyz` and `y`. `M` - Optionally, return the rotation EcefMatrix (`bool`). Returns: An Ecef9Tuple`(x, y, z, lat, lon, height, C, M, datum)` with geodetic coordinates `(lat, lon, height)` for the given geocentric ones `(x, y, z)`, case `C`, optional EcefMatrix `M` and `datum` if available. Raises: `EcefError` - If `xyz` not Ecef9Tuple or `scalar` `x` or `y` and/or `z` not `scalar` for `scalar` `xyz`. See Also: Note at method EcefKarney.reverse.

### toStr(self, prec=9) |
Return this EcefCartesian as a string. Parameters: `prec` - Optional precision, number of decimal digits (0..9). Returns: This EcefCartesian as `str`. Overrides: named._Named.toStr

Property Details

### ecef Get the ECEF converter (EcefKarney). Get Method: ecef(self) - Get the ECEF converter (EcefKarney). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### height0 Get origin's height (`meter`). Get Method: height0(self) - Get origin's height (`meter`). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### lat0 Get origin's latitude (`degrees`). Get Method: lat0(self) - Get origin's latitude (`degrees`). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### lon0 Get origin's longitude (`degrees`). Get Method: lon0(self) - Get origin's longitude (`degrees`). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### M Get the rotation matrix (`EcefMatrix`). Get Method: M(self) - Get the rotation matrix (`EcefMatrix`). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.