TakeFVCContinuous

Bases: KPFFunction

Take exposures with the specified FVC continuously and display to ds9.

Parameters:
  • camera (str) –

    Which FVC camera? Allowed values: SCI, CAHK, EXT, CAL

  • exptime (float) –

    The exposure time in seconds.

KTL Keywords Used:

  • kpffvc.SCIEXPTIME
  • kpffvc.CAHKEXPTIME
  • kpffvc.EXTEXPTIME
  • kpffvc.CALEXPTIME
  • kpfpower.KPFFVC1
  • kpfpower.KPFFVC2
  • kpfpower.KPFFVC3
Source code in kpf/fvc/TakeFVCContinuous.py
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
class TakeFVCContinuous(KPFFunction):
    '''Take exposures with the specified FVC continuously and display to ds9.

    Args:
        camera (str): Which FVC camera? Allowed values: SCI, CAHK, EXT, CAL
        exptime (float): The exposure time in seconds.

    KTL Keywords Used:

    - `kpffvc.SCIEXPTIME`
    - `kpffvc.CAHKEXPTIME`
    - `kpffvc.EXTEXPTIME`
    - `kpffvc.CALEXPTIME`
    - `kpfpower.KPFFVC1`
    - `kpfpower.KPFFVC2`
    - `kpfpower.KPFFVC3`
    '''
    @classmethod
    def pre_condition(cls, args):
        check_input(args, 'camera', allowed_values=['SCI', 'CAHK', 'CAL', 'EXT'])
        # Check if power is on
        camera = args.get('camera')
        camnum = {'SCI': 1, 'CAHK': 2, 'CAL': 3}[camera]
        powerkw = ktl.cache('kpfpower', f"KPFFVC{camnum}")
        if powerkw.read() != 'On':
            raise FailedPreCondition(f"{camera}FVC power is not On")

    @classmethod
    def perform(cls, args):
        camera = args.get('camera')
        exptime = args.get('exptime')
        SetFVCExpTime.execute(args)
        while True:
            TakeFVCExposure.execute({'camera': camera, 'display': True})
            time.sleep(0.5)

    @classmethod
    def post_condition(cls, args):
        pass

    @classmethod
    def add_cmdline_args(cls, parser):
        parser.add_argument('camera', type=str,
                            choices=['SCI', 'CAHK', 'CAL', 'EXT'],
                            help='The FVC camera')
        parser.add_argument('exptime', type=float,
                            help='The exposure time in seconds')
        return super().add_cmdline_args(parser)