Пример #1
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
Пример #2
0
    def init_user_interface(self):
        self.cont = conts(self)
        self.ephem = eph(self)
        self.a = sw(self)
        self.b = mw(self)
        self.imag = imag_menu(self)
        self.cam = Camera()
        self.CCD_menu = CCD_menu(self)
        # self.cam.ephemerisShooterThread.continuousShooterThread.started.connect(self.ephem_button)
        self.cam.ephemerisShooterThread.signal_temp.connect(
            self.settings_false)
        self.cam.ephemerisShooterThread.continuousShooterThread.finished.connect(
            self.settings_true)
        self.filters_menu = filters(self)
        self.all_settings = all_settings(self)
        # self.init_menu()
        self.init_window_geometry()

        self.cs = ConfigSystem()

        self.info = self.cs.get_site_settings()

        # Connect Camera
        if self.info[0]:
            self.cam.connect()
            self.cam.start_ephemeris_shooter()
Пример #3
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)
Пример #4
0
    def __init__(self, parent=None):
        super(SystemSettingsWindow, self).__init__(parent)
        self.s = parent
        self.cs = ConfigSystem()
        self.console = ConsoleThreadOutput()

        # Creating Widgets
        self.wp = WidgetsPath(self)
        self.button_ok = QtWidgets.QPushButton('Save', self)
        self.button_clear = QtWidgets.QPushButton('Clear', self)
        self.button_cancel = QtWidgets.QPushButton('Cancel', self)

        # Setting Up
        self.button_settings()
        self.setting_up()

        self.filling_fields()
Пример #5
0
    def init_user_interface(self):
        self.cont = conts(self)
        self.ephem = eph(self)
        self.a = sw(self)
        self.b = mw(self)
        self.c = csw(self)
        self.cam = Camera()
        self.init_menu()
        self.init_window_geometry()

        self.cs = ConfigSystem()

        info = self.cs.get_site_settings()

        # Connect Camera
        if info[0] == True:
            self.cam.connect()
            self.cam.start_ephemeris_shooter()
Пример #6
0
    def init_user_interface(self):
        self.cont = conts(self)
        self.ephem = eph(self)
        self.a = sw(self)
        self.b = mw(self)
        self.imag = imag_menu(self)
        self.CCD_menu = CCD_menu(self)
        self.cam = Camera()
        self.filters_menu = filters(self)
        self.all_settings = all_settings(self)
        self.init_menu()
        self.init_window_geometry()

        self.cs = ConfigSystem()

        self.info = self.cs.get_site_settings()

        # Connect Camera
        if self.info[0]:
            self.cam.connect()
            self.cam.start_ephemeris_shooter()
Пример #7
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