예제 #1
0
파일: main.py 프로젝트: dobribobri/meteo-
    if int(ns.erase):
        ns.eraserar, ns.erasedat, ns.erasetxt = True, True, True

    if int(ns.savereports):
        ns.tbreport, ns.sfreport, ns.wreport = True, True, True

    lbl = start.strftime(Settings.radiometerPrefix + '_%Y%m%d%H%M%S-') + stop.strftime('%Y%m%d%H%M%S')
    if int(ns.sameday):
        lbl = start.strftime('%Y%m%d-%H%M-') + stop.strftime('%H%M')

    m = Measurement(start=start, stop=stop,
                    erase_rar=ns.eraserar, erase_dat=ns.erasedat, erase_txt=ns.erasetxt,
                    tfparsemode=ns.txtparsermode)
    if ns.recycle:
        m.recycleData(int(ns.recycle))

    # Установка директорий для сохранения графиков и отчётности
    Settings.Plots.refresh(ns.plotroot)
    Settings.Reports.refresh(ns.reportroot)

    d = Drawer()

    savefig_path = None
    if int(ns.saveplots):  # Сохранять графики
        if not os.path.exists(Settings.Plots.PlotRoot):
            os.makedirs(Settings.Plots.PlotRoot)
        if not os.path.exists(Settings.Plots.TbPlotDir):
            os.makedirs(Settings.Plots.TbPlotDir)
        savefig_path = os.path.join(Settings.Plots.TbPlotDir, lbl + '.tb' + '.png')