ResetCaHKDetector

Bases: KPFFunction

Resets the Ca HK detector by aborting the exposure

ARGS:

None

Source code in kpf/spectrograph/ResetDetectors.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
class ResetCaHKDetector(KPFFunction):
    '''Resets the Ca HK detector by aborting the exposure

    ARGS:
    =====
    None
    '''
    @classmethod
    def pre_condition(cls, args):
        pass

    @classmethod
    def perform(cls, args):
        expose = ktl.cache('kpf_hk', 'EXPOSE')
        log.warning(f"Resetting/Aborting: kpf_hk.EXPOSE = abort")
        expose.write('abort')
        log.debug('Reset/abort command sent')

    @classmethod
    def post_condition(cls, args):
        expstate = ktl.cache('kpf_hk', 'EXPSTATE')
        timeout = cfg.getfloat('times', 'kpfexpose_reset_time', fallback=10)
        log.warning(f"Waiting for kpf_hk to be Ready")
        success = expstate.waitFor('=="Ready"', timeout=timeout)
        if success is not True:
            raise FailedToReachDestination(expstate.read(), 'Ready')