Skip to content

Commit

Permalink
start on chiller control stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
weatherhead99 committed Nov 21, 2023
1 parent 5e29202 commit 24b7655
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions python/lsst/ts/observatory/control/auxtel/atcalsys.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ class ATCalsys(BaseCalsys, HardcodeCalsysThroughput):
CHANGE_GRATING_TIME: Quantity[un.physical.time] = 60 << un.s

# these below numbers should be able to be loaded from a (fairly static) config!
GRATING_CHANGEOVER_WL: Quantity[un.physical.length] = (
532.0 << un.nm
) # WARNING: PLACEHOLDER VALUE!!!
GRATING_CHANGEOVER_WL: Quantity[un.physical.length] = 532.0 << un.nm
GRATING_CHANGEOVER_BW: Quantity[un.physical.length] = 55.0 << un.nm # WARNING! PLACEHOLDER VALUE!!!

CHILLER_COOLDOWN_TIMEOUT: Quantity[un.physical.time] = (60 * 15 ) << un.s
CHILLER_SETPOINT_TEMP: Quantity[un.physical.temperature] = 20 << un.C

def __init__(self, **kwargs):
super().__init__(self._AT_SAL_COMPONENTS, **kwargs)
self._specsposure_time: Optional[float] = None
Expand Down Expand Up @@ -74,16 +75,14 @@ async def setup_for_wavelength(
[monoch_fut, elect_fut, elect_fut2], return_when=asyncio.ALL_COMPLETED
)
self.log.debug("all SAL setup commands returned")

specsposure_time = self.spectrograph_exposure_time_for_nelectrons(nelec)

return

def calculate_slit_width(self, spectral_res: float, grating) -> ATSpectrographSlits:
# NOTE: this will either need to be derived by doing calculations on the Grating equation, or by loading in calibration data (which I couldn't find yet!)
pass

def calculate_grating_type(self, wavelen: float, spectral_res: float):
def calculate_grating_type(self, wavelen: float, spectral_res: float) -> ATMonochromator.Grating:
# TODO: placeholder logic, in particular the exact numbers will be WRONG!
# likely something like the below
if spectral_res > self.GRATING_CHANGEOVER_BW:
Expand Down Expand Up @@ -126,18 +125,19 @@ async def turn_on_light(self, lamp_power: Quantity["power"]) -> None:
#turn on lamp and let it warm up
await self._sal_cmd_helper("ATWhiteLight", "turnLampOn", power=power_watts)





async def wait_ready(self) -> None:
#in the case of auxtel, need to wait for lamp to have warmed up
#check that lamp state
lamp_state = await self._sal_readvalue_helper("ATWhiteLight", "lampState")
if lamp_state == ATWhiteLiht.LampBasicState.On:
if lamp_state == ATWhiteLight.LampBasicState.On:
return

if lamp_state not in {ATWhiteLight.LampBasicState.Warmup, ATWhiteLight.LampBasicState.TurningOn}:
raise RuntimeError("unexpected lamp state when waiting for readiness!")



async def _chiller_setup(self, turnon: bool=True):
await self._sal_cmd_helper("ATWhiteLight", "setChillerTemperature", temperature =
if turnon:
await self._sal_cmd_helper("ATWhiteLight", "startChiller")

0 comments on commit 24b7655

Please sign in to comment.