SetSimulCalSource

Bases: KPFFunction

Set the simultaneous calibration source based on the kpfconfig.SIMULCALSOURCE keyword.

Source code in kpf/calbench/SetSimulCalSource.py
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
class SetSimulCalSource(KPFFunction):
    '''Set the simultaneous calibration source based on the
    kpfconfig.SIMULCALSOURCE keyword.
    '''
    @classmethod
    def pre_condition(cls, args):
        pass

    @classmethod
    def perform(cls, args):
        calsource = ktl.cache('kpfconfig', 'SIMULCALSOURCE').read()
        octagon = ktl.cache('kpfcal', 'OCTAGON').read()
        log.debug(f"Current OCTAGON = {octagon}, desired = {calsource}")
        if octagon != calsource:
            log.info(f"Set CalSource/Octagon: {calsource}")
            SetCalSource.execute({'CalSource': calsource, 'wait': False})

    @classmethod
    def post_condition(cls, args):
        pass