Exemplo n.º 1
0
def get_project_settings():
    """
    name_geographic_settings[0] = Latitude
    name_geographic_settings[1] = Longitude
    name_geographic_settings[2] = Elevation(m)
    name_geographic_settings[3] = Pressure(mb)
    name_geographic_settings[4] = Temperature(?)

    name_set_moonsun_settings[0] = Solar Elevation
    name_set_moonsun_settings[1] = Ignore Lunar Position
    name_set_moonsun_settings[2] = Lunar Elevation
    name_set_moonsun_settings[3] = Lunar Phase

    name_site_settings[0] = Name
    name_site_settings[1] = Observatory
    name_site_settings[2] = Imager ID
    """

    from src.business.configuration.configProject import ConfigProject
    ci = ConfigProject()

    name_geographic_settings = ci.get_geographic_settings()
    name_set_moonsun_settings = ci.get_moonsun_settings()
    name_site_settings = ci.get_site_settings()

    return name_geographic_settings, name_set_moonsun_settings, name_site_settings
Exemplo n.º 2
0
    def __init__(self):

        super(EphemerisShooter, self).__init__()

        self.ObserverFactory = EphemObserverFactory()
        # self.continuousShooterThread = ContinuousShooterThread(int(info_cam[4]))
        self.continuousShooterThread = ContinuousShooterThread(0)
        self.console = ConsoleThreadOutput()
        self.config = ConfigProject()

        info = self.config.get_geographic_settings()
        info_sun = self.config.get_moonsun_settings()

        self.latitude = info[0]  # '-45.51'
        self.longitude = info[1]  # '-23.12'
        self.elevation = info[2]  # 350

        self.max_solar_elevation = info_sun[0]  # -12
        self.ignore_lunar_position = info_sun[1]
        self.max_lunar_elevation = info_sun[2]  # 8
        self.max_lunar_phase = info_sun[3]  # 1
        self.wait_temperature = False

        self.shootOn = False
        self.controller = True
        self.count = 1
Exemplo n.º 3
0
def set_path():
    tempo = datetime.utcnow().strftime('%Y%m%d_%H%M%S')

    data = tempo[0:4] + "_" + tempo[4:6] + tempo[6:8]

    from src.business.configuration.configSystem import ConfigSystem
    cs = ConfigSystem()
    path = str(cs.get_image_path()) + "/"

    from src.business.configuration.configProject import ConfigProject
    ci = ConfigProject()
    name_observatory = str(ci.get_site_settings())
    name_observatory = Image_Processing.get_observatory(name_observatory)

    if int(tempo[9:11]) > 12:
        path = path + name_observatory + "_" + data + "/"
    else:
        ano = tempo[0:4]
        mes = tempo[4:6]
        dia = tempo[6:8]
        abs_julian_day = jd_to_date(date_to_jd(ano, mes, int(dia)) - 1)

        mes = abs_julian_day[1]
        dia = abs_julian_day[2]
        ano = abs_julian_day[0]

        if 0 < int(dia) < 10:
            dia = "0" + str(dia)
        if 0 < int(mes) < 10:
            mes = "0" + str(mes)

        path = path + name_observatory + "_" + str(ano) + "_" + str(mes) + str(
            dia) + "/"

    return path, tempo
Exemplo n.º 4
0
def result():
    config = ConfigProject()

    info = config.get_geographic_settings()
    infosun = config.get_moonsun_settings()

    max_solar_elevation = float(infosun[0])  # -12
    max_lunar_elevation = float(infosun[2])  # 8
    # max_lunar_phase = infosun[3]

    now_datetime = datetime.datetime.utcnow().replace(hour=12).replace(
        minute=00).replace(second=0)
    obs = ephem.Observer()

    obs.lat = info[0]
    obs.lon = info[1]
    obs.elevation = float(info[2])
    obs.date = ephem.date(now_datetime)

    sun = ephem.Sun()
    sun.compute(obs)
    moon = ephem.Moon()
    moon.compute(obs)
    j = 0
    flag = 0
    for i in range(1, 3000):

        obs.date = ephem.date(now_datetime)
        sun = ephem.Sun()
        sun.compute(obs)

        moon = ephem.Moon()
        moon.compute(obs)
        frac = moon.moon_phase

        ag_s = float(repr(sun.alt))
        s_ag = math.degrees(ag_s)
        ag_m = float(repr(moon.alt))
        m_ag = math.degrees(ag_m)

        if float(s_ag) < max_solar_elevation and float(
                m_ag) < max_lunar_elevation:
            if flag == 0:
                flag = 1
                start = now_datetime
        elif (float(s_ag) > max_solar_elevation
              or float(m_ag) > max_lunar_elevation) and flag == 1:
            flag = 0
            end = now_datetime
            break

        now_datetime += timedelta(minutes=j)

        j += 1

    obs_time = end - start

    return start, end, obs_time
Exemplo n.º 5
0
 def save_settings(self):
     try:
         st = ConfigProject()
         self.save_site(st)
         self.save_geo(st)
         self.save_sun(st)
         st.save_settings()
     except Exception as e:
         print(e)
Exemplo n.º 6
0
    def __init__(self):
        self.config = ConfigProject()
        info = self.config.get_geographic_settings()
        self.latitude = info[0]  #'-45.51'
        self.longitude = info[1]  #'-23.12'
        self.elev = info[2]  #350
        self.shootOn = False

        t = Thread(target=self.check_all)
        t.start()
Exemplo n.º 7
0
    def run(self):
        try:
            tempo = datetime.utcnow().strftime('%Y%m%d_%H%M%S')
            data = tempo[0:4] + "_" + tempo[4:6] + tempo[6:8]

            data_log = datetime.utcnow().strftime('[%Y-%m-%d @ %H:%M:%S UTC]')

            from src.business.configuration.configSystem import ConfigSystem
            log_folder = ConfigSystem()

            if str(log_folder.get_log_path()) == "None":
                if log_folder():
                    name_log_folder = str(log_folder.get_log_path())
                else:
                    name_log_folder = 'Log_folder'
                    os.mkdir(name_log_folder)
            else:
                name_log_folder = str(log_folder.get_log_path())

            from src.business.configuration.configProject import ConfigProject
            ci = ConfigProject()
            name_observatory = str(ci.get_site_settings())
            name_observatory = SbigDriver.get_observatory(name_observatory)

            if int(tempo[9:11]) > 12:
                name_log = name_log_folder + "/LOG_" + name_observatory + "_" + data + '.txt'
                log = open(str(name_log), 'a')
                log.write(str(data_log) + " - " + str(self.text) + "\n")
                log.close()
            else:
                tempo = datetime.utcnow().strftime('%Y%m%d_%H%M%S')
                ano = tempo[0:4]
                mes = tempo[4:6]
                dia = tempo[6:8]
                abs_julian_day = SbigDriver.jd_to_date(
                    SbigDriver.date_to_jd(ano, mes, int(dia)) - 1)

                if 0 < abs_julian_day[2] < 10:
                    name_log = name_log_folder + "/LOG_" + name_observatory + "_" + str(
                        abs_julian_day[0]) + "_" + str(
                            abs_julian_day[1]) + "0" + str(
                                abs_julian_day[2]) + '.txt'
                    log = open(str(name_log), 'a')
                    log.write(str(data_log) + " - " + str(self.text) + "\n")
                    log.close()
                else:
                    name_log = name_log_folder + "/LOG_" + name_observatory + "_" + str(
                        abs_julian_day[0]) + "_" + str(
                            abs_julian_day[1]) + str(
                                abs_julian_day[2]) + '.txt'
                    log = open(str(name_log), 'a')
                    log.write(str(data_log) + " - " + str(self.text) + "\n")
                    log.close()
        except Exception as e:
            print(e)
Exemplo n.º 8
0
 def refresh_all_fields(self):
     try:
         st = ConfigProject()
         infoSite = st.get_site_settings()
         self.site.set_site_info(infoSite[0], infoSite[1], infoSite[2])
         infoGeo = st.get_geographic_settings()
         self.geo.set_geography(infoGeo[0], infoGeo[1], infoGeo[2], infoGeo[3], infoGeo[4])
         infoSun = st.get_moonsun_settings()
         self.sun.set_sun(str(infoSun[0]), infoSun[1], str(infoSun[2]), str(infoSun[3]))
     except Exception as e:
         print(e)
Exemplo n.º 9
0
    def get_info(self):
        # Criando uma instância do ConfigProject
        self.config = ConfigProject()

        # Recebendo as informações
        info = self.config.get_geographic_settings()

        # Atribuindo valor as variáveis de geolocalização
        self.latitude = info[0]  # '-45.51'
        self.longitude = info[1]  # '-23.12'
        self.elevation = info[2]  # 350
Exemplo n.º 10
0
def crop(dark_photo, pre, get_axis_xi, get_axis_xf, get_axis_yi, get_axis_yf,
         ignore_crop, img):
    path, tempo = set_path()

    # path, tempo = "/home/hiyoku/Imagens/images/", time.strftime('%Y%m%d_%H%M%S')

    if not os.path.isdir(path):
        os.makedirs(path)

    from src.business.configuration.configProject import ConfigProject
    ci = ConfigProject()
    site_id_name = str(ci.get_site_settings())

    site_id_name = Image_Processing.get_observatory(site_id_name)

    if dark_photo == 1:
        fn = pre + "-DARK" + "_" + site_id_name + "_" + tempo
        name = path + fn
        tifname = name + '.tif'
        tifname_final = fn + '.tif'
        fitname = name + '.fit'
        fitname_final = fn + '.fit'
    else:
        fn = pre + "_" + site_id_name + "_" + tempo
        name = path + fn
        tifname = name + '.tif'
        tifname_final = fn + '.tif'
        fitname = name + '.fit'
        fitname_final = fn + '.fit'

    try:
        os.unlink(tifname)
    except OSError:
        pass
    '''
    Create a new FITS file using the supplied data/header.
    Crop fit image
    '''
    try:
        if not ignore_crop:
            # x = width
            # y = height
            print("Cropping image.")
            print("Width: xi = " + str(get_axis_xi) + " xf = " +
                  str(get_axis_xf))
            print("Height: yi = " + str(get_axis_yi) + " yf = " +
                  str(get_axis_yf))
            img = img[get_axis_yi:get_axis_yf,
                      get_axis_xi:get_axis_xf]  # cropping image
    except Exception as e:
        print("Not possible cropping image ->" + str(e))

    return path, tifname_final, fitname_final, fitname, tifname, site_id_name, tempo, img
Exemplo n.º 11
0
    def __init__(self, parent=None):
        super(ConfigsInfo, self).__init__(parent)

        # Initing Widgets
        p = cs()
        self.confs = ConfigProject()

        # Init Widget Site Info
        infoSite = self.confs.get_site_settings()
        infoGeo = self.confs.get_geographic_settings()
        # infoGeo[2], infoGeo[3]
        self.site = SiteInfo(infoSite[1], infoSite[2], infoGeo[0], infoGeo[1])

        infoMoon = self.confs.get_moonsun_settings()
        self.moon = EphemInfo(infoMoon[0], infoMoon[2], infoMoon[3])

        self.set_layout()
Exemplo n.º 12
0
def set_path(pre):
    '''
    :param pre:
    :return: gera nome da pasta e consequente do arquivo fit e png.
    '''
    tempo = datetime.utcnow().strftime('%Y%m%d_%H%M%S')

    data = tempo[0:4] + "_" + tempo[4:6] + tempo[6:8]

    from src.business.configuration.configSystem import ConfigSystem
    cs = ConfigSystem()
    path = str(cs.get_image_path()) + "/"

    from src.business.configuration.configProject import ConfigProject
    ci = ConfigProject()
    name_observatory = str(ci.get_site_settings())
    name_observatory = get_observatory(name_observatory)

    if int(tempo[9:11]) > 12:
        path = path + name_observatory + "_" + data + "/"
    else:
        tempo = datetime.utcnow().strftime('%Y%m%d_%H%M%S')
        ano = tempo[0:4]
        mes = tempo[4:6]
        dia = tempo[6:8]
        abs_julian_day = jd_to_date(date_to_jd(ano, mes, int(dia)) - 1)

        if 0 < abs_julian_day[2] < 10:
            path = path + name_observatory + "_" + str(
                abs_julian_day[0]) + "_" + str(abs_julian_day[1]) + "0" + str(
                    abs_julian_day[2]) + "/"
        else:
            path = path + name_observatory + "_" + str(
                abs_julian_day[0]) + "_" + str(abs_julian_day[1]) + str(
                    abs_julian_day[2]) + "/"

    return path, tempo
Exemplo n.º 13
0
    def __init__(self):

        super(EphemerisShooter, self).__init__()
        self.camconfig = SettingsCamera()
        self.camconfig.setup_settings()
        infocam = self.camconfig.get_camera_settings()

        self.ObserverFactory = EphemObserverFactory()
        self.continuousShooterThread = ContinuousShooterThread(int(infocam[4]))
        self.console = ConsoleThreadOutput()
        self.config = ConfigProject()

        info = self.config.get_geographic_settings()

        self.latitude = info[0]  # '-45.51'
        self.longitude = info[1]  # '-23.12'
        self.elevation = info[2]  # 350

        info_sun = self.config.get_moonsun_settings()
        self.max_solar_elevation = float(info_sun[0])  # -12
        self.ignore_lunar_position = info_sun[1]
        self.max_lunar_elevation = float(info_sun[2])  # 8
        self.max_lunar_phase = float(info_sun[3])  # 1

        self.wait_temperature = False

        print(int(infocam[4]))
        try:
            self.s = int(infocam[4])
            self.continuousShooterThread.set_sleep_time(self.s)
        except Exception as e:
            self.s = 5

        self.shootOn = False
        self.controller = True
        self.count = 1
Exemplo n.º 14
0
def result():
    config = ConfigProject()

    info = config.get_geographic_settings()
    infosun = config.get_moonsun_settings()

    max_solar_elevation = float(infosun[0])
    max_lunar_elevation = float(infosun[2])
    max_lunar_phase = float(infosun[3])
    ignorar_lua = infosun[1]

    now_datetime = datetime.datetime.utcnow().replace(hour=12).replace(minute=00).replace(second=0)
    obs = ephem.Observer()

    obs.lat = info[0]
    obs.lon = info[1]
    obs.elevation = float(info[2])
    obs.date = ephem.date(now_datetime)

    sun = ephem.Sun()
    sun.compute(obs)
    moon = ephem.Moon()
    moon.compute(obs)
    j = 0
    flag = 0
    ephem_out = False

    while not ephem_out:

        obs.date = ephem.date(now_datetime)
        sun = ephem.Sun()
        sun.compute(obs)

        moon = ephem.Moon()
        moon.compute(obs)
        frac = float(moon.moon_phase) * 100.0

        ag_s = float(repr(sun.alt))
        s_ag = math.degrees(ag_s)
        ag_m = float(repr(moon.alt))
        m_ag = math.degrees(ag_m)

        if ignorar_lua:
            if (float(s_ag) <= max_solar_elevation) and (flag == 0):
                flag = 1
                start = now_datetime
            if (float(s_ag) > max_solar_elevation) and (flag == 1):
                flag = 0
                end = now_datetime
                ephem_out = True
        else:
            if (frac < max_lunar_phase):

                if (float(s_ag) <= max_solar_elevation) and (float(m_ag) <= max_lunar_elevation) and (flag == 0):
                    flag = 1
                    start = now_datetime
                if (float(s_ag) > max_solar_elevation or float(m_ag) > max_lunar_elevation) and (flag == 1):
                    flag = 0
                    end = now_datetime
                    ephem_out = True
            else:
                if (float(s_ag) <= max_solar_elevation) and (float(m_ag) <= float(5.0)) and (flag == 0):
                    flag = 1
                    start = now_datetime
                if (float(s_ag) > max_solar_elevation or float(m_ag) > float(5.0)) and (flag == 1):
                    flag = 0
                    end = now_datetime
                    ephem_out = True
        now_datetime = datetime.datetime.utcnow().replace(hour=12).replace(minute=00).replace(second=0) + timedelta(
            minutes=j)

        j += 1

    obs_time = end - start

    return start, end, obs_time
Exemplo n.º 15
0
def photoshoot(etime, pre, binning, dark_photo, get_level1, get_level2):
    '''
    :param etime: tempo de exposição
    :param pre: prefixo do nome do arquivo
    :param binning: redução da imagem
    :param dark_photo: shooter fechado = 1 ou aberto = 0
    :param get_level1: limite inferior para auto contraste
    :param get_level2: limite superior para auto contraste
    '''
    # open_driver()
    # open_deviceusb()
    # establishinglink()
    if 0.0 < float(get_level1) < 1.0:
        get_level1 = float(get_level1)
    else:
        get_level1 = 0.1

    if 0.0 < float(get_level2) < 1.0:
        get_level2 = float(get_level2)
    else:
        get_level2 = 0.99

    for ccd in SbigLib.CCD_INFO_REQUEST.CCD_INFO_IMAGING.value, SbigLib.CCD_INFO_REQUEST.CCD_INFO_TRACKING.value:

        cin = SbigStructures.ReadOutInfo
        cout = SbigStructures.GetCCDInfoResults0
        udrv.SBIGUnivDrvCommand.argtypes = [
            c_ushort, POINTER(cin), POINTER(cout)
        ]
        cin = cin(request=ccd)
        cout = cout()
        udrv.SBIGUnivDrvCommand(SbigLib.PAR_COMMAND.CC_GET_CCD_INFO.value,
                                byref(cin), byref(cout))
        # print("Ret: ", ret, "\nFV: ", cout.firmwareVersion, "\nCt:",
        #       cout.cameraType, "\nname", cout.name, "\nReadoutModes: ", cout.readoutModes)

        for i_mode in range(cout.readoutModes):

            # print(cout.readoutInfo[i_mode].mode, cout.readoutInfo[i_mode].width, cout.readoutInfo[i_mode].height,
            #       cout.readoutInfo[i_mode].width, cout.readoutInfo[i_mode].gain, cout.readoutInfo[i_mode].pixel_width,
            #       cout.readoutInfo[i_mode].pixel_height)
            if ccd == SbigLib.CCD_INFO_REQUEST.CCD_INFO_IMAGING.value and i_mode == 0:
                readout_mode = [
                    cout.readoutInfo[i_mode].mode,
                    cout.readoutInfo[i_mode].width,
                    cout.readoutInfo[i_mode].height,
                    cout.readoutInfo[i_mode].width,
                    cout.readoutInfo[i_mode].gain,
                    cout.readoutInfo[i_mode].pixel_width,
                    cout.readoutInfo[i_mode].pixel_height
                ]  # STORE FIRST MODE OF IMAGING CCD FOR EXPOSURE TEST

                # Setting the Gain and Bining with Width and Height

    v_read = 0
    v_h = readout_mode[2]
    v_w = readout_mode[1]
    if binning == 1:
        v_read = 1
        v_h = int(v_h / 2)
        v_w = int(v_w / 2)
    elif binning == 2:
        v_read = 2
        v_h = int(v_h / 3)
        v_w = int(v_w / 3)

    print("Binning = " + str(v_read))
    print("Height = " + str(v_h))
    print("Width = " + str(v_w))

    print("GRAB IMAGE - Start Exposure")
    cin = SbigStructures.StartExposureParams2
    cout = None
    udrv.SBIGUnivDrvCommand.argtypes = [c_ushort, POINTER(cin), POINTER(cout)]

    try:
        if dark_photo == 1:
            cin = cin(
                ccd=SbigLib.CCD_REQUEST.CCD_IMAGING.value,
                exposureTime=etime,
                openShutter=SbigLib.SHUTTER_COMMAND.SC_CLOSE_SHUTTER.value,
                readoutMode=v_read,
                top=0,
                left=0,
                height=v_h,
                width=v_w)
        else:
            cin = cin(
                ccd=SbigLib.CCD_REQUEST.CCD_IMAGING.value,
                exposureTime=etime,
                openShutter=SbigLib.SHUTTER_COMMAND.SC_OPEN_SHUTTER.value,
                readoutMode=v_read,
                top=0,
                left=0,
                height=v_h,
                width=v_w)
    except Exception:
        cin = cin(ccd=SbigLib.CCD_REQUEST.CCD_IMAGING.value,
                  exposureTime=etime,
                  openShutter=SbigLib.SHUTTER_COMMAND.SC_OPEN_SHUTTER.value,
                  readoutMode=v_read,
                  top=0,
                  left=0,
                  height=v_h,
                  width=v_w)

    print("Readout Height: " + str(v_h))
    print("Readout Width: " + str(v_w))
    ret = udrv.SBIGUnivDrvCommand(SbigLib.PAR_COMMAND.CC_START_EXPOSURE2.value,
                                  byref(cin), cout)
    print("Ret: ", ret)

    print("GRAB IMAGE - Query Command Status")

    t0 = time.time()
    status = 2
    while status == 2:
        cin = SbigStructures.QueryCommandStatusParams
        cout = SbigStructures.QueryCommandStatusResults
        udrv.SBIGUnivDrvCommand.argtypes = [
            c_ushort, POINTER(cin), POINTER(cout)
        ]
        cin = cin(command=SbigLib.PAR_COMMAND.CC_START_EXPOSURE2.value)
        cout = cout()
        udrv.SBIGUnivDrvCommand(
            SbigLib.PAR_COMMAND.CC_QUERY_COMMAND_STATUS.value, byref(cin),
            byref(cout))

        status = cout.status
        print("Status: %3.2f sec - %s" % (time.time() - t0, status))
        time.sleep(0.01)

    print("GRAB IMAGE - End Exposure")

    cin = SbigStructures.EndExposureParams
    cout = None
    udrv.SBIGUnivDrvCommand.argtypes = [c_ushort, POINTER(cin), POINTER(cout)]
    cin = cin(ccd=SbigLib.CCD_REQUEST.CCD_IMAGING.value)
    udrv.SBIGUnivDrvCommand(SbigLib.PAR_COMMAND.CC_END_EXPOSURE.value,
                            byref(cin), cout)

    print("GRAB IMAGE - Start Readout")

    cin = SbigStructures.StartReadoutParams
    cout = None
    udrv.SBIGUnivDrvCommand.argtypes = [c_ushort, POINTER(cin), POINTER(cout)]

    cin = cin(command=SbigLib.PAR_COMMAND.CC_START_EXPOSURE2.value,
              readoutMode=v_read,
              top=0,
              left=0,
              height=v_h,
              width=v_w)
    ret = udrv.SBIGUnivDrvCommand(SbigLib.PAR_COMMAND.CC_START_READOUT.value,
                                  byref(cin), cout)
    print("ret: ", ret)
    print(SbigLib.PAR_COMMAND.CC_START_READOUT.value)

    print("GRAB IMAGE - Readout Lines")

    img = np.zeros((v_h, v_w))

    for i_line in range(v_h):
        cin = SbigStructures.ReadoutLineParams
        cout = c_ushort * v_w
        udrv.SBIGUnivDrvCommand.argtypes = [
            c_ushort, POINTER(cin), POINTER(cout)
        ]
        cin = cin(ccd=SbigLib.CCD_REQUEST.CCD_IMAGING.value,
                  readoutMode=v_read,
                  pixelStart=0,
                  pixelLength=v_w)
        cout = cout()
        udrv.SBIGUnivDrvCommand(SbigLib.PAR_COMMAND.CC_READOUT_LINE.value,
                                byref(cin), byref(cout))
        img[i_line] = cout

    path, tempo = set_path(pre)

    # path, tempo = "/home/hiyoku/Imagens/images/", time.strftime('%Y%m%d_%H%M%S')

    if not os.path.isdir(path):
        os.makedirs(path)

    from src.business.configuration.configProject import ConfigProject
    ci = ConfigProject()
    site_id_name = str(ci.get_site_settings())

    site_id_name = get_observatory(site_id_name)

    if dark_photo == 1:
        fn = pre + "-DARK" + "_" + site_id_name + "_" + tempo
        name = path + fn
        fitsname = name + '.fit'
        pngname = name + '.png'
        fitsname_final = fn + '.fit'
        pngname_final = fn + '.png'
    else:
        fn = pre + "_" + site_id_name + "_" + tempo
        name = path + fn
        fitsname = name + '.fit'
        pngname = name + '.png'
        fitsname_final = fn + '.fit'
        pngname_final = fn + '.png'

    try:
        os.unlink(fitsname)
    except OSError:
        pass

    fits.writeto(fitsname, img)
    #src.utils.camera.SbigDriver.site
    print("\nGRAB IMAGE - End Readout\n")

    cin = SbigStructures.EndReadoutParams
    cout = None
    udrv.SBIGUnivDrvCommand.argtypes = [c_ushort, POINTER(cin), POINTER(cout)]
    cin = cin(ccd=SbigLib.CCD_REQUEST.CCD_IMAGING.value)
    ret = udrv.SBIGUnivDrvCommand(SbigLib.PAR_COMMAND.CC_END_READOUT.value,
                                  byref(cin), cout)
    print("ret", ret)

    # cmd(SbigLib.PAR_COMMAND.CC_CLOSE_DEVICE.value, None, None)

    # cmd(SbigLib.PAR_COMMAND.CC_CLOSE_DRIVER.value, None, None)

    print("Call set_header")
    set_header(fitsname)
    print("Call set_png")
    set_png(fitsname, pngname, get_level1, get_level2)

    data, hora = get_date_hour(tempo)
    print("End of process")
    return path, pngname_final, fitsname_final, data, hora