UnitSphericalRepresentation¶
-
class
astropy.coordinates.UnitSphericalRepresentation(lon, lat, copy=True)[source] [edit on github]¶ Bases:
astropy.coordinates.BaseRepresentationRepresentation of points on a unit sphere.
Parameters: lon, lat :
Quantityor strcopy : bool, optional
If True arrays will be copied rather than referenced.
Attributes Summary
attr_classeslatThe latitude of the point(s). lonThe longitude of the point(s). recommended_unitsMethods Summary
cross(other)Cross product of two representations. from_cartesian(cart)Converts 3D rectangular cartesian coordinates to spherical polar coordinates. mean(\*args, \*\*kwargs)Vector mean. norm()Vector norm. represent_as(other_class)sum(\*args, \*\*kwargs)Vector sum. 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'>)])¶
-
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
-
cross(other)[source] [edit on github]¶ Cross product of two representations.
The calculation is done by converting both
selfandothertoCartesianRepresentation, and converting the result back toSphericalRepresentation.Parameters: other : representation
The representation to take the cross product with.
Returns: cross_product :
SphericalRepresentationWith vectors perpendicular to both
selfandother.
-
classmethod
from_cartesian(cart)[source] [edit on github]¶ Converts 3D rectangular cartesian coordinates to spherical polar coordinates.
-
mean(*args, **kwargs)[source] [edit on github]¶ Vector mean.
The representation is converted to cartesian, the means of the x, y, and z components are calculated, and the result is converted to a
SphericalRepresentation.Refer to
meanfor full documentation of the arguments, noting thataxisis the entry in theshapeof the representation, and that theoutargument cannot be used.
-
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, which is always unity for vectors on the unit sphere.
Returns: norm :
QuantityDimensionless ones, with the same shape as the representation.
-
represent_as(other_class)[source] [edit on github]¶
-
sum(*args, **kwargs)[source] [edit on github]¶ Vector sum.
The representation is converted to cartesian, the sums of the x, y, and z components are calculated, and the result is converted to a
SphericalRepresentation.Refer to
sumfor full documentation of the arguments, noting thataxisis the entry in theshapeof the representation, and that theoutargument cannot be used.
-
to_cartesian()[source] [edit on github]¶ Converts spherical polar coordinates to 3D rectangular cartesian coordinates.
-