Loading ale/drivers/lro_drivers.py +2 −2 Original line number Original line Diff line number Diff line Loading @@ -271,7 +271,7 @@ class LroLrocPds3LabelNaifSpiceDriver(LineScanner, NaifSpice, Pds3Label, Driver) position = state[:3] position = state[:3] velocity = state[3:] velocity = state[3:] rotation = frame_chain.compute_rotation(1, lro_bus_id) rotation = frame_chain.compute_rotation(1, lro_bus_id) rotated_velocity = spice.mxv(rotation._rots.as_dcm()[0], velocity) rotated_velocity = spice.mxv(rotation._rots.as_matrix()[0], velocity) return rotated_velocity[0] return rotated_velocity[0] Loading Loading @@ -507,7 +507,7 @@ class LroLrocIsisLabelNaifSpiceDriver(LineScanner, NaifSpice, IsisLabel, Driver) position = state[:3] position = state[:3] velocity = state[3:] velocity = state[3:] rotation = frame_chain.compute_rotation(1, lro_bus_id) rotation = frame_chain.compute_rotation(1, lro_bus_id) rotated_velocity = spice.mxv(rotation._rots.as_dcm()[0], velocity) rotated_velocity = spice.mxv(rotation._rots.as_matrix()[0], velocity) return rotated_velocity[0] return rotated_velocity[0] Loading ale/rotation.py +3 −3 Original line number Original line Diff line number Diff line Loading @@ -32,7 +32,7 @@ class ConstantRotation: -------- -------- scipy.spatial.transform.Rotation.from_dcm scipy.spatial.transform.Rotation.from_dcm """ """ rot = Rotation.from_dcm(mat) rot = Rotation.from_matrix(mat) return ConstantRotation(rot.as_quat(), source, dest) return ConstantRotation(rot.as_quat(), source, dest) def __init__(self, quat, source, dest): def __init__(self, quat, source, dest): Loading Loading @@ -82,7 +82,7 @@ class ConstantRotation: """ """ The rotation matrix representation of the constant rotation The rotation matrix representation of the constant rotation """ """ return self._rot.as_dcm() return self._rot.as_matrix() def inverse(self): def inverse(self): """ """ Loading Loading @@ -370,7 +370,7 @@ class TimeDependentRotation: skew = np.array([[0, -avs[indx, 2], avs[indx, 1]], skew = np.array([[0, -avs[indx, 2], avs[indx, 1]], [avs[indx, 2], 0, -avs[indx, 0]], [avs[indx, 2], 0, -avs[indx, 0]], [-avs[indx, 1], avs[indx, 0], 0]]) [-avs[indx, 1], avs[indx, 0], 0]]) rot_deriv = np.dot(skew, rots[indx].as_dcm().T).T rot_deriv = np.dot(skew, rots[indx].as_matrix().T).T rotated_vel[indx] = rots[indx].apply(vec_vel[indx]) rotated_vel[indx] = rots[indx].apply(vec_vel[indx]) rotated_vel[indx] += np.dot(rot_deriv, vec_pos[indx]) rotated_vel[indx] += np.dot(rot_deriv, vec_pos[indx]) Loading environment.yml +1 −1 Original line number Original line Diff line number Diff line Loading @@ -14,7 +14,7 @@ dependencies: - pytz - pytz - python - python - python-dateutil - python-dateutil - scipy - scipy>=1.4.0 - spiceypy>=2.3.0 - spiceypy>=2.3.0 - pyyaml - pyyaml - networkx - networkx recipe/meta.yaml +1 −1 Original line number Original line Diff line number Diff line Loading @@ -28,7 +28,7 @@ requirements: - python - python - python-dateutil - python-dateutil - pytz - pytz - scipy >=1.2.0 - scipy >=1.4.0 - spiceypy >=2.3.0 - spiceypy >=2.3.0 - pyyaml - pyyaml Loading tests/pytests/test_isis_spice_drivers.py +1 −1 Original line number Original line Diff line number Diff line Loading @@ -512,7 +512,7 @@ # test_cube._body_orientation_table['Rotations'] = [[1.0/np.sqrt(2), 1.0/np.sqrt(2), 0, 0]] # test_cube._body_orientation_table['Rotations'] = [[1.0/np.sqrt(2), 1.0/np.sqrt(2), 0, 0]] # #Overwrite the instrument pointing, which is (0, 1, 2, 3) at this point # #Overwrite the instrument pointing, which is (0, 1, 2, 3) at this point # test_cube._inst_pointing_table["Rotations"] = [[1.0/np.sqrt(2), 0, 1.0/np.sqrt(2), 0]] # test_cube._inst_pointing_table["Rotations"] = [[1.0/np.sqrt(2), 0, 1.0/np.sqrt(2), 0]] # print('inverse body rotation', test_cube._body_j2k2bf_rotation.inv().as_dcm()) # print('inverse body rotation', test_cube._body_j2k2bf_rotation.inv().as_matrix()) # np.testing.assert_almost_equal(test_cube._sensor_orientation, np.asarray([1/2, -1/2, -1/2, -1/2])) # np.testing.assert_almost_equal(test_cube._sensor_orientation, np.asarray([1/2, -1/2, -1/2, -1/2])) # # # def test_body_orientation(test_cube): # def test_body_orientation(test_cube): Loading Loading
ale/drivers/lro_drivers.py +2 −2 Original line number Original line Diff line number Diff line Loading @@ -271,7 +271,7 @@ class LroLrocPds3LabelNaifSpiceDriver(LineScanner, NaifSpice, Pds3Label, Driver) position = state[:3] position = state[:3] velocity = state[3:] velocity = state[3:] rotation = frame_chain.compute_rotation(1, lro_bus_id) rotation = frame_chain.compute_rotation(1, lro_bus_id) rotated_velocity = spice.mxv(rotation._rots.as_dcm()[0], velocity) rotated_velocity = spice.mxv(rotation._rots.as_matrix()[0], velocity) return rotated_velocity[0] return rotated_velocity[0] Loading Loading @@ -507,7 +507,7 @@ class LroLrocIsisLabelNaifSpiceDriver(LineScanner, NaifSpice, IsisLabel, Driver) position = state[:3] position = state[:3] velocity = state[3:] velocity = state[3:] rotation = frame_chain.compute_rotation(1, lro_bus_id) rotation = frame_chain.compute_rotation(1, lro_bus_id) rotated_velocity = spice.mxv(rotation._rots.as_dcm()[0], velocity) rotated_velocity = spice.mxv(rotation._rots.as_matrix()[0], velocity) return rotated_velocity[0] return rotated_velocity[0] Loading
ale/rotation.py +3 −3 Original line number Original line Diff line number Diff line Loading @@ -32,7 +32,7 @@ class ConstantRotation: -------- -------- scipy.spatial.transform.Rotation.from_dcm scipy.spatial.transform.Rotation.from_dcm """ """ rot = Rotation.from_dcm(mat) rot = Rotation.from_matrix(mat) return ConstantRotation(rot.as_quat(), source, dest) return ConstantRotation(rot.as_quat(), source, dest) def __init__(self, quat, source, dest): def __init__(self, quat, source, dest): Loading Loading @@ -82,7 +82,7 @@ class ConstantRotation: """ """ The rotation matrix representation of the constant rotation The rotation matrix representation of the constant rotation """ """ return self._rot.as_dcm() return self._rot.as_matrix() def inverse(self): def inverse(self): """ """ Loading Loading @@ -370,7 +370,7 @@ class TimeDependentRotation: skew = np.array([[0, -avs[indx, 2], avs[indx, 1]], skew = np.array([[0, -avs[indx, 2], avs[indx, 1]], [avs[indx, 2], 0, -avs[indx, 0]], [avs[indx, 2], 0, -avs[indx, 0]], [-avs[indx, 1], avs[indx, 0], 0]]) [-avs[indx, 1], avs[indx, 0], 0]]) rot_deriv = np.dot(skew, rots[indx].as_dcm().T).T rot_deriv = np.dot(skew, rots[indx].as_matrix().T).T rotated_vel[indx] = rots[indx].apply(vec_vel[indx]) rotated_vel[indx] = rots[indx].apply(vec_vel[indx]) rotated_vel[indx] += np.dot(rot_deriv, vec_pos[indx]) rotated_vel[indx] += np.dot(rot_deriv, vec_pos[indx]) Loading
environment.yml +1 −1 Original line number Original line Diff line number Diff line Loading @@ -14,7 +14,7 @@ dependencies: - pytz - pytz - python - python - python-dateutil - python-dateutil - scipy - scipy>=1.4.0 - spiceypy>=2.3.0 - spiceypy>=2.3.0 - pyyaml - pyyaml - networkx - networkx
recipe/meta.yaml +1 −1 Original line number Original line Diff line number Diff line Loading @@ -28,7 +28,7 @@ requirements: - python - python - python-dateutil - python-dateutil - pytz - pytz - scipy >=1.2.0 - scipy >=1.4.0 - spiceypy >=2.3.0 - spiceypy >=2.3.0 - pyyaml - pyyaml Loading
tests/pytests/test_isis_spice_drivers.py +1 −1 Original line number Original line Diff line number Diff line Loading @@ -512,7 +512,7 @@ # test_cube._body_orientation_table['Rotations'] = [[1.0/np.sqrt(2), 1.0/np.sqrt(2), 0, 0]] # test_cube._body_orientation_table['Rotations'] = [[1.0/np.sqrt(2), 1.0/np.sqrt(2), 0, 0]] # #Overwrite the instrument pointing, which is (0, 1, 2, 3) at this point # #Overwrite the instrument pointing, which is (0, 1, 2, 3) at this point # test_cube._inst_pointing_table["Rotations"] = [[1.0/np.sqrt(2), 0, 1.0/np.sqrt(2), 0]] # test_cube._inst_pointing_table["Rotations"] = [[1.0/np.sqrt(2), 0, 1.0/np.sqrt(2), 0]] # print('inverse body rotation', test_cube._body_j2k2bf_rotation.inv().as_dcm()) # print('inverse body rotation', test_cube._body_j2k2bf_rotation.inv().as_matrix()) # np.testing.assert_almost_equal(test_cube._sensor_orientation, np.asarray([1/2, -1/2, -1/2, -1/2])) # np.testing.assert_almost_equal(test_cube._sensor_orientation, np.asarray([1/2, -1/2, -1/2, -1/2])) # # # def test_body_orientation(test_cube): # def test_body_orientation(test_cube): Loading