BaseRepresentationOrDifferential¶
-
class
astropy.coordinates.BaseRepresentationOrDifferential(*args, **kwargs)[source]¶ Bases:
astropy.utils.misc.ShapedLikeNDArray3D coordinate representations and differentials.
- Parameters
comp1, comp2, comp3 :
Quantityor subclassThe components of the 3D point or differential. The names are the keys and the subclasses the values of the
attr_classesattribute.copy : bool, optional
If
True(default), arrays will be copied rather than referenced.
Attributes Summary
A tuple with the in-order names of the coordinate components.
The shape of the instance and underlying arrays.
Methods Summary
from_cartesian(other)Create a representation of this class from a supplied Cartesian one.
get_name()Name of the representation or differential.
Convert the representation to its Cartesian form.
Attributes Documentation
-
components¶ A tuple with the in-order names of the coordinate components.
-
shape¶ The shape of the instance and underlying arrays.
Like
shape, can be set to a new shape by assigning a tuple. Note that if different instances share some but not all underlying data, setting the shape of one instance can make the other instance unusable. Hence, it is strongly recommended to get new, reshaped instances with thereshapemethod.- Raises
AttributeError
If the shape of any of the components cannot be changed without the arrays being copied. For these cases, use the
reshapemethod (which copies any arrays that cannot be reshaped in-place).
Methods Documentation
-
abstract classmethod
from_cartesian(other)[source]¶ Create a representation of this class from a supplied Cartesian one.
- Parameters
other :
CartesianRepresentationThe representation to turn into this class
- Returns
representation : object of this class
A new representation of this class’s type.
-
classmethod
get_name()[source]¶ Name of the representation or differential.
In lower case, with any trailing ‘representation’ or ‘differential’ removed. (E.g., ‘spherical’ for
SphericalRepresentationorSphericalDifferential.)
-
abstract
to_cartesian()[source]¶ Convert the representation to its Cartesian form.
Note that any differentials get dropped.
- Returns
cartrepr :
CartesianRepresentationThe representation in Cartesian form.