rotation — Python Rotations

The ale.rotation module

New in version 0.1.0:

class ale.rotation.ConstantRotation(quat, source, dest)

A constant rotation between two 3D reference frames.

Attributes

sourceint

The NAIF ID code for the source frame

destint

The NAIF ID code for the destination frame

from_matrix(source, dest)

Create a constant rotation from a directed cosine matrix

Parameters

mat2darray

The rotation matrix

sourceint

The NAIF ID code for the source frame

destint

The NAIF ID code for the destination frame

See Also

scipy.spatial.transform.Rotation.from_dcm

inverse()

Get the inverse rotation, that is the rotation from the destination reference frame to the source reference frame.

property quat

The quaternion that rotates from the source reference frame to the destination reference frame. The quaternion is in scalar last format (x, y, z, w).

rotation_matrix()

The rotation matrix representation of the constant rotation

class ale.rotation.TimeDependentRotation(quats, times, source, dest, av=None)

A time dependent rotation between two 3D reference frames.

Attributes

sourceint

The NAIF ID code for the source frame

destint

The NAIF ID code for the destination frame

apply_at(vec, et)

Apply the rotation to a position at a specific time

from_euler(euler, times, source, dest, degrees=False)

Create a time dependent rotation from a set of Euler angles.

Parameters

sequencestring

The axis sequence that the Euler angles are applied in. I.E. ‘XYZ’ or ‘ZXZ’.

euler2darray

2D numpy array of the euler angle rotations in radians.

timesarray

The time for each rotation in euler. This array must be sorted in ascending order.

sourceint

The NAIF ID code for the source frame

destint

The NAIF ID code for the destination frame

degreesbool

If the angles are in degrees. If false, then degrees are assumed to be in radians. Defaults to False.

See Also

scipy.spatial.transform.Rotation.from_euler

inverse()

Get the inverse rotation, that is the rotation from the destination reference frame to the source reference frame.

property quats

The quaternions that rotates from the source reference frame to the destination reference frame. The quaternions are in scalar last format (x, y, z, w).

reinterpolate(times)

Reinterpolate the rotation at a given set of times.

Parameters

times1darray or float

The new times to interpolate at.

Returns

: TimeDependentRotation

The new rotation at the input times

rotate_velocity_at(pos, vel, et)

Apply the rotation to a velocity at a specific time

See: https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/req/rotation.html#State%20transformations For an explanation of why a separate method is required to rotate velocities.