v2.2.1add:能够通过光谱bin1空间bin1的定标文件生成光谱bin2空间bin1的定标文件
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,6 +2,7 @@
|
||||
/.idea
|
||||
*.xlsx
|
||||
*.cal
|
||||
testdata
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
|
@ -14,6 +14,7 @@ from osgeo import gdal
|
||||
from scipy.interpolate import interp1d
|
||||
import spectral
|
||||
import time
|
||||
import copy
|
||||
|
||||
from PyQt5.QtWidgets import QMainWindow, QFileDialog, QApplication
|
||||
from PyQt5.QtCore import Qt
|
||||
@ -25,6 +26,7 @@ class EnterWindow(QMainWindow, Ui_MainWindow):
|
||||
self.setupUi(self)
|
||||
|
||||
self.radiance_calibration_object = RadianceCalibration()
|
||||
self.changeBinForCorning_object = ChangeBinForCorning()
|
||||
|
||||
# self.setWindowState(Qt.WindowMaximized) # 初始化时就最大化窗口
|
||||
|
||||
@ -32,6 +34,9 @@ class EnterWindow(QMainWindow, Ui_MainWindow):
|
||||
self.dn_bt.clicked.connect(self.select_dn)
|
||||
self.dark_bt.clicked.connect(self.select_dark)
|
||||
self.out_file_bt.clicked.connect(self.select_out_file)
|
||||
self.calfile_bin1_bt.clicked.connect(self.select_calfile_changebin)
|
||||
self.out_calfile_bt.clicked.connect(self.select_out_file_changebin)
|
||||
|
||||
|
||||
self.operate_bt.clicked.connect(self.operate)
|
||||
self.dark_checkBox.stateChanged.connect(self.disabledDark)
|
||||
@ -41,6 +46,14 @@ class EnterWindow(QMainWindow, Ui_MainWindow):
|
||||
self.tmp_dark_file_path = None # 用于保存当前路径,下次打开就默认在此路径下
|
||||
self.tmp_out_file_path = None # 用于保存当前路径,下次打开就默认在此路径下
|
||||
|
||||
self.spatialbin_comboBox.addItem("1")
|
||||
# self.spatialbin_comboBox.addItem("2")
|
||||
# self.spectral_comboBox.addItem("1")
|
||||
self.spectral_comboBox.addItem("2")
|
||||
|
||||
self.change_bin_operate_bt.clicked.connect(self.operate_changebin)
|
||||
|
||||
|
||||
def select_rad(self):
|
||||
if self.tmp_rad_file_path == None:
|
||||
rad_file_path = QFileDialog.getOpenFileName(self, '选择asd辐亮度文件', os.path.dirname(__file__))[0]
|
||||
@ -93,12 +106,29 @@ class EnterWindow(QMainWindow, Ui_MainWindow):
|
||||
self.radiance_calibration_object.out_file_path = out_file_path
|
||||
self.out_file_le.setText(out_file_path)
|
||||
|
||||
def select_calfile_changebin(self):
|
||||
tmp = QFileDialog.getExistingDirectory(self, 'bin1定标文件夹', os.path.dirname(__file__))
|
||||
|
||||
self.changeBinForCorning_object.calfile_path = tmp
|
||||
self.calfile_bin1_le.setText(tmp)
|
||||
|
||||
def select_out_file_changebin(self):
|
||||
tmp = QFileDialog.getExistingDirectory(self, '选择输出路径', os.path.dirname(__file__))
|
||||
self.changeBinForCorning_object.out_file_path = tmp
|
||||
self.out_calfile_changebin_le.setText(tmp)
|
||||
|
||||
def operate(self):
|
||||
if(self.dark_checkBox.isChecked()):
|
||||
self.radiance_calibration_object.operate()
|
||||
else:
|
||||
self.radiance_calibration_object.operate_without_dark()
|
||||
|
||||
def operate_changebin(self):
|
||||
self.changeBinForCorning_object.spatialbin = int(self.spatialbin_comboBox.currentText())
|
||||
self.changeBinForCorning_object.spectralbin = int(self.spectral_comboBox.currentText())
|
||||
|
||||
self.changeBinForCorning_object.changebin()
|
||||
|
||||
def disabledDark(self, isEnable):
|
||||
self.dark_le.setEnabled(isEnable)
|
||||
self.dark_bt.setEnabled(isEnable)
|
||||
@ -284,6 +314,115 @@ class RadianceCalibration():
|
||||
traceback.print_exc()
|
||||
|
||||
|
||||
class ChangeBinForCorning():
|
||||
def __init__(self):
|
||||
self.calfile_path = None
|
||||
self.out_file_path = None
|
||||
self.spatialbin = None
|
||||
self.spectralbin = None
|
||||
|
||||
def get_hdr_filename(self, file_path):
|
||||
return os.path.splitext(file_path)[0] + ".hdr"
|
||||
|
||||
def get_hdr_filename_with_bip(self, file_path):
|
||||
return os.path.splitext(file_path)[0] + ".bip.hdr"
|
||||
|
||||
def write_img(self, dst_filename, data):
|
||||
format = "ENVI"
|
||||
driver = gdal.GetDriverByName(format)
|
||||
RasterXSize = data.shape[2] # 遥感影像的sample(列数)
|
||||
RasterYSize = data.shape[1] # 遥感影像的line(行数)
|
||||
band = data.shape[0]
|
||||
# driver.Create()函数中RasterXSize代表影像的sample(列数),RasterYSize代表影像的line(行数)
|
||||
dst_ds = driver.Create(dst_filename, RasterXSize, RasterYSize, band, gdal.GDT_Float64,
|
||||
options=["INTERLEAVE=BIP"])
|
||||
for i in range(band):
|
||||
dst_ds.GetRasterBand(i + 1).WriteArray(data[i, :, :]) # gdal的band从1开始,所以dst_ds.GetRasterBand(i+1)
|
||||
dst_ds = None
|
||||
|
||||
def write_fields_to_hdrfile(self, fields, hdr_file):
|
||||
header_tmp = spectral.envi.read_envi_header(hdr_file)
|
||||
|
||||
fields['generated time'] = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())
|
||||
with open(hdr_file, "a", encoding='utf-8') as f:
|
||||
for key in fields.keys():
|
||||
if key in header_tmp or key == "description":
|
||||
continue
|
||||
|
||||
if type(fields[key]) == list:
|
||||
f.write(key + " = {" + ", ".join(fields[key]) + "}\n")
|
||||
else:
|
||||
f.write(key + " = " + fields[key] + "\n")
|
||||
|
||||
def process_hdr(self, hdr_file_path, envi_header_dict):
|
||||
self.write_fields_to_hdrfile(envi_header_dict, self.get_hdr_filename(hdr_file_path))
|
||||
shutil.copyfile(self.get_hdr_filename(hdr_file_path), self.get_hdr_filename_with_bip(hdr_file_path))
|
||||
os.remove(self.get_hdr_filename(hdr_file_path))
|
||||
|
||||
def changebin(self):
|
||||
gain_name_in = os.path.join(self.calfile_path, "gain.bip")
|
||||
offset_name_in = os.path.join(self.calfile_path, "offset.bip")
|
||||
img_proj, img_geotrans, img_data = ImageReaderWriter.read_img(gain_name_in)
|
||||
img_proj1, img_geotrans1, img_dark = ImageReaderWriter.read_img(offset_name_in)
|
||||
|
||||
in_hdr_dict = spectral.envi.read_envi_header(self.get_hdr_filename_with_bip(gain_name_in))
|
||||
|
||||
if in_hdr_dict["spectral binning"] != "1" and in_hdr_dict["sample binning"] != "1":
|
||||
print("输入定标文件不是bin1。")
|
||||
return
|
||||
|
||||
if self.spatialbin == 1 and self.spectralbin == 1:
|
||||
print("Bin1 is not need to convert.")
|
||||
return
|
||||
|
||||
if self.spatialbin == 1 and self.spectralbin == 2:
|
||||
samples = int(in_hdr_dict["samples"])
|
||||
|
||||
if int(in_hdr_dict["bands"]) % 2 == 0:
|
||||
bands = int(int(in_hdr_dict["bands"]) / 2)
|
||||
else:
|
||||
print("Bands is not divisible by 2.")
|
||||
return
|
||||
|
||||
out_hdr_dict = copy.deepcopy(in_hdr_dict)
|
||||
out_hdr_dict["bands"] = str(bands)
|
||||
out_hdr_dict["spectral binning"] = str(2)
|
||||
wave = []
|
||||
|
||||
gain = np.empty((bands, 1, samples))
|
||||
dark = np.empty((bands, 1, samples))
|
||||
for i in range(gain.shape[0]):
|
||||
gain[i, :, :] = (img_data[2 * i, :, :] + img_data[2 * i + 1, :, :]) / 2
|
||||
dark[i, :, :] = (img_dark[2 * i, :, :] + img_dark[2 * i + 1, :, :]) / 2
|
||||
|
||||
tmp = (float(out_hdr_dict["wavelength"][2 * i]) + float(out_hdr_dict["wavelength"][2 * i + 1])) / 2
|
||||
wave.append(str(round(tmp, 3)))
|
||||
out_hdr_dict["wavelength"] = wave
|
||||
|
||||
gain_name = os.path.join(self.out_file_path, "gain.bip")
|
||||
offset_name = os.path.join(self.out_file_path, "offset.bip")
|
||||
self.write_img(gain_name, gain)
|
||||
self.process_hdr(gain_name, out_hdr_dict)
|
||||
self.write_img(offset_name, dark)
|
||||
self.process_hdr(offset_name, out_hdr_dict)
|
||||
|
||||
if self.spatialbin == 2 and self.spectralbin == 2:
|
||||
samples = int(in_hdr_dict["samples"])
|
||||
|
||||
if int(in_hdr_dict["bands"]) % 2 == 0:
|
||||
bands = int(int(in_hdr_dict["bands"]) / 2)
|
||||
else:
|
||||
print("Bands is not divisible by 2.")
|
||||
return
|
||||
# # 空间bin
|
||||
# gain = np.empty((300, 1, 688))
|
||||
# for i in range(gain.shape[2]):
|
||||
# if i <= 683:
|
||||
# gain[:, :, i] = img_data[:, :, i*2] # 丢弃
|
||||
# else:
|
||||
# gain[:, :, i] = img_data[:, :, 683] # 重复
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication(sys.argv)
|
||||
|
||||
|
@ -1,55 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# coding: utf-8
|
||||
|
||||
import os
|
||||
import glob
|
||||
import sys, traceback, re
|
||||
from osgeo import gdal
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
from library.image_reader_writer import ImageReaderWriter
|
||||
import spectral
|
||||
|
||||
|
||||
def write_img(dst_filename, data):
|
||||
format = "ENVI"
|
||||
driver = gdal.GetDriverByName(format)
|
||||
RasterXSize = data.shape[2] # 遥感影像的sample(列数)
|
||||
RasterYSize = data.shape[1] # 遥感影像的line(行数)
|
||||
band = data.shape[0]
|
||||
# driver.Create()函数中RasterXSize代表影像的sample(列数),RasterYSize代表影像的line(行数)
|
||||
dst_ds = driver.Create(dst_filename, RasterXSize, RasterYSize, band, gdal.GDT_Float64,
|
||||
options=["INTERLEAVE=BIP"])
|
||||
for i in range(band):
|
||||
dst_ds.GetRasterBand(i + 1).WriteArray(data[i, :, :]) # gdal的band从1开始,所以dst_ds.GetRasterBand(i+1)
|
||||
dst_ds = None
|
||||
|
||||
|
||||
gainfilepath = r'D:\delete\254_11\offset.bip'
|
||||
gainfilepathhdr = r'D:\delete\254_11\offset.bip.hdr'
|
||||
gainfilepath_out = r'D:\delete\254_11\convert\offset.bip'
|
||||
img_proj, img_geotrans, img_data = ImageReaderWriter.read_img(gainfilepath)
|
||||
|
||||
# # 空间bin
|
||||
# gain = np.empty((300, 1, 688))
|
||||
# for i in range(gain.shape[2]):
|
||||
# if i <= 683:
|
||||
# gain[:, :, i] = img_data[:, :, i*2] # 丢弃
|
||||
# else:
|
||||
# gain[:, :, i] = img_data[:, :, 683] # 重复
|
||||
|
||||
# 光谱bin
|
||||
gain = np.empty((150, 1, 1368))
|
||||
for i in range(gain.shape[0]):
|
||||
gain[i, :, :] = (img_data[2 * i, :, :] + img_data[2 * i + 1, :, :]) / 2
|
||||
|
||||
header_tmp = spectral.envi.read_envi_header(gainfilepathhdr)
|
||||
|
||||
wavetmp = []
|
||||
for i in range(150): # len(header_tmp["wavelength"])
|
||||
x = (float(header_tmp["wavelength"][2 * i]) + float(header_tmp["wavelength"][2 * i + 1])) / 2
|
||||
wavetmp.append(x)
|
||||
|
||||
print("%.4f, " % x, end='')
|
||||
|
||||
write_img(gainfilepath_out, gain)
|
@ -14,12 +14,18 @@ from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
class Ui_MainWindow(object):
|
||||
def setupUi(self, MainWindow):
|
||||
MainWindow.setObjectName("MainWindow")
|
||||
MainWindow.resize(964, 621)
|
||||
MainWindow.resize(1153, 696)
|
||||
self.centralwidget = QtWidgets.QWidget(MainWindow)
|
||||
self.centralwidget.setObjectName("centralwidget")
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.centralwidget)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.frame = QtWidgets.QFrame(self.centralwidget)
|
||||
self.tabWidget = QtWidgets.QTabWidget(self.centralwidget)
|
||||
self.tabWidget.setObjectName("tabWidget")
|
||||
self.tab = QtWidgets.QWidget()
|
||||
self.tab.setObjectName("tab")
|
||||
self.gridLayout_3 = QtWidgets.QGridLayout(self.tab)
|
||||
self.gridLayout_3.setObjectName("gridLayout_3")
|
||||
self.frame = QtWidgets.QFrame(self.tab)
|
||||
self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||
self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.frame.setObjectName("frame")
|
||||
@ -74,6 +80,11 @@ class Ui_MainWindow(object):
|
||||
self.dn_bt.setObjectName("dn_bt")
|
||||
self.gridLayout.addWidget(self.dn_bt, 1, 2, 1, 1)
|
||||
self.dark_checkBox = QtWidgets.QCheckBox(self.frame)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.dark_checkBox.sizePolicy().hasHeightForWidth())
|
||||
self.dark_checkBox.setSizePolicy(sizePolicy)
|
||||
self.dark_checkBox.setChecked(True)
|
||||
self.dark_checkBox.setObjectName("dark_checkBox")
|
||||
self.gridLayout.addWidget(self.dark_checkBox, 2, 0, 1, 1)
|
||||
@ -122,14 +133,100 @@ class Ui_MainWindow(object):
|
||||
self.out_file_bt.setSizePolicy(sizePolicy)
|
||||
self.out_file_bt.setObjectName("out_file_bt")
|
||||
self.gridLayout.addWidget(self.out_file_bt, 3, 2, 1, 1)
|
||||
self.gridLayout_2.addWidget(self.frame, 0, 0, 1, 1)
|
||||
self.operate_bt = QtWidgets.QPushButton(self.centralwidget)
|
||||
self.gridLayout_3.addWidget(self.frame, 0, 0, 1, 1)
|
||||
self.operate_bt = QtWidgets.QPushButton(self.tab)
|
||||
self.operate_bt.setMaximumSize(QtCore.QSize(16777215, 60))
|
||||
self.operate_bt.setObjectName("operate_bt")
|
||||
self.gridLayout_2.addWidget(self.operate_bt, 1, 0, 1, 1)
|
||||
self.gridLayout_3.addWidget(self.operate_bt, 1, 0, 1, 1)
|
||||
self.tabWidget.addTab(self.tab, "")
|
||||
self.tab_2 = QtWidgets.QWidget()
|
||||
self.tab_2.setObjectName("tab_2")
|
||||
self.gridLayout_4 = QtWidgets.QGridLayout(self.tab_2)
|
||||
self.gridLayout_4.setObjectName("gridLayout_4")
|
||||
self.label_2 = QtWidgets.QLabel(self.tab_2)
|
||||
self.label_2.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout_4.addWidget(self.label_2, 0, 0, 1, 1)
|
||||
self.calfile_bin1_le = QtWidgets.QLineEdit(self.tab_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.calfile_bin1_le.sizePolicy().hasHeightForWidth())
|
||||
self.calfile_bin1_le.setSizePolicy(sizePolicy)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(18)
|
||||
self.calfile_bin1_le.setFont(font)
|
||||
self.calfile_bin1_le.setReadOnly(True)
|
||||
self.calfile_bin1_le.setObjectName("calfile_bin1_le")
|
||||
self.gridLayout_4.addWidget(self.calfile_bin1_le, 0, 1, 1, 1)
|
||||
self.calfile_bin1_bt = QtWidgets.QPushButton(self.tab_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.calfile_bin1_bt.sizePolicy().hasHeightForWidth())
|
||||
self.calfile_bin1_bt.setSizePolicy(sizePolicy)
|
||||
self.calfile_bin1_bt.setObjectName("calfile_bin1_bt")
|
||||
self.gridLayout_4.addWidget(self.calfile_bin1_bt, 0, 2, 1, 1)
|
||||
self.label_5 = QtWidgets.QLabel(self.tab_2)
|
||||
self.label_5.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.gridLayout_4.addWidget(self.label_5, 1, 0, 1, 1)
|
||||
self.spatialbin_comboBox = QtWidgets.QComboBox(self.tab_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.spatialbin_comboBox.sizePolicy().hasHeightForWidth())
|
||||
self.spatialbin_comboBox.setSizePolicy(sizePolicy)
|
||||
self.spatialbin_comboBox.setStyleSheet("")
|
||||
self.spatialbin_comboBox.setEditable(False)
|
||||
self.spatialbin_comboBox.setCurrentText("")
|
||||
self.spatialbin_comboBox.setObjectName("spatialbin_comboBox")
|
||||
self.gridLayout_4.addWidget(self.spatialbin_comboBox, 1, 1, 1, 1)
|
||||
self.label_6 = QtWidgets.QLabel(self.tab_2)
|
||||
self.label_6.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.gridLayout_4.addWidget(self.label_6, 2, 0, 1, 1)
|
||||
self.spectral_comboBox = QtWidgets.QComboBox(self.tab_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.spectral_comboBox.sizePolicy().hasHeightForWidth())
|
||||
self.spectral_comboBox.setSizePolicy(sizePolicy)
|
||||
self.spectral_comboBox.setObjectName("spectral_comboBox")
|
||||
self.gridLayout_4.addWidget(self.spectral_comboBox, 2, 1, 1, 1)
|
||||
self.label_7 = QtWidgets.QLabel(self.tab_2)
|
||||
self.label_7.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_7.setObjectName("label_7")
|
||||
self.gridLayout_4.addWidget(self.label_7, 3, 0, 1, 1)
|
||||
self.out_calfile_changebin_le = QtWidgets.QLineEdit(self.tab_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.out_calfile_changebin_le.sizePolicy().hasHeightForWidth())
|
||||
self.out_calfile_changebin_le.setSizePolicy(sizePolicy)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(18)
|
||||
self.out_calfile_changebin_le.setFont(font)
|
||||
self.out_calfile_changebin_le.setReadOnly(True)
|
||||
self.out_calfile_changebin_le.setObjectName("out_calfile_changebin_le")
|
||||
self.gridLayout_4.addWidget(self.out_calfile_changebin_le, 3, 1, 1, 1)
|
||||
self.out_calfile_bt = QtWidgets.QPushButton(self.tab_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.out_calfile_bt.sizePolicy().hasHeightForWidth())
|
||||
self.out_calfile_bt.setSizePolicy(sizePolicy)
|
||||
self.out_calfile_bt.setObjectName("out_calfile_bt")
|
||||
self.gridLayout_4.addWidget(self.out_calfile_bt, 3, 2, 1, 1)
|
||||
self.change_bin_operate_bt = QtWidgets.QPushButton(self.tab_2)
|
||||
self.change_bin_operate_bt.setMaximumSize(QtCore.QSize(16777215, 60))
|
||||
self.change_bin_operate_bt.setObjectName("change_bin_operate_bt")
|
||||
self.gridLayout_4.addWidget(self.change_bin_operate_bt, 4, 0, 1, 3)
|
||||
self.tabWidget.addTab(self.tab_2, "")
|
||||
self.gridLayout_2.addWidget(self.tabWidget, 0, 0, 1, 1)
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
self.menubar = QtWidgets.QMenuBar(MainWindow)
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 964, 26))
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 1153, 23))
|
||||
self.menubar.setObjectName("menubar")
|
||||
MainWindow.setMenuBar(self.menubar)
|
||||
self.statusbar = QtWidgets.QStatusBar(MainWindow)
|
||||
@ -137,12 +234,13 @@ class Ui_MainWindow(object):
|
||||
MainWindow.setStatusBar(self.statusbar)
|
||||
|
||||
self.retranslateUi(MainWindow)
|
||||
self.tabWidget.setCurrentIndex(0)
|
||||
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
||||
|
||||
def retranslateUi(self, MainWindow):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
MainWindow.setWindowTitle(_translate("MainWindow", "Corning Calibration v2.1"))
|
||||
self.label.setText(_translate("MainWindow", "ASD辐亮度"))
|
||||
MainWindow.setWindowTitle(_translate("MainWindow", "Corning Calibration v2.2.1"))
|
||||
self.label.setText(_translate("MainWindow", "能量"))
|
||||
self.rad_bt.setText(_translate("MainWindow", "浏览..."))
|
||||
self.label_3.setText(_translate("MainWindow", "DN"))
|
||||
self.dn_bt.setText(_translate("MainWindow", "浏览..."))
|
||||
@ -151,6 +249,15 @@ class Ui_MainWindow(object):
|
||||
self.label_4.setText(_translate("MainWindow", "输出路径"))
|
||||
self.out_file_bt.setText(_translate("MainWindow", "浏览..."))
|
||||
self.operate_bt.setText(_translate("MainWindow", "执行"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("MainWindow", "rad cal"))
|
||||
self.label_2.setText(_translate("MainWindow", "bin1 cal file"))
|
||||
self.calfile_bin1_bt.setText(_translate("MainWindow", "浏览..."))
|
||||
self.label_5.setText(_translate("MainWindow", "spatial bin"))
|
||||
self.label_6.setText(_translate("MainWindow", "spectral bin"))
|
||||
self.label_7.setText(_translate("MainWindow", "out"))
|
||||
self.out_calfile_bt.setText(_translate("MainWindow", "浏览..."))
|
||||
self.change_bin_operate_bt.setText(_translate("MainWindow", "执行"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("MainWindow", "change bin"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@ -6,205 +6,376 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>964</width>
|
||||
<height>621</height>
|
||||
<width>1153</width>
|
||||
<height>696</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Corning Calibration v2.1</string>
|
||||
<string>Corning Calibration v2.2.1</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>ASD辐亮度</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="rad_le">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="rad_bt">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>浏览...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>DN</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="dn_le">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="dn_bt">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>浏览...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="dark_checkBox">
|
||||
<property name="text">
|
||||
<string>dark_300tc</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="dark_le">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="dark_bt">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>浏览...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>输出路径</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="out_file_le">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QPushButton" name="out_file_bt">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>浏览...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="operate_bt">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>60</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>执行</string>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string>rad cal</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>能量</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="rad_le">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="rad_bt">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>浏览...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>DN</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="dn_le">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="dn_bt">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>浏览...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="dark_checkBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>dark_300tc</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="dark_le">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="dark_bt">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>浏览...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>输出路径</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="out_file_le">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QPushButton" name="out_file_bt">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>浏览...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="operate_bt">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>60</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>执行</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<attribute name="title">
|
||||
<string>change bin</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>bin1 cal file</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="calfile_bin1_le">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="calfile_bin1_bt">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>浏览...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>spatial bin</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="spatialbin_comboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="editable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="currentText">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>spectral bin</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="spectral_comboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>out</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="out_calfile_changebin_le">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QPushButton" name="out_calfile_bt">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>浏览...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="3">
|
||||
<widget class="QPushButton" name="change_bin_operate_bt">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>60</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>执行</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@ -214,8 +385,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>964</width>
|
||||
<height>26</height>
|
||||
<width>1153</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
|
Reference in New Issue
Block a user