Rigid Body
Attributes Summary
Scale of the body ( |
|
Position of the body ( |
|
Rotation of the body ( |
|
NAIF name or ID code for the body ( |
|
NAIF reference frame name for the body ( |
|
NAIF name or ID code for the reference frame origin ( |
|
NAIF reference frame name ( |
|
Aberration correction flag ( |
Methods Summary
Set a new |
|
Set a new |
|
Set a new |
|
Set new position for a given ephemeris time using SPICE |
|
Set new rotation for a given ephemeris time using SPICE |
|
Set both a new position and rotation for a given ephemeris time using SPICE |
- class crt.RigidBody(position=array([0., 0., 0.]), rotation=array([[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]]), scale=1, name=None, frame=None, origin='SSB', ref='J2000', abcorr='NONE')[source]
The
RigidBody
class is the superclass toEntity
as well as allCamera
andLight
classes. It provides methods for adjusting the pose (position and orientation) as well as scale of a body. Additionally, it provides a SPICE interface allowing for NAIF ephemerides to be used to control the pose of a body.- Parameters
position (ArrayLike, optional) – Position of the body
Default:np.zeros(3)
rotation (ArrayLike, optional) – Rotation (orientation) of the body as a 3-by-3 rotation matrix that must obey both \(R^T = R^{-1}\) and \(\det(R)=1\)
Default:np.eye(3)
scale (Union[float, int], optional) – Scale of the body
Default:1
name (Union[str, None], optional) – NAIF name or ID code of body
Default:None
frame (Union[str, None], optional) – NAIF reference frame name of body
Default:None
origin (Union[str, None], optional) – NAIF name or ID code of reference frame origin
Default:"SSB"
ref (Union[str, None], optional) – NAIF reference frame name of reference frame
Default:"J2000"
abcorr (Union[str, None], optional) – Aberration correction flag
Default:"NONE"
- scale
Scale of the body (
float
)This attribute is used by the subclass
Entity
and describes how theEntity
geometry is scaled. It can be modified directly usingset_scale()
.
- position
Position of the body (
numpy.ndarray
of shape(3,)
)This attribute is used by the subclass
Entity
, as well as allCamera
andLight
classes. It describes how the body is translated in space. It can be modified directly using eitherset_position()
orset_pose()
. Alternatively, it can be modified usingspice_position()
which uses predefined SPICE ephemerides to calculate a position for a given ephemeris time.
- rotation
Rotation of the body (
numpy.ndarray
of shape(3,3)
)This attribute is used by the subclasses
Entity
, as well as allCamera
andLight
classes. It describes how the body is translated in space. It can be modified directly using eitherset_rotation()
orset_pose()
. Alternatively, it can be modified usingspice_rotation()
which uses predefined SPICE ephemerides to calculate a rotation for a given ephemeris time.
- name
NAIF name or ID code for the body (
str
)This attribute can be used by the subclasses
Entity
, as well as allCamera
andLight
classes. It is used by the SPICE utility,spiceypy.spkpos()
, as the name for the celestial body whose position will be used as the position of the body. This corresponds to thetarg
argument tospiceypy.spkpos()
. Please refer to the spkpos documentation for more information.
- frame
NAIF reference frame name for the body (
str
)This attribute can be used by the subclasses
Entity
, as well as allCamera
andLight
classes. It is used by the SPICE utility,spiceypy.pxform()
, as the name for the reference frame whose orientation will be used as the rotation of the body. This corresponds to theto
argument tospiceypy.pxform()
. Please refer to the pxform documentation for more information.
- origin
NAIF name or ID code for the reference frame origin (
str
)This attribute can be used by the subclasses
Entity
, as well as allCamera
andLight
classes. It is used by the SPICE utility,spiceypy.spkpos()
, as the name for the celestial body whose position will be used as the origin of the reference frame. This corresponds to theobs
argument tospiceypy.spkpos()
. Please refer to the spkpos documentation for more information.
- ref
NAIF reference frame name (
str
)This attribute can be used by the subclasses
Entity
, as well as allCamera
andLight
classes. It is used by both the SPICE utilities,spiceypy.pxform()
andspiceypy.spkpos()
, as the name for the reference frame against in which positions and rotations will be calculated. This corresponds to theref
argument to bothspiceypy.spkpos()
andspiceypy.pxform()
. Please refer to the spkpos or pxform documentation for more information.
- abcorr
Aberration correction flag (
str
)This attribute is used by by the SPICE utility,
spiceypy.spkpos()
, as an indication of what light time correction should be used. This corresponds to theabcorr
argument tospiceypy.spkpos()
. Please refer to the spkpos documentation for more information.
- set_scale(scale, cpp=True)[source]
Set a new
scale
- Parameters
scale (float) – Scale to be applied
cpp (bool, optional) – Flag for if the underlying C++ body should be updated
Default:True
- set_position(position, cpp=True)[source]
Set a new
position
- Parameters
position (ArrayLike) – Position to be applied (xyz)
cpp (bool, optional) – Flag for if the underlying C++ body should be updated
Default:True
- set_rotation(rotation, cpp=True)[source]
Set a new
rotation
- Parameters
rotation (ArrayLike) – 3 by 3 Rotation matrix that must obey \(R^T = R^{-1}\) and \(\det(R)=1\)
cpp (bool, optional) – Flag for if the underlying C++ body should be updated
Default:True
- set_pose(position, rotation, cpp=True)[source]
Set both a new
position
androtation
- Parameters
position (ArrayLike) – Position to be applied (xyz)
rotation (ArrayLike) – 3 by 3 Rotation matrix that must obey \(R^T = R^{-1}\) and \(\det(R)=1\)
cpp (bool, optional) – Flag for if the underlying C++ body should be updated
Default:True
- spice_position(et, cpp=True)[source]
Set new position for a given ephemeris time using SPICE
This is done using
spiceypy.spkpos()
, where thename
is used as thetarg
argument,ref
is used as theref
argument,abcorr
is used as theabcorr
argument, andorigin
is used as theobs
argument. Please refer to the spkpos documentation for more information.- Parameters
et (float) – Ephemeris time (seconds since the J2000 epoch), also known as Barycentric Dynamical Time
cpp (bool, optional) – Flag for if the underlying C++ body should be updated
Default:True
- spice_rotation(et, cpp=True)[source]
Set new rotation for a given ephemeris time using SPICE
This is done using
spiceypy.pxform()
, where theref
is used as thefrom
argument, andframe
is used as theto
argumnet. Please refer to the pxform documentation for more information.- Parameters
et (float) – Ephemeris time (seconds since the J2000 epoch), also known as Barycentric Dynamical Time
cpp (bool, optional) – Flag for if the underlying C++ body should be updated
Default:True
- spice_pose(et, cpp=True)[source]
Set both a new position and rotation for a given ephemeris time using SPICE
The position is updated using
spiceypy.spkpos()
, where thename
is used as thetarg
argument,ref
is used as theref
argument,abcorr
is used as theabcorr
argument, andorigin
is used as theobs
argument.The rotation is updated using
spiceypy.pxform()
, where theref
is used as thefrom
argument, andframe
is used as theto
argumnet.Please refer to the spkpos or pxform documentation for more information.
- Parameters
et (float) – Ephemeris time (seconds since the J2000 epoch), also known as Barycentric Dynamical Time
cpp (bool, optional) – Flag for if the underlying C++ body should be updated