Bases: astropy.units.quantity.Quantity
Location on Earth.
Initialization is first attempted assuming geocentric (x, y, z) coordinates are given; if that fails, another attempt is made assuming geodetic coordinates (longitude, latitude, height above a reference ellipsoid). Internally, the coordinates are stored as geocentric.
To ensure a specific type of coordinates is used, use the corresponding class methods (from_geocentric and from_geodetic) or initialize the arguments with names (x, y, z for geocentric; lon, lat, height for geodetic). See the class methods for details.
Notes
For conversion to and from geodetic coordinates, the ERFA routines gc2gd and gd2gc are used. See https://github.com/liberfa/erfa
Attributes Summary
| ellipsoid | The default ellipsoid used to convert to geodetic coordinates. | 
| geocentric | Convert to a tuple with X, Y, and Z as quantities | 
| geodetic | Convert to geodetic coordinates for the default ellipsoid. | 
| height | Height of the location, for the default ellipsoid. | 
| latitude | Latitude of the location, for the default ellipsoid. | 
| longitude | Longitude of the location, for the default ellipsoid. | 
| x | The X component of the geocentric coordinates. | 
| y | The Y component of the geocentric coordinates. | 
| z | The Z component of the geocentric coordinates. | 
Methods Summary
| from_geocentric(x, y, z[, unit]) | Location on Earth, initialized from geocentric coordinates. | 
| from_geodetic(lon, lat[, height, ellipsoid]) | Location on Earth, initialized from geodetic coordinates. | 
| to(unit[, equivalencies]) | Returns a new Quantity object with the specified units. | 
| to_geocentric() | Convert to a tuple with X, Y, and Z as quantities | 
| to_geodetic([ellipsoid]) | Convert to geodetic coordinates. | 
Attributes Documentation
The default ellipsoid used to convert to geodetic coordinates.
Convert to a tuple with X, Y, and Z as quantities
Convert to geodetic coordinates for the default ellipsoid.
Height of the location, for the default ellipsoid.
Latitude of the location, for the default ellipsoid.
Longitude of the location, for the default ellipsoid.
The X component of the geocentric coordinates.
The Y component of the geocentric coordinates.
The Z component of the geocentric coordinates.
Methods Documentation
Location on Earth, initialized from geocentric coordinates.
| Parameters: | x, y, z : Quantity or array-like 
 unit : UnitBase object or None 
 | 
|---|---|
| Raises: | astropy.units.UnitsError 
 ValueError 
 TypeError 
 | 
Location on Earth, initialized from geodetic coordinates.
| Parameters: | lon : Longitude or float 
 lat : Latitude or float 
 height : Quantity or float, optional 
 ellipsoid : str, optional 
 | 
|---|---|
| Raises: | astropy.units.UnitsError 
 ValueError 
 | 
Notes
For the conversion to geocentric coordinates, the ERFA routine gd2gc is used. See https://github.com/liberfa/erfa
Returns a new Quantity object with the specified units.
| Parameters: | unit : UnitBase instance, str equivalencies : list of equivalence pairs, optional 
 | 
|---|
Convert to a tuple with X, Y, and Z as quantities
Convert to geodetic coordinates.
| Parameters: | ellipsoid : str, optional 
 | 
|---|---|
| Returns: | (lon, lat, height) : tuple | 
| Raises: | ValueError 
 | 
Notes
For the conversion to geodetic coordinates, the ERFA routine gc2gd is used. See https://github.com/liberfa/erfa