Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
isotuela committed Jun 12, 2023
1 parent abb6e46 commit 6ee7a0c
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@
import yaml

from lsst.ts.idl.enums import ATWhiteLight
from lsst.ts.observatory.control.remote_group import Usages


from lsst.ts import salobj


class PowerOnATCalSys(salobj.BaseScript):
"""Powers on the ATCalSys dome flat illuminator
(ATWhiteLight and ATMonochromator)
Expand Down Expand Up @@ -62,7 +61,6 @@ def __init__(self, index, add_remotes: bool = True):
self.timeout_chiller_cool_down = 60 * 10
self.chiller_temp_tolerance_relative = 0.1


@classmethod
def get_schema(cls):
schema_yaml = """
Expand Down Expand Up @@ -138,16 +136,16 @@ async def configure(self, config):

if self.white_light_source is None:
self.white_light_source = salobj.Remote(
domain=self.domain, name="ATWhiteLight",
intended_usage= None if add_remotes else Usages.DryTest,
log =self.log
domain=self.domain,
name="ATWhiteLight",
log=self.log,
)

if self.monochromator is None:
self.monochromator = salobj.Remote(
domain=self.domain, name="ATMonochromator",
intended_usage= None if add_remotes else Usages.DryTest,
log=self.log
domain=self.domain,
name="ATMonochromator",
log=self.log,
)

await asyncio.gather(
Expand Down Expand Up @@ -192,15 +190,18 @@ async def start_chiller(self):
await self.white_light_source.cmd_setChillerTemperature.set_start(
temperature=self.chiller_temperature, timeout=self.cmd_timeout
)
await self.white_light_source.cmd_startChiller.set(timeout=self.timeout_chiller_cool_down)
await self.white_light_source.cmd_startChiller.set(
timeout=self.timeout_chiller_cool_down
)

async def wait_for_chiller_temp_within_tolerance(self):
start_chill_time = time.time()
while time.time() - start_chill_time < self.timeout_chiller_cool_down:
chiller_temps = await self.white_light_source.tel_chillerTemperatures.aget()
tel_chiller_temp = chiller_temps.supplyTemperature
if (
abs(chiller_temps.setTemperature - tel_chiller_temp)/chiller_temps.setTemperature
abs(chiller_temps.setTemperature - tel_chiller_temp)
/ chiller_temps.setTemperature
<= self.chiller_temp_tolerance_relative
):
chill_time = time.time() - start_chill_time
Expand Down

0 comments on commit 6ee7a0c

Please sign in to comment.