astropy:docs

PhysicsSphericalRepresentation

class astropy.coordinates.PhysicsSphericalRepresentation(phi, theta, r, copy=True)[source] [edit on github]

Bases: astropy.coordinates.BaseRepresentation

Representation of points in 3D spherical coordinates (using the physics convention of using phi and theta for azimuth and inclination from the pole).

Parameters:

phi, theta : Quantity or str

The azimuth and inclination of the point(s), in angular units. The inclination should be between 0 and 180 degrees, and the azimuth will be wrapped to an angle between 0 and 360 degrees. These can also be instances of Angle. If copy is False, phi will be changed inplace if it is not between 0 and 360 degrees.

r : Quantity

The distance to the point(s). If the distance is a length, it is passed to the Distance class, otherwise it is passed to the Quantity class.

copy : bool, optional

If True arrays will be copied rather than referenced.

Attributes Summary

attr_classes
phi The azimuth of the point(s).
r The distance from the origin to the point(s).
recommended_units
theta The elevation of the point(s).

Methods Summary

from_cartesian(cart) Converts 3D rectangular cartesian coordinates to spherical polar coordinates.
represent_as(other_class)
to_cartesian() Converts spherical polar coordinates to 3D rectangular cartesian coordinates.

Attributes Documentation

attr_classes = OrderedDict([(u'phi', <class 'astropy.coordinates.angles.Angle'>), (u'theta', <class 'astropy.coordinates.angles.Angle'>), (u'r', <class 'astropy.units.quantity.Quantity'>)])
phi

The azimuth of the point(s).

r

The distance from the origin to the point(s).

recommended_units = {u'theta': Unit("deg"), u'phi': Unit("deg")}
theta

The elevation of the point(s).

Methods Documentation

classmethod from_cartesian(cart)[source] [edit on github]

Converts 3D rectangular cartesian coordinates to spherical polar coordinates.

represent_as(other_class)[source] [edit on github]
to_cartesian()[source] [edit on github]

Converts spherical polar coordinates to 3D rectangular cartesian coordinates.