Skip to content
Snippets Groups Projects
Commit 62455a7f authored by Jesse Mapel's avatar Jesse Mapel Committed by GitHub
Browse files

Changed old scipy rotation calls to new ones (#399)

* Changed old scipy rotation calls to new ones

* Updated scipy pinning
parent 653b67be
No related branches found
No related tags found
No related merge requests found
...@@ -271,7 +271,7 @@ class LroLrocPds3LabelNaifSpiceDriver(LineScanner, NaifSpice, Pds3Label, Driver) ...@@ -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]
...@@ -507,7 +507,7 @@ class LroLrocIsisLabelNaifSpiceDriver(LineScanner, NaifSpice, IsisLabel, Driver) ...@@ -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]
......
...@@ -32,7 +32,7 @@ class ConstantRotation: ...@@ -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):
...@@ -82,7 +82,7 @@ class ConstantRotation: ...@@ -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):
""" """
...@@ -370,7 +370,7 @@ class TimeDependentRotation: ...@@ -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])
......
...@@ -14,7 +14,7 @@ dependencies: ...@@ -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
...@@ -28,7 +28,7 @@ requirements: ...@@ -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
......
...@@ -512,7 +512,7 @@ ...@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment