SetAORotatorManual

Bases: KPFFunction

AO rotator needs to be in the Manual mode before observing.

KTL Keywords Used:

  • ao.OBRTDSRC
  • ao.OBRTMOVE
Source code in kpf/ao/SetAORotatorManual.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
class SetAORotatorManual(KPFFunction):
    '''AO rotator needs to be in the Manual mode before observing.

    KTL Keywords Used: 

    - `ao.OBRTDSRC`
    - `ao.OBRTMOVE`
    '''
    @classmethod
    def pre_condition(cls, args):
        pass

    @classmethod
    def perform(cls, args):
        OBRTDSRC = ktl.cache('ao', 'OBRTDSRC')
        OBRTMOVE = ktl.cache('ao', 'OBRTMOVE')
        log.debug("Setting AO rotator to manual mode")
        OBRTDSRC.write('0')
        OBRTMOVE.write('1')

    @classmethod
    def post_condition(cls, args):
        OBRTDSRC = ktl.cache('ao', 'OBRTDSRC')
        if OBRTDSRC.waitfor('== "manual"', timeout=3) is not True:
            raise FailedToReachDestination(OBRTDSRC.read(), 'manual')