ShutdownAOforKPF

Bases: KPFFunction

KTL Keywords Used:

  • ``

Functions Called:

  • ``
Source code in kpf/ao/ShutdownAOforKPF.py
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
class ShutdownAOforKPF(KPFFunction):
    '''

    KTL Keywords Used:

    - ``

    Functions Called:

    - ``
    '''
    @classmethod
    def pre_condition(cls, args):
        pass

    @classmethod
    def perform(cls, args):
        log.info('Closing AO Hatch')
        try:
            ControlAOHatch.execute({'destination': 'closed'})
        except Exception as e:
            log.warning(f"Failure controlling AO hatch")
            log.warning(e)
            log.warning(f'SSHing to k1obsao@k1aoserver-new to run modify -s ao aohatchcmd=1')
            ssh_cmds = ["ssh k1obsao@k1aoserver-new 'modify -s ao aohatchcmd=1'",
                        f'echo "Done!"',
                        f'sleep 30']
            ssh_cmd = ' ; '.join(ssh_cmds)
            cmd = ['xterm', '-title', 'CloseAOHatch', '-name', 'CloseAOHatch',
                   '-fn', '10x20', '-bg', 'black', '-fg', 'white',
                   '-e', f'{ssh_cmd}']
            proc = subprocess.Popen(cmd)
        log.info('Turning on AO HEPA Filter System')
        try:
            TurnHepaOn.execute({})
        except Exception as e:
            log.warning(f"Failure controlling AO HEPA Filter System")
            log.warning(e)
            log.warning(f'SSHing to k1obsao@k1aoserver-new to run modify -s ao obhpaon=1')
            ssh_cmds = ["ssh k1obsao@k1aoserver-new 'modify -s ao obhpaon=1'",
                        f'echo "Done!"',
                        f'sleep 30']
            ssh_cmd = ' ; '.join(ssh_cmds)
            cmd = ['xterm', '-title', 'TurnHEPAOn', '-name', 'TurnHEPAOn',
                   '-fn', '10x20', '-bg', 'black', '-fg', 'white',
                   '-e', f'{ssh_cmd}']
            proc = subprocess.Popen(cmd)

    @classmethod
    def post_condition(cls, args):
        pass