astropy:docs

CartesianPoints

class astropy.coordinates.CartesianPoints[source] [edit on github]

Bases: astropy.units.quantity.Quantity

A cartesian representation of a point in three-dimensional space.

Parameters:

x : Quantity or array-like

The first cartesian coordinate or a single array or Quantity where the first dimension is length-3.

y : Quantity or array-like, optional

The second cartesian coordinate.

z : Quantity or array-like, optional

The third cartesian coordinate.

unit : UnitBase object or None

The physical unit of the coordinate values. If x, y, or z are quantities, they will be converted to this unit.

dtype : dtype, optional

See Quantity. Must be given as a keyword argument.

copy : bool, optional

See Quantity. Must be given as a keyword argument.

Raises:

UnitsError

If the units on x, y, and z do not match or an invalid unit is given.

ValueError

If y and z don’t match x‘s shape or x is not length-3

TypeError

If incompatible array types are passed into x, y, or z

Attributes Summary

x The second cartesian coordinate as a Quantity.
y The second cartesian coordinate as a Quantity.
z The third cartesian coordinate as a Quantity.

Methods Summary

to_spherical() Converts to the spherical representation of this point.

Attributes Documentation

x

The second cartesian coordinate as a Quantity.

y

The second cartesian coordinate as a Quantity.

z

The third cartesian coordinate as a Quantity.

Methods Documentation

to_spherical()[source] [edit on github]

Converts to the spherical representation of this point.

Returns:

r : Quantity

The radial coordinate (in the same units as this CartesianPoints).

lat : Quantity

The spherical coordinates latitude.

lon : Quantity

The spherical coordinates longitude.

Page Contents