Bases: KPFTranslatorFunction
Send the PCU stage to the "kpf" named position.
KTL Keywords Used:
Source code in kpf/ao/SendPCUtoKPF.py
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44 | class SendPCUtoKPF(KPFTranslatorFunction):
'''Send the PCU stage to the "kpf" named position.
KTL Keywords Used:
- `ao.PCSFNAME`
- `ao.PCSFSTST`
'''
@classmethod
def pre_condition(cls, args, logger, cfg):
ao = ktl.cache('ao')
success = ao['PCSFSTST'].waitFor('!= "FAULT"')
if success is not True:
raise FailedPreCondition('PCSFSTST is faulted')
success = ktl.waitfor("($ao.PCSFSTST == INPOS)", timeout=120)
if success is False:
raise FailedPreCondition('PCU is in motion')
success = ktl.waitfor("($ao.PCSFNAME == home)", timeout=120)
if success is False:
raise FailedPreCondition('PCU must be at home before moving to KPF')
@classmethod
def perform(cls, args, logger, cfg):
PCSstagekw = ktl.cache('ao', 'PCSFNAME')
log.info(f"Sending PCU to KPF")
PCSstagekw.write('kpf')
shim_time = cfg.getfloat('times', 'ao_pcu_shim_time', fallback=5)
time.sleep(shim_time)
@classmethod
def post_condition(cls, args, logger, cfg):
PCSstagekw = ktl.cache('ao', 'PCSFSTST')
timeout = cfg.getfloat('times', 'ao_pcu_move_time', fallback=150)
success = PCSstagekw.waitfor("== INPOS", timeout=timeout)
if success is False:
raise FailedToReachDestination(PCSstagekw.read(), 'kpf')
|