Bases: KPFTranslatorFunction
Wait for a trigger file in progress to finish being collected.
KTL Keywords Used:
Source code in kpf/guider/WaitForTriggerFile.py
8
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 | class WaitForTriggerFile(KPFTranslatorFunction):
'''Wait for a trigger file in progress to finish being collected.
KTL Keywords Used:
- `kpfguide.LASTTRIGFILE`
'''
@classmethod
def pre_condition(cls, args, logger, cfg):
check_input(args, 'initial_lastfile')
@classmethod
def perform(cls, args, logger, cfg):
initial_lastfile = args.get('initial_lastfile', False)
kpfguide = ktl.cache('kpfguide')
log.debug(f"Waiting for guider trigger file to be written out")
expr = f"$kpfguide.LASTTRIGFILE != '{initial_lastfile}'"
success = ktl.waitFor(expr, timeout=20)
cube_file = kpfguide['LASTTRIGFILE'].read()
log.info(f"New cube file: {cube_file}")
return cube_file
@classmethod
def post_condition(cls, args, logger, cfg):
pass
|