# $Header: https://oberon.oapd.inaf.it/shins/trunk/shins/src/scripts/templates/tpl/SHARKNIR_lss_cal_Wavelength.py 3952 2022-05-19 08:30:53Z depa $

from shinsapp import SHINSApp
from util.shinsLogger import logger
from util import variables as uvars
from util import exception

from SHARKNIR_gen_base import SHARKNIR_gen_base

class SHARKNIR_lss_cal_Wavelength(SHINSApp):
    @exception.handler_for_run
    def run(self, ins_s=None, det_s=None, tel_s=None, rtc_s=None, **kwargs):
        """
        . setup instrument
        . setup cal unit
        . setup scientific detector
        . take exposure
        """

        logger.info(__name__)
        obsController = self.obsController
        self.status = uvars.EXIT_SUCCESS

        self.gen_base = SHARKNIR_gen_base();        gen_base = self.gen_base
        
        ########################################
        # Setup + image with custom parameters #
        ########################################

        ins_s["CAL_FF_LAMP"] =  "ON"
        
        gen_base.main(ins_s=ins_s, det_s=det_s)
        
        # ############################################
        # # Switching off all lamps + DIT=3600 image #
        # ############################################

        # ins_s = {
        #     "CAL_FF_LAMP":"OFF",
        # }
    
        # gen_base.main(ins_s=ins_s, det_s=det_s)
        
