UnitSphericalRepresentation

class astropy.coordinates.UnitSphericalRepresentation(lon, lat, copy=True)[source] [edit on github]

Bases: astropy.coordinates.BaseRepresentation

Representation of points on a unit sphere.

Parameters:

lon, lat : Quantity or str

The longitude and latitude of the point(s), in angular units. The latitude should be between -90 and 90 degrees, and the longitude will be wrapped to an angle between 0 and 360 degrees. These can also be instances of Angle, Longitude, or Latitude.

copy : bool, optional

If True arrays will be copied rather than referenced.

Attributes Summary

attr_classes
lat The latitude of the point(s).
lon The longitude of the point(s).
recommended_units

Methods 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 self and other to CartesianRepresentation, and converting the result back to SphericalRepresentation.

Parameters:

other : representation

The representation to take the cross product with.

Returns:

cross_product : SphericalRepresentation

With vectors perpendicular to both self and other.

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 mean for full documentation of the arguments, noting that axis is the entry in the shape of the representation, and that the out argument 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 : Quantity

Dimensionless 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 sum for full documentation of the arguments, noting that axis is the entry in the shape of the representation, and that the out argument cannot be used.

to_cartesian()[source] [edit on github]

Converts spherical polar coordinates to 3D rectangular cartesian coordinates.