Bases: astropy.units.quantity.Quantity
Location on the 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). When using the geodetic forms, Longitudes are measured increasing to the east, so west longitudes are negative. 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
This class fits into the coordinates transformation framework in that it encodes a position on the ITRS frame. To get a proper ITRS object from this object, use the itrs property.
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. |
itrs | Generates an ITRS object with the coordinates of this object. |
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