Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
gmegh committed Sep 16, 2024
1 parent 62fafc1 commit c0e05ff
Showing 1 changed file with 13 additions and 23 deletions.
36 changes: 13 additions & 23 deletions tests/test_mtaosCscWithSimulators.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,23 +346,19 @@ async def test_stress_below_limit(self):
):
await self._simulateCSCs()
await self._startCsc()
remote = self._getRemote()

dof_aggr = np.zeros(50)
dof_aggr[11] = 1.0

await self.remote.cmd_offsetDOF.set_start(
value=dof_aggr, timeout=STD_TIMEOUT
)
updated_dof = await self.remote.evt_degreeOfFreedom.next(
flush=False, timeout=STD_TIMEOUT
)

await remote.cmd_offsetDOF.set_start(value=dof_aggr, timeout=STD_TIMEOUT)
updated_dof = await self.assert_next_sample(remote.evt_degreeOfFreedom)
# Assert the DOF didn't change
np.testing.assert_array_equal(updated_dof.aggregatedDoF, dof_aggr)

# Check final total stress is smaller or equal than the limit
final_total_stress = await self.assert_next_sample(
self.remote.evt_mirrorStresses
remote.evt_mirrorStresses
)
self.assertEqual(final_total_stress.stressM1M3, self.csc.m1m3_stress_limit)

Expand All @@ -376,8 +372,9 @@ async def test_stress_above_limit_scale(self):
):
await self.assert_next_summary_state(salobj.State.STANDBY)
await self._simulateCSCs()
remote = self._getRemote()

await self.remote.cmd_start.set_start(
await remote.cmd_start.set_start(
configurationOverride="valid_scale.yaml", timeout=STD_TIMEOUT
)

Expand All @@ -389,12 +386,8 @@ async def test_stress_above_limit_scale(self):

dof_aggr = np.zeros(50)
dof_aggr[15] = 100.0
await self.remote.cmd_offsetDOF.set_start(
value=dof_aggr, timeout=STD_TIMEOUT
)
updated_dof = await self.remote.evt_degreeOfFreedom.next(
flush=False, timeout=STD_TIMEOUT
)
await remote.cmd_offsetDOF.set_start(value=dof_aggr, timeout=STD_TIMEOUT)
updated_dof = await self.assert_next_sample(remote.evt_degreeOfFreedom)

self.assertEqual(
updated_dof.aggregatedDoF[15],
Expand All @@ -403,7 +396,7 @@ async def test_stress_above_limit_scale(self):

# Check final total stress is smaller or equal than the limit
final_total_stress = await self.assert_next_sample(
self.remote.evt_mirrorStresses
remote.evt_mirrorStresses
)
self.assertEqual(final_total_stress.stressM1M3, self.csc.m1m3_stress_limit)

Expand All @@ -417,16 +410,13 @@ async def test_stress_above_limit_truncate(self):
):
await self._simulateCSCs()
await self._startCsc()
remote = self._getRemote()

dof_aggr = np.zeros(50)
dof_aggr[10:30] = 10.0

await self.remote.cmd_offsetDOF.set_start(
value=dof_aggr, timeout=STD_TIMEOUT
)
updated_dof = await self.remote.evt_degreeOfFreedom.next(
flush=False, timeout=STD_TIMEOUT
)
await remote.cmd_offsetDOF.set_start(value=dof_aggr, timeout=STD_TIMEOUT)
updated_dof = await self.assert_next_sample(remote.evt_degreeOfFreedom)

# Ensure that higher-order bending modes were set to 0
print(updated_dof.aggregatedDoF)
Expand All @@ -436,7 +426,7 @@ async def test_stress_above_limit_truncate(self):

# Check final total stress is smaller or equal than the limit
final_total_stress = await self.assert_next_sample(
self.remote.evt_mirrorStresses
remote.evt_mirrorStresses
)
self.assertEqual(final_total_stress.stressM1M3, self.csc.m1m3_stress_limit)

Expand Down

0 comments on commit c0e05ff

Please sign in to comment.