BaseRepresentationOrDifferential¶
-
class
astropy.coordinates.
BaseRepresentationOrDifferential
(*args, **kwargs)[source] [edit on github]¶ Bases:
astropy.utils.misc.ShapedLikeNDArray
3D coordinate representations and differentials.
Parameters: Attributes Summary
components
A tuple with the in-order names of the coordinate components. shape
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. to_cartesian
()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 thereshape
method.Raises: - AttributeError
If the shape of any of the components cannot be changed without the arrays being copied. For these cases, use the
reshape
method (which copies any arrays that cannot be reshaped in-place).
Methods Documentation
-
classmethod
from_cartesian
(other)[source] [edit on github]¶ Create a representation of this class from a supplied Cartesian one.
Parameters: - other :
CartesianRepresentation
The representation to turn into this class
Returns: - representation : object of this class
A new representation of this class’s type.
- other :
-
classmethod
get_name
()[source] [edit on github]¶ Name of the representation or differential.
In lower case, with any trailing ‘representation’ or ‘differential’ removed. (E.g., ‘spherical’ for
SphericalRepresentation
orSphericalDifferential
.)
-
to_cartesian
()[source] [edit on github]¶ Convert the representation to its Cartesian form.
Note that any differentials get dropped.
Returns: - cartrepr :
CartesianRepresentation
The representation in Cartesian form.
- cartrepr :
-