ConfigureForAcquisition

Bases: KPFScript

Script which configures the instrument for Acquisition step.

  • Sets target parameters
  • Sets FIU mode
  • Executes Slew Cal
Parameters:
  • OB (ObservingBlock) –

    A valid observing block (OB).

KTL Keywords Used: - kpfconfig.SIMULCALSOURCE

Functions Called: - kpf.calbench.SetCalSource - kpf.fiu.ConfigureFIU - kpf.scripts.SetTargetInfo

Source code in kpf/scripts/ConfigureForAcquisition.py
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
64
65
class ConfigureForAcquisition(KPFScript):
    '''Script which configures the instrument for Acquisition step.

    - Sets target parameters
    - Sets FIU mode
    - Executes Slew Cal

    Args:
        OB (ObservingBlock): A valid observing block (OB).

    KTL Keywords Used:
    - `kpfconfig.SIMULCALSOURCE`

    Functions Called:
    - `kpf.calbench.SetCalSource`
    - `kpf.fiu.ConfigureFIU`
    - `kpf.scripts.SetTargetInfo`
    '''
    @classmethod
    def pre_condition(cls, args, OB=None):
        pass

    @classmethod
    def perform(cls, args, OB=None):
        if isinstance(OB, dict):
            OB = ObservingBlock(OB)
        log.info('-------------------------')
        log.info(f"Running {cls.__name__}")
        log.info('-------------------------')

        # Set Octagon
        calsource = ktl.cache('kpfconfig', 'SIMULCALSOURCE').read()
        octagon = ktl.cache('kpfcal', 'OCTAGON').read()
        log.debug(f"Current OCTAGON = {octagon}, desired = {calsource}")
        if octagon != calsource:
            log.info(f"Set CalSource/Octagon: {calsource}")
            SetCalSource.execute({'CalSource': calsource, 'wait': False})

        # Set FIU Mode
        ConfigureFIU.execute({'mode': 'Observing', 'wait': False})

        # Set Target Parameters from OB
        SetTargetInfo.execute({}, OB=OB)

    @classmethod
    def post_condition(cls, args, OB=None):
        pass