interpolated_coordinates.utils.generic_representation
¶
Generic Representations¶
Generic versions of the BaseRepresentation
in astropy
.
These classes assume less about the constituent dimensions than their astropy counterparts. This can be useful for working with phase-spaces that are not real-space positions (or derivates thereof). However, care should be taken when using many of the methods of these generic representations since they inherit from the astropy real-space representation machinery.
You will probably not be instantiating these classes directly, but encountering
them from interpolated_coordinates
classes like
interpolated_coordinates.InterpolatedSkyCoord
. However, one can get and
use the classes, with all the above-noted caveats:
>>> import astropy.units as u
>>> from interpolated_coordinates.utils.generic_representation import \
... GenericCartesianRepresentation
>>> r = GenericCartesianRepresentation(1, 2, 3)
>>> r
<GenericCartesianRepresentation (x, y, z) [dimensionless]
(1., 2., 3.)>
>>> r.x
<Quantity 1.>
The real convenience lies with differentials, which can go to arbitrary order. Recalling that many of the methods will give incorrect results, these classes are primarily useful for consistent and familiar data storage.
>>> from interpolated_coordinates.utils.generic_representation import \
... GenericSpherical2ndDifferential
>>> d2 = GenericSpherical2ndDifferential(1 * u.rad/u.s**2, 2 * u.rad/u.s**2, 3 * u.km/u.s**2)
>>> d2
<GenericSpherical2ndDifferential (d_lon, d_lat, d_distance) in (rad / s2, rad / s2, km / s2)
(1., 2., 3.)>
Reference/API¶
interpolated_coordinates.utils.generic_representation Module¶
Classes¶
|
Generic representation of a point in a 3D coordinate system. |
|
A base class representing differentials of representations. |