CalculateDAR

Bases: KPFTranslatorFunction

Return the DAR correction in arcseconds between the CRED2 wavelength and the science wavelength.

Calculation from Filippenko 1982 (PASP, 94:715-721, August 1982)

ARGS:

:EL: float Elevation of the telescope.

Source code in kpf/utils/CalculateDAR.py
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
class CalculateDAR(KPFTranslatorFunction):
    '''Return the DAR correction in arcseconds between the CRED2 wavelength
    and the science wavelength.

    Calculation from Filippenko 1982 (PASP, 94:715-721, August 1982)

    ARGS:
    =====
    :EL: `float` Elevation of the telescope.
    '''
    @classmethod
    def pre_condition(cls, args, logger, cfg):
        pass

    @classmethod
    def perform(cls, args, logger, cfg):
        dcs = ktl.cache('dcs1')
        EL = dcs['EL'].read(binary=True)*180/np.pi
        DARarcsec = calculate_DAR_arcsec(EL)
        log.info(f"Calculated DAR for {EL:.1f} EL = {DARarcsec:.3f} arcsec")
        dx, dy = calculate_DAR_pix(DARarcsec)
        log.info(f"Pixel shift is {dx:.1f}, {dy:.1f} = {(dx**2+dy**2)**0.5:.1f}")

    @classmethod
    def post_condition(cls, args, logger, cfg):
        pass