SetAFStoNGS

Bases: KPFTranslatorFunction

ACAM should be set to NGS focus. LGS focus will not work for KPF.

KTL Keywords Used:

  • ao.OBASNAME
  • ao.OBASSLEW
  • ao.OBASSTST
Source code in kpf/ao/SetAFStoNGS.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
34
class SetAFStoNGS(KPFTranslatorFunction):
    '''ACAM should be set to NGS focus. LGS focus will not work for KPF.

    KTL Keywords Used:

    - `ao.OBASNAME`
    - `ao.OBASSLEW`
    - `ao.OBASSTST`
    '''
    @classmethod
    def pre_condition(cls, args, logger, cfg):
        pass

    @classmethod
    def perform(cls, args, logger, cfg):
        ao = ktl.cache('ao')
        log.debug(f"Setting AFS to NGS")
        ao['OBASNAME'].write('ngs')
        ao['OBASSLEW'].write('1')

    @classmethod
    def post_condition(cls, args, logger, cfg):
        expr = f'($ao.OBASSTST == INPOS) and ($ao.OBASNAME == ngs)'
        aoamstst_success = ktl.waitfor(expr, timeout=60)
        if not aoamstst_success:
            ao = ktl.cache('ao')
            raise FailedToReachDestination(ao['OBASNAME'].read(), 'ngs')