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 | An ITRS object with for the location of this object at the default obstime. |
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. |
get_itrs([obstime]) | Generates an ITRS object with the location of this object at the requested obstime. |
get_site_names() | Get list of names of observatories for use with of_site. |
of_site(site_name) | Return an object of this class for a known observatory/site by name. |
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
Generates an ITRS object with the location of this object at the requested obstime.
Parameters: | obstime : Time or None
|
---|---|
Returns: | itrs : ITRS
|
Get list of names of observatories for use with of_site.
Note
When this function is called, it will first attempt to download site information from the astropy data server. If it cannot (i.e., an internet connection is not available), it will fall back on the list included with astropy (which is a limited and dated set of sites). If you think a site should be added, issue a pull request to the astropy-data repository .
Returns: | names : list of str
|
---|
See also
Return an object of this class for a known observatory/site by name.
This is intended as a quick convenience function to get basic site information, not a fully-featured exhaustive registry of observatories and all their properties.
Note
When this function is called, it will attempt to download site information from the astropy data server. If you would like a site to be added, issue a pull request to the astropy-data repository . If a site cannot be found in the registry (i.e., an internet connection is not available), it will fall back on a built-in list, In the future, this bundled list might include a version-controlled list of canonical observatories extracted from the online version, but it currently only contains the Greenwich Royal Observatory as an example case.
Parameters: | site_name : str
|
---|---|
Returns: | site : This class (a EarthLocation or subclass)
|
See also
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