SphericalRepresentation¶
-
class
astropy.coordinates.SphericalRepresentation(lon, lat, distance, copy=True)[source] [edit on github]¶ Bases:
astropy.coordinates.BaseRepresentationRepresentation of points in 3D spherical coordinates.
Parameters: lon, lat :
Quantitydistance :
Quantitycopy : bool, optional
If True arrays will be copied rather than referenced.
Attributes Summary
attr_classesdistanceThe distance from the origin to the point(s). latThe latitude of the point(s). lonThe longitude of the point(s). recommended_unitsMethods Summary
from_cartesian(cart)Converts 3D rectangular cartesian coordinates to spherical polar coordinates. norm()Vector norm. represent_as(other_class)to_cartesian()Converts spherical polar coordinates to 3D rectangular cartesian coordinates. Attributes Documentation
-
attr_classes= OrderedDict([(u'lon', <class 'astropy.coordinates.angles.Longitude'>), (u'lat', <class 'astropy.coordinates.angles.Latitude'>), (u'distance', <class 'astropy.units.quantity.Quantity'>)])¶
-
distance¶ The distance from the origin to the point(s).
-
lat¶ The latitude of the point(s).
-
lon¶ The longitude of the point(s).
-
recommended_units= {u'lat': Unit("deg"), u'lon': Unit("deg")}¶
Methods Documentation
-
classmethod
from_cartesian(cart)[source] [edit on github]¶ Converts 3D rectangular cartesian coordinates to spherical polar coordinates.
-
norm()[source] [edit on github]¶ Vector norm.
The norm is the standard Frobenius norm, i.e., the square root of the sum of the squares of all components with non-angular units. For spherical coordinates, this is just the absolute value of the distance.
Returns: norm :
astropy.units.QuantityVector norm, with the same shape as the representation.
-
represent_as(other_class)[source] [edit on github]¶
-
to_cartesian()[source] [edit on github]¶ Converts spherical polar coordinates to 3D rectangular cartesian coordinates.
-