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

GenericRepresentation(*args[, differentials])

Generic representation of a point in a 3D coordinate system.

GenericDifferential(*args, **kwargs)

A base class representing differentials of representations.

Class Inheritance Diagram

digraph inheritance8c4d52470c { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "BaseDifferential" [URL="https://docs.astropy.org/en/stable/api/astropy.coordinates.BaseDifferential.html#astropy.coordinates.BaseDifferential",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A base class representing differentials of representations."]; "BaseRepresentationOrDifferential" -> "BaseDifferential" [arrowsize=0.5,style="setlinewidth(0.5)"]; "BaseRepresentation" [URL="https://docs.astropy.org/en/stable/api/astropy.coordinates.BaseRepresentation.html#astropy.coordinates.BaseRepresentation",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base for representing a point in a 3D coordinate system."]; "BaseRepresentationOrDifferential" -> "BaseRepresentation" [arrowsize=0.5,style="setlinewidth(0.5)"]; "BaseRepresentationOrDifferential" [URL="https://docs.astropy.org/en/stable/api/astropy.coordinates.BaseRepresentationOrDifferential.html#astropy.coordinates.BaseRepresentationOrDifferential",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="3D coordinate representations and differentials."]; "ShapedLikeNDArray" -> "BaseRepresentationOrDifferential" [arrowsize=0.5,style="setlinewidth(0.5)"]; "GenericDifferential" [URL="../api/interpolated_coordinates.utils.generic_representation.GenericDifferential.html#interpolated_coordinates.utils.generic_representation.GenericDifferential",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A base class representing differentials of representations."]; "BaseDifferential" -> "GenericDifferential" [arrowsize=0.5,style="setlinewidth(0.5)"]; "GenericRepresentationOrDifferential" -> "GenericDifferential" [arrowsize=0.5,style="setlinewidth(0.5)"]; "GenericRepresentation" [URL="../api/interpolated_coordinates.utils.generic_representation.GenericRepresentation.html#interpolated_coordinates.utils.generic_representation.GenericRepresentation",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Generic representation of a point in a 3D coordinate system."]; "BaseRepresentation" -> "GenericRepresentation" [arrowsize=0.5,style="setlinewidth(0.5)"]; "GenericRepresentationOrDifferential" -> "GenericRepresentation" [arrowsize=0.5,style="setlinewidth(0.5)"]; "GenericRepresentationOrDifferential" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "BaseRepresentationOrDifferential" -> "GenericRepresentationOrDifferential" [arrowsize=0.5,style="setlinewidth(0.5)"]; "NDArrayShapeMethods" [URL="https://docs.astropy.org/en/stable/api/astropy.utils.shapes.NDArrayShapeMethods.html#astropy.utils.shapes.NDArrayShapeMethods",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin class to provide shape-changing methods."]; "ShapedLikeNDArray" [URL="https://docs.astropy.org/en/stable/api/astropy.utils.shapes.ShapedLikeNDArray.html#astropy.utils.shapes.ShapedLikeNDArray",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin class to provide shape-changing methods."]; "NDArrayShapeMethods" -> "ShapedLikeNDArray" [arrowsize=0.5,style="setlinewidth(0.5)"]; }