SetAORotator

Bases: KPFFunction

Set the AO rotator destination

KTL Keywords Used:

  • ao.AODCSSIM
  • ao.AOCOMSIM
  • ao.AODCSSFP
Parameters:
  • dest (float) –

    Angle in degrees for the physical drive angle of the rotator.

Source code in kpf/ao/SetAORotator.py
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
45
46
class SetAORotator(KPFFunction):
    '''Set the AO rotator destination

    KTL Keywords Used:

    - `ao.AODCSSIM`
    - `ao.AOCOMSIM`
    - `ao.AODCSSFP`

    Args:
        dest (float): Angle in degrees for the physical drive angle of the
            rotator.
    '''
    @classmethod
    def pre_condition(cls, args):
        check_input(args, 'dest')

    @classmethod
    def perform(cls, args):
        OBRT = ktl.cache('ao', 'OBRT')
        OBRTMOVE = ktl.cache('ao', 'OBRTMOVE')
        dest = args.get('dest', 0)
        log.debug(f"Setting AO Rotator to {dest:.1f}")
        OBRT.write(dest)
        OBRTMOVE.write('1')

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

    @classmethod
    def add_cmdline_args(cls, parser):
        parser.add_argument('dest', type=float,
                            help="Desired rotator position")
        return super().add_cmdline_args(parser)