Added Surface plots, text windows and plotting of single shots.

This commit is contained in:
Marcel Paffrath 2016-07-07 14:25:37 +02:00
parent 5293bb6ec7
commit 55a589b525
13 changed files with 294 additions and 90 deletions

View File

@ -31,7 +31,11 @@ class gui_control(object):
self.applypixmap = self.mainwindow.style().standardPixmap(QtGui.QStyle.SP_DialogApplyButton)
self.setInitStates()
self.addArrayPlot()
self.addSurfacePlot()
self.addStatPlots()
self.mainUI.progressBar.setVisible(False)
self.printSurveyTextbox()
self.printSeisArrayTextbox()
def setInitStates(self):
self.setPickState(False)
@ -52,7 +56,10 @@ class gui_control(object):
QtCore.QObject.connect(self.mainUI.postprocessing, QtCore.SIGNAL("clicked()"), self.postprocessing)
QtCore.QObject.connect(self.mainUI.fmtomo, QtCore.SIGNAL("clicked()"), self.startFMTOMO)
QtCore.QObject.connect(self.mainUI.vtk_tools, QtCore.SIGNAL("clicked()"), self.startVTKtools)
QtCore.QObject.connect(self.mainUI.comboBox, QtCore.SIGNAL("activated(int)"), self.replotStat)
QtCore.QObject.connect(self.mainUI.comboBox_stats, QtCore.SIGNAL("activated(int)"), self.refreshPickedWidgets)
QtCore.QObject.connect(self.mainUI.shot_left, QtCore.SIGNAL("clicked()"), self.decreaseShotnumber)
QtCore.QObject.connect(self.mainUI.shot_right, QtCore.SIGNAL("clicked()"), self.increaseShotnumber)
QtCore.QObject.connect(self.mainUI.plot_shot, QtCore.SIGNAL("clicked()"), self.plotShot)
def gen_seisarray(self):
disconnect = False
@ -140,6 +147,11 @@ class gui_control(object):
self.seisArrayCanvas = FigureCanvas(self.seisArrayFigure)
self.mainUI.horizontalLayout_tr.addWidget(self.seisArrayCanvas)
def addSurfacePlot(self):
self.surfaceFigure = Figure()
self.surfaceCanvas = FigureCanvas(self.surfaceFigure)
self.mainUI.horizontalLayout_tr.addWidget(self.surfaceCanvas)
def addStatPlots(self):
self.statFigure_left = Figure()
self.statCanvas_left = FigureCanvas(self.statFigure_left)
@ -147,52 +159,136 @@ class gui_control(object):
self.statFigure_right = Figure()
self.statCanvas_right = FigureCanvas(self.statFigure_right)
self.mainUI.horizontalLayout_br.addWidget(self.statCanvas_right)
self.addItems2ComboBox()
self.addItems2StatsComboBox()
def addItems2ComboBox(self):
self.mainUI.comboBox.insertItem(0, 'picked traces')
self.mainUI.comboBox.insertItem(1, 'mean SNR')
self.mainUI.comboBox.insertItem(2, 'median SNR')
self.mainUI.comboBox.insertItem(3, 'mean SPE')
self.mainUI.comboBox.insertItem(4, 'median SPE')
self.mainUI.comboBox.setEnabled(False)
def addItems2StatsComboBox(self):
self.mainUI.comboBox_stats.insertItem(0, 'picked traces')
self.mainUI.comboBox_stats.insertItem(1, 'mean SNR')
self.mainUI.comboBox_stats.insertItem(2, 'median SNR')
self.mainUI.comboBox_stats.insertItem(3, 'mean SPE')
self.mainUI.comboBox_stats.insertItem(4, 'median SPE')
self.enablePickedTools(False)
def addItems2ShotsComboBox(self):
shotnumbers = self.survey.data.keys()
shotnumbers.sort()
for index, shotnumber in enumerate(shotnumbers):
self.mainUI.comboBox_shots.insertItem(index, 'Shot: %s'%shotnumber)
self.mainUI.comboBox_shots.setMaxCount(len(shotnumbers))
def increaseShotnumber(self):
currentIndex = self.mainUI.comboBox_shots.currentIndex()
maxindex = self.mainUI.comboBox_shots.maxCount() - 1
if currentIndex == maxindex:
self.mainUI.comboBox_shots.setCurrentIndex(0)
else:
self.mainUI.comboBox_shots.setCurrentIndex(currentIndex + 1)
def decreaseShotnumber(self):
currentIndex = self.mainUI.comboBox_shots.currentIndex()
maxindex = self.mainUI.comboBox_shots.maxCount() - 1
if currentIndex == 0:
self.mainUI.comboBox_shots.setCurrentIndex(maxindex)
else:
self.mainUI.comboBox_shots.setCurrentIndex(currentIndex - 1)
def plotShot(self):
shotnumber = int(self.mainUI.comboBox_shots.currentText().split()[1])
self.survey.data[shotnumber].matshow()
def addArrayAxes(self):
self.seisArrayAx = self.seisArrayFigure.add_subplot(111)
def addSurfaceAxes(self):
self.surfaceAx = self.surfaceFigure.add_subplot(111, projection = '3d')
def addStatAxes(self):
self.statAx_left = self.statFigure_left.add_subplot(111)
self.statAx_right = self.statFigure_right.add_subplot(111)
def enablePickedTools(self, bool):
self.mainUI.comboBox_stats.setEnabled(bool)
self.mainUI.comboBox_shots.setEnabled(bool)
self.mainUI.shot_left.setEnabled(bool)
self.mainUI.shot_right.setEnabled(bool)
self.mainUI.plot_shot.setEnabled(bool)
if bool == False:
self.mainUI.comboBox_shots.clear()
def replotArray(self):
self.seisArrayFigure.clf()
self.addArrayAxes()
self.plotArray()
self.seisArrayCanvas.draw()
def plotArray(self):
self.seisarray.plotArray2D(self.seisArrayAx, highlight_measured = True)
def replotSurface(self):
self.surfaceFigure.clf()
self.addSurfaceAxes()
self.plotSurface()
self.surfaceCanvas.draw()
def replotStat(self):
def plotArray(self):
self.seisarray.plotArray2D(self.seisArrayAx, highlight_measured = True, plot_topo = True)
def plotSurface(self):
self.seisarray.plotSurface3D(ax = self.surfaceAx, exag = True)
self.seisarray.plotArray3D(ax = self.surfaceAx, legend = False, markersize = 3)
def refreshPickedWidgets(self):
self.statFigure_left.clf()
self.statFigure_right.clf()
self.addStatAxes()
self.plotStat()
self.InitPickedWidgets()
self.statCanvas_left.draw()
self.statCanvas_right.draw()
def plotStat(self):
def InitPickedWidgets(self):
if self.checkPickState():
surveyUtils.plotScatterStats4Receivers(self.survey, self.mainUI.comboBox.currentText(), self.statAx_left)
surveyUtils.plotScatterStats4Shots(self.survey, self.mainUI.comboBox.currentText(), self.statAx_right)
surveyUtils.plotScatterStats4Receivers(self.survey, self.mainUI.comboBox_stats.currentText(), self.statAx_left)
surveyUtils.plotScatterStats4Shots(self.survey, self.mainUI.comboBox_stats.currentText(), self.statAx_right)
self.addItems2ShotsComboBox()
def printSurveyTextbox(self, init = True):
if init == True:
surveytup = (0, 0, 0, 0)
else:
survey = self.survey
nshots = len(survey.getShotlist())
tt = survey.countAllTraces()
pt = survey.countAllPickedTraces()
rate = float(pt) / float(tt) * 100
surveytup = (nshots, tt, pt, rate)
surveyTitle = 'SURVEY:\n'
surveyText = 'Number of Sources: %s\nTotal Traces: %s\nPicked Traces: %s (%4.2f%%)'%surveytup
string = surveyTitle + surveyText
self.mainUI.textBox_survey.setText(string)
def printSeisArrayTextbox(self, init = True):
if init == True:
seistup = (0, 0, 0)
else:
seisarray = self.seisarray
nshots = len(seisarray.getSourceCoordinates())
nrec = len(seisarray.getReceiverCoordinates())
nadd = len(seisarray.getMeasuredTopo())
seistup = (nshots, nrec, nadd)
seisArrayTitle = 'SEISARRAY:\n'
seisArrayText = 'Sources: %s\nReceivers: %s\nAdditional Points:%s'%seistup
string = seisArrayTitle + seisArrayText
self.mainUI.textBox_seisarray.setText(string)
def interpolate_receivers(self):
if not self.checkSeisArrayState():
self.printDialogMessage('No Seismic Array defined.')
return
self.seisarray.interpolateAll()
self.replotArray()
self.refreshSeisArrayWidgets()
def refreshSeisArrayWidgets(self):
self.replotArray()
self.replotSurface()
self.printSeisArrayTextbox(init = False)
def getPickParameters(self, ui, Picking_parameters):
if Picking_parameters.exec_():
ncores = int(ui.ncores.value())
@ -316,6 +412,7 @@ class gui_control(object):
QtCore.QObject.connect(self.vtk_tools_ui.pushButton_vgref, QtCore.SIGNAL("clicked()"), self.chooseVgridref)
QtCore.QObject.connect(self.vtk_tools_ui.pushButton_rays, QtCore.SIGNAL("clicked()"), self.chooseRaysIn)
QtCore.QObject.connect(self.vtk_tools_ui.pushButton_raysout, QtCore.SIGNAL("clicked()"), self.chooseRaysOutDir)
QtCore.QObject.connect(self.vtk_tools_ui.pushButton_vtkout, QtCore.SIGNAL("clicked()"), self.newFileVTK)
QtCore.QObject.connect(self.vtk_tools_ui.pushButton_parav, QtCore.SIGNAL("clicked()"), self.openFileParaview)
QtCore.QObject.connect(self.vtk_tools_ui.start_vg, QtCore.SIGNAL("clicked()"), self.startvgvtk)
QtCore.QObject.connect(self.vtk_tools_ui.start_rays, QtCore.SIGNAL("clicked()"), self.startraysvtk)
@ -388,6 +485,9 @@ class gui_control(object):
ui = self.vtk_tools_ui
fmtomoUtils.rays2VTK(ui.lineEdit_rays.text(), ui.lineEdit_raysout.text())
def newFileVTK(self):
self.vtk_tools_ui.lineEdit_vgout.setText(self.saveFile())
def chooseFMTOMOdir(self):
self.fmtomo_parameters_ui.fmtomo_dir.setText(self.browseDir())
@ -405,6 +505,7 @@ class gui_control(object):
self.printDialogMessage('No Survey defined.')
return
self.survey.plotAllPicks()
self.refreshPickedWidgets() # wait until finished
def load_survey(self):
if self.checkSurveyState():
@ -465,12 +566,11 @@ class gui_control(object):
return
if not type(seisarray) == seismicArrayPreparation.SeisArray:
self.printDialogMessage('Wrong input file of type %s, expected %s.'
%(type(survey), seismicArrayPreparation.SeisArray))
%(type(seisarray), seismicArrayPreparation.SeisArray))
return
if disconnect:
self.setConnected2SurveyState(False)
self.seisarray = seisarray
self.replotArray()
self.setSeisArrayState(True)
def save_seisarray(self):
@ -494,6 +594,7 @@ class gui_control(object):
def setSurveyState(self, state):
if state == True:
self.mainUI.survey_active.setPixmap(self.applypixmap)
self.printSurveyTextbox(init = False)
elif state == False:
self.mainUI.survey_active.setPixmap(self.cancelpixmap)
@ -512,8 +613,8 @@ class gui_control(object):
def setPickState(self, state):
if state == True and self.checkSurveyState():
self.mainUI.picked_active.setPixmap(self.applypixmap)
self.replotStat()
self.mainUI.comboBox.setEnabled(True)
self.refreshPickedWidgets()
self.enablePickedTools(True)
self.survey.picked = True
elif state == True and self.checkSurveyState() is False:
self.printDialogMessage('No Survey defined.')
@ -523,13 +624,13 @@ class gui_control(object):
if self.checkSurveyState():
self.statFigure_left.clf()
self.statFigure_right.clf()
self.mainUI.comboBox.setEnabled(False)
self.enablePickedTools(False)
self.survey.picked = False
def setSeisArrayState(self, state):
if state == True:
self.mainUI.seisarray_active.setPixmap(self.applypixmap)
self.replotArray()
self.refreshSeisArrayWidgets()
elif state == False:
self.mainUI.seisarray_active.setPixmap(self.cancelpixmap)
if self.seisArrayFigure is not None:

View File

@ -320,12 +320,12 @@ class Survey(object):
self.setEarllate()
print('\npickAllShots: Finished\n')
self.picked = True
ntraces = self.countAllTraces()
pickedtraces = self.countAllPickedTraces()
print('Picked %s / %s traces (%d %%)\n'
% (pickedtraces, ntraces,
float(pickedtraces) / float(ntraces) * 100.))
self.picked = True
def filterSNR(self):
print('Starting filterSNR...')
@ -572,6 +572,9 @@ class Survey(object):
Counts all picked traces of the survey.
'''
count = 0
if not self.picked:
return count
for shot in self.data.values():
for traceID in shot.getTraceIDlist():
if shot.getPickFlag(traceID) is not 0:

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'asp3d_layout.ui'
#
# Created: Wed Jul 6 11:39:58 2016
# Created: Thu Jul 7 14:25:26 2016
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!
@ -13,7 +13,7 @@ class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.setEnabled(True)
MainWindow.resize(905, 707)
MainWindow.resize(1029, 858)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
@ -27,8 +27,8 @@ class Ui_MainWindow(object):
MainWindow.setWindowIcon(icon)
self.centralwidget = QtGui.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.gridLayout = QtGui.QGridLayout(self.centralwidget)
self.gridLayout.setObjectName("gridLayout")
self.verticalLayout_10 = QtGui.QVBoxLayout(self.centralwidget)
self.verticalLayout_10.setObjectName("verticalLayout_10")
self.formLayout = QtGui.QFormLayout()
self.formLayout.setSizeConstraint(QtGui.QLayout.SetDefaultConstraint)
self.formLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)
@ -110,8 +110,17 @@ class Ui_MainWindow(object):
self.label_6.setObjectName("label_6")
self.horizontalLayout_2.addWidget(self.label_6)
self.verticalLayout.addLayout(self.horizontalLayout_2)
self.textBox_seisarray = QtGui.QTextEdit(self.centralwidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.textBox_seisarray.sizePolicy().hasHeightForWidth())
self.textBox_seisarray.setSizePolicy(sizePolicy)
self.textBox_seisarray.setObjectName("textBox_seisarray")
self.verticalLayout.addWidget(self.textBox_seisarray)
self.verticalLayout_5.addLayout(self.verticalLayout)
self.line = QtGui.QFrame(self.centralwidget)
self.line.setMinimumSize(QtCore.QSize(0, 5))
self.line.setFrameShape(QtGui.QFrame.HLine)
self.line.setFrameShadow(QtGui.QFrame.Sunken)
self.line.setObjectName("line")
@ -183,8 +192,18 @@ class Ui_MainWindow(object):
self.label.setObjectName("label")
self.horizontalLayout.addWidget(self.label)
self.verticalLayout_2.addLayout(self.horizontalLayout)
self.textBox_survey = QtGui.QTextEdit(self.centralwidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.textBox_survey.sizePolicy().hasHeightForWidth())
self.textBox_survey.setSizePolicy(sizePolicy)
self.textBox_survey.setTextInteractionFlags(QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse)
self.textBox_survey.setObjectName("textBox_survey")
self.verticalLayout_2.addWidget(self.textBox_survey)
self.verticalLayout_5.addLayout(self.verticalLayout_2)
self.line_3 = QtGui.QFrame(self.centralwidget)
self.line_3.setMinimumSize(QtCore.QSize(0, 5))
self.line_3.setFrameShape(QtGui.QFrame.HLine)
self.line_3.setFrameShadow(QtGui.QFrame.Sunken)
self.line_3.setObjectName("line_3")
@ -213,6 +232,7 @@ class Ui_MainWindow(object):
self.postprocessing.setObjectName("postprocessing")
self.verticalLayout_3.addWidget(self.postprocessing)
self.line_2 = QtGui.QFrame(self.centralwidget)
self.line_2.setMinimumSize(QtCore.QSize(0, 5))
self.line_2.setFrameShape(QtGui.QFrame.HLine)
self.line_2.setFrameShadow(QtGui.QFrame.Sunken)
self.line_2.setObjectName("line_2")
@ -255,6 +275,12 @@ class Ui_MainWindow(object):
self.vtk_tools = QtGui.QPushButton(self.centralwidget)
self.vtk_tools.setObjectName("vtk_tools")
self.verticalLayout_4.addWidget(self.vtk_tools)
self.progressBar = QtGui.QProgressBar(self.centralwidget)
self.progressBar.setEnabled(True)
self.progressBar.setProperty("value", 0)
self.progressBar.setTextVisible(True)
self.progressBar.setObjectName("progressBar")
self.verticalLayout_4.addWidget(self.progressBar)
self.verticalLayout_3.addLayout(self.verticalLayout_4)
self.verticalLayout_5.addLayout(self.verticalLayout_3)
self.formLayout.setLayout(0, QtGui.QFormLayout.LabelRole, self.verticalLayout_5)
@ -269,18 +295,69 @@ class Ui_MainWindow(object):
self.line_4.setFrameShadow(QtGui.QFrame.Sunken)
self.line_4.setObjectName("line_4")
self.verticalLayout_right.addWidget(self.line_4)
self.comboBox = QtGui.QComboBox(self.centralwidget)
self.comboBox.setEnabled(False)
self.comboBox.setObjectName("comboBox")
self.verticalLayout_right.addWidget(self.comboBox)
self.horizontalLayout_3 = QtGui.QHBoxLayout()
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.verticalLayout_6 = QtGui.QVBoxLayout()
self.verticalLayout_6.setObjectName("verticalLayout_6")
self.label_11 = QtGui.QLabel(self.centralwidget)
self.label_11.setObjectName("label_11")
self.verticalLayout_6.addWidget(self.label_11)
self.comboBox_stats = QtGui.QComboBox(self.centralwidget)
self.comboBox_stats.setEnabled(False)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(3)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.comboBox_stats.sizePolicy().hasHeightForWidth())
self.comboBox_stats.setSizePolicy(sizePolicy)
self.comboBox_stats.setMinimumSize(QtCore.QSize(450, 0))
self.comboBox_stats.setObjectName("comboBox_stats")
self.verticalLayout_6.addWidget(self.comboBox_stats)
self.horizontalLayout_3.addLayout(self.verticalLayout_6)
self.line_5 = QtGui.QFrame(self.centralwidget)
self.line_5.setFrameShape(QtGui.QFrame.VLine)
self.line_5.setFrameShadow(QtGui.QFrame.Sunken)
self.line_5.setObjectName("line_5")
self.horizontalLayout_3.addWidget(self.line_5)
self.verticalLayout_9 = QtGui.QVBoxLayout()
self.verticalLayout_9.setObjectName("verticalLayout_9")
self.label_10 = QtGui.QLabel(self.centralwidget)
self.label_10.setObjectName("label_10")
self.verticalLayout_9.addWidget(self.label_10)
self.horizontalLayout_4 = QtGui.QHBoxLayout()
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.shot_left = QtGui.QPushButton(self.centralwidget)
self.shot_left.setMaximumSize(QtCore.QSize(25, 16777215))
self.shot_left.setObjectName("shot_left")
self.horizontalLayout_4.addWidget(self.shot_left)
self.comboBox_shots = QtGui.QComboBox(self.centralwidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(1)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.comboBox_shots.sizePolicy().hasHeightForWidth())
self.comboBox_shots.setSizePolicy(sizePolicy)
self.comboBox_shots.setMinimumSize(QtCore.QSize(120, 0))
self.comboBox_shots.setMaximumSize(QtCore.QSize(100, 16777215))
self.comboBox_shots.setObjectName("comboBox_shots")
self.horizontalLayout_4.addWidget(self.comboBox_shots)
self.shot_right = QtGui.QPushButton(self.centralwidget)
self.shot_right.setMaximumSize(QtCore.QSize(25, 16777215))
self.shot_right.setObjectName("shot_right")
self.horizontalLayout_4.addWidget(self.shot_right)
self.plot_shot = QtGui.QPushButton(self.centralwidget)
self.plot_shot.setMaximumSize(QtCore.QSize(80, 16777215))
self.plot_shot.setObjectName("plot_shot")
self.horizontalLayout_4.addWidget(self.plot_shot)
self.verticalLayout_9.addLayout(self.horizontalLayout_4)
self.horizontalLayout_3.addLayout(self.verticalLayout_9)
self.verticalLayout_right.addLayout(self.horizontalLayout_3)
self.horizontalLayout_br = QtGui.QHBoxLayout()
self.horizontalLayout_br.setObjectName("horizontalLayout_br")
self.verticalLayout_right.addLayout(self.horizontalLayout_br)
self.formLayout.setLayout(0, QtGui.QFormLayout.FieldRole, self.verticalLayout_right)
self.gridLayout.addLayout(self.formLayout, 0, 0, 1, 1)
self.verticalLayout_10.addLayout(self.formLayout)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtGui.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 905, 23))
self.menubar.setGeometry(QtCore.QRect(0, 0, 1029, 23))
self.menubar.setObjectName("menubar")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtGui.QStatusBar(MainWindow)
@ -325,4 +402,9 @@ class Ui_MainWindow(object):
self.label_9.setText(QtGui.QApplication.translate("MainWindow", "Visualization", None, QtGui.QApplication.UnicodeUTF8))
self.vtk_tools.setToolTip(QtGui.QApplication.translate("MainWindow", "Set parameters and call Fast Marching Tomography algorithm.", None, QtGui.QApplication.UnicodeUTF8))
self.vtk_tools.setText(QtGui.QApplication.translate("MainWindow", "VTK tools", None, QtGui.QApplication.UnicodeUTF8))
self.label_11.setText(QtGui.QApplication.translate("MainWindow", "Plot Receiver and Shots of the Array colord by:", None, QtGui.QApplication.UnicodeUTF8))
self.label_10.setText(QtGui.QApplication.translate("MainWindow", "Plot a single Shot:", None, QtGui.QApplication.UnicodeUTF8))
self.shot_left.setText(QtGui.QApplication.translate("MainWindow", "<", None, QtGui.QApplication.UnicodeUTF8))
self.shot_right.setText(QtGui.QApplication.translate("MainWindow", ">", None, QtGui.QApplication.UnicodeUTF8))
self.plot_shot.setText(QtGui.QApplication.translate("MainWindow", "Plot", None, QtGui.QApplication.UnicodeUTF8))

View File

@ -763,7 +763,7 @@ def rays2VTK(fnin, fdirout='./vtk_files/', nthPoint=50):
infile.close()
for shotnumber in rays.keys():
fnameout = fdirout + 'rays%03d.vtk' % (shotnumber)
fnameout = os.path.join(fdirout, 'rays%03d.vtk'%(shotnumber))
outfile = open(fnameout, 'w')
nPoints = 0

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'fmtomo_parameters_layout.ui'
#
# Created: Wed Jul 6 11:39:58 2016
# Created: Thu Jul 7 14:25:26 2016
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'generate_seisarray_layout.ui'
#
# Created: Wed Jul 6 11:39:58 2016
# Created: Thu Jul 7 14:25:26 2016
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'generate_survey_layout.ui'
#
# Created: Wed Jul 6 11:39:58 2016
# Created: Thu Jul 7 14:25:26 2016
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'generate_survey_layout_minimal.ui'
#
# Created: Wed Jul 6 11:39:58 2016
# Created: Thu Jul 7 14:25:26 2016
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'picking_parameters_layout.ui'
#
# Created: Wed Jul 6 11:39:58 2016
# Created: Thu Jul 7 14:25:26 2016
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!
@ -12,10 +12,10 @@ from PySide import QtCore, QtGui
class Ui_picking_parameters(object):
def setupUi(self, picking_parameters):
picking_parameters.setObjectName("picking_parameters")
picking_parameters.resize(325, 400)
picking_parameters.setMinimumSize(QtCore.QSize(325, 400))
self.verticalLayout_3 = QtGui.QVBoxLayout(picking_parameters)
self.verticalLayout_3.setObjectName("verticalLayout_3")
picking_parameters.resize(321, 253)
picking_parameters.setMinimumSize(QtCore.QSize(0, 0))
self.gridLayout = QtGui.QGridLayout(picking_parameters)
self.gridLayout.setObjectName("gridLayout")
self.label_7 = QtGui.QLabel(picking_parameters)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
@ -28,7 +28,7 @@ class Ui_picking_parameters(object):
font.setBold(True)
self.label_7.setFont(font)
self.label_7.setObjectName("label_7")
self.verticalLayout_3.addWidget(self.label_7)
self.gridLayout.addWidget(self.label_7, 0, 0, 1, 1)
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.label = QtGui.QLabel(picking_parameters)
@ -45,7 +45,7 @@ class Ui_picking_parameters(object):
self.ncores.setMaximum(10000)
self.ncores.setObjectName("ncores")
self.horizontalLayout.addWidget(self.ncores)
self.verticalLayout_3.addLayout(self.horizontalLayout)
self.gridLayout.addLayout(self.horizontalLayout, 1, 0, 1, 1)
self.horizontalLayout_3 = QtGui.QHBoxLayout()
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.verticalLayout_2 = QtGui.QVBoxLayout()
@ -78,7 +78,7 @@ class Ui_picking_parameters(object):
self.lineEdit_vmax.setObjectName("lineEdit_vmax")
self.verticalLayout.addWidget(self.lineEdit_vmax)
self.horizontalLayout_3.addLayout(self.verticalLayout)
self.verticalLayout_3.addLayout(self.horizontalLayout_3)
self.gridLayout.addLayout(self.horizontalLayout_3, 2, 0, 1, 1)
self.horizontalLayout_4 = QtGui.QHBoxLayout()
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.label_4 = QtGui.QLabel(picking_parameters)
@ -93,7 +93,7 @@ class Ui_picking_parameters(object):
self.lineEdit_folm.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.lineEdit_folm.setObjectName("lineEdit_folm")
self.horizontalLayout_4.addWidget(self.lineEdit_folm)
self.verticalLayout_3.addLayout(self.horizontalLayout_4)
self.gridLayout.addLayout(self.horizontalLayout_4, 3, 0, 1, 1)
self.horizontalLayout_5 = QtGui.QHBoxLayout()
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
self.label_5 = QtGui.QLabel(picking_parameters)
@ -109,7 +109,7 @@ class Ui_picking_parameters(object):
self.checkBox_AIC.setChecked(True)
self.checkBox_AIC.setObjectName("checkBox_AIC")
self.horizontalLayout_5.addWidget(self.checkBox_AIC)
self.verticalLayout_3.addLayout(self.horizontalLayout_5)
self.gridLayout.addLayout(self.horizontalLayout_5, 4, 0, 1, 1)
self.horizontalLayout_6 = QtGui.QHBoxLayout()
self.horizontalLayout_6.setObjectName("horizontalLayout_6")
self.label_6 = QtGui.QLabel(picking_parameters)
@ -131,12 +131,12 @@ class Ui_picking_parameters(object):
self.lineEdit_aicright.setObjectName("lineEdit_aicright")
self.horizontalLayout_7.addWidget(self.lineEdit_aicright)
self.horizontalLayout_6.addLayout(self.horizontalLayout_7)
self.verticalLayout_3.addLayout(self.horizontalLayout_6)
self.gridLayout.addLayout(self.horizontalLayout_6, 5, 0, 1, 1)
self.buttonBox = QtGui.QDialogButtonBox(picking_parameters)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.verticalLayout_3.addWidget(self.buttonBox)
self.gridLayout.addWidget(self.buttonBox, 6, 0, 1, 1)
self.retranslateUi(picking_parameters)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), picking_parameters.accept)
@ -146,15 +146,21 @@ class Ui_picking_parameters(object):
def retranslateUi(self, picking_parameters):
picking_parameters.setWindowTitle(QtGui.QApplication.translate("picking_parameters", "Dialog", None, QtGui.QApplication.UnicodeUTF8))
self.label_7.setText(QtGui.QApplication.translate("picking_parameters", "Choose parameters for FMTOMO simulation", None, QtGui.QApplication.UnicodeUTF8))
self.label.setText(QtGui.QApplication.translate("picking_parameters", "nproc", None, QtGui.QApplication.UnicodeUTF8))
self.label_2.setText(QtGui.QApplication.translate("picking_parameters", "vmin [m/s]", None, QtGui.QApplication.UnicodeUTF8))
self.label.setToolTip(QtGui.QApplication.translate("picking_parameters", "Amount of CPU kernels used.", None, QtGui.QApplication.UnicodeUTF8))
self.label.setText(QtGui.QApplication.translate("picking_parameters", "nproc [?]", None, QtGui.QApplication.UnicodeUTF8))
self.label_2.setToolTip(QtGui.QApplication.translate("picking_parameters", "Minimum permitted direct velocity (apparent velocity!).", None, QtGui.QApplication.UnicodeUTF8))
self.label_2.setText(QtGui.QApplication.translate("picking_parameters", "vmin [m/s] [?]", None, QtGui.QApplication.UnicodeUTF8))
self.lineEdit_vmin.setText(QtGui.QApplication.translate("picking_parameters", "333", None, QtGui.QApplication.UnicodeUTF8))
self.label_3.setText(QtGui.QApplication.translate("picking_parameters", "vmax [m/s]", None, QtGui.QApplication.UnicodeUTF8))
self.label_3.setToolTip(QtGui.QApplication.translate("picking_parameters", "Maximum permitted direct velocity (apparent velocity!).", None, QtGui.QApplication.UnicodeUTF8))
self.label_3.setText(QtGui.QApplication.translate("picking_parameters", "vmax [m/s] [?]", None, QtGui.QApplication.UnicodeUTF8))
self.lineEdit_vmax.setText(QtGui.QApplication.translate("picking_parameters", "5000", None, QtGui.QApplication.UnicodeUTF8))
self.label_4.setText(QtGui.QApplication.translate("picking_parameters", "Fraction of local maximum", None, QtGui.QApplication.UnicodeUTF8))
self.label_4.setToolTip(QtGui.QApplication.translate("picking_parameters", "Value between 0 and 1 for threshold picking algorithm (Default = 0.6).", None, QtGui.QApplication.UnicodeUTF8))
self.label_4.setText(QtGui.QApplication.translate("picking_parameters", "Fraction of local maximum [?]", None, QtGui.QApplication.UnicodeUTF8))
self.lineEdit_folm.setText(QtGui.QApplication.translate("picking_parameters", "0.6", None, QtGui.QApplication.UnicodeUTF8))
self.label_5.setText(QtGui.QApplication.translate("picking_parameters", "AIC", None, QtGui.QApplication.UnicodeUTF8))
self.label_6.setText(QtGui.QApplication.translate("picking_parameters", "AIC window indices\n"
self.label_5.setToolTip(QtGui.QApplication.translate("picking_parameters", "Use additional Akaike Information Criterion for picking.", None, QtGui.QApplication.UnicodeUTF8))
self.label_5.setText(QtGui.QApplication.translate("picking_parameters", "AIC [?]", None, QtGui.QApplication.UnicodeUTF8))
self.label_6.setToolTip(QtGui.QApplication.translate("picking_parameters", "Samples before and after initial HOS pick.", None, QtGui.QApplication.UnicodeUTF8))
self.label_6.setText(QtGui.QApplication.translate("picking_parameters", "AIC window samples\n"
"(only if AIC checked)", None, QtGui.QApplication.UnicodeUTF8))
self.lineEdit_aicleft.setText(QtGui.QApplication.translate("picking_parameters", "15", None, QtGui.QApplication.UnicodeUTF8))
self.lineEdit_aicright.setText(QtGui.QApplication.translate("picking_parameters", "0", None, QtGui.QApplication.UnicodeUTF8))

View File

@ -837,10 +837,10 @@ class SeisArray(object):
if highlight_measured == True:
ax.plot(xmr, ymr, 'r.', markersize=pointsize, label='measured receivers')
ax.text(0.5, 1.05,'2D plot of seismic array\n %s'%self.recfile,
horizontalalignment='center', verticalalignment='center',
transform=ax.transAxes)
#plt.title('2D plot of seismic array %s' % self.recfile)
ax.figure.text(0.5, 0.95,'2D plot of seismic array\n %s'%self.recfile,
horizontalalignment='center', verticalalignment='center',
transform = ax.figure.transFigure)
ax.set_xlabel('X [m]')
ax.set_ylabel('Y [m]')
ax.set_aspect('equal')
@ -853,12 +853,12 @@ class SeisArray(object):
ax.annotate((' ' + str(shotnumber)), xy=(self._getXshot(shotnumber), self._getYshot(shotnumber)),
fontsize='x-small', color='b')
def plotArray3D(self, ax=None):
def plotArray3D(self, ax=None, legend = True, markersize = 10):
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
plt.interactive(True)
if ax == None:
plt.interactive(True)
fig = plt.figure()
ax = plt.axes(projection='3d')
@ -867,19 +867,23 @@ class SeisArray(object):
xrc, yrc, zrc = self.getReceiverLists()
xsc, ysc, zsc = self.getSourceLocsLists()
plt.title('3D plot of seismic array.')
ax.figure.text(0.5, 0.95,'3D plot of seismic array\n %s'%self.recfile,
horizontalalignment='center', verticalalignment='center',
transform = ax.figure.transFigure)
if len(xmt) > 0:
ax.plot(xmt, ymt, zmt, 'b.', markersize=10, label='measured topo points')
ax.plot(xmt, ymt, zmt, 'b.', markersize=markersize, label='measured topo points')
if len(xrc) > 0:
ax.plot(xrc, yrc, zrc, 'k.', markersize=10, label='all receivers')
ax.plot(xrc, yrc, zrc, 'k.', markersize=markersize, label='all receivers')
if len(xmr) > 0:
ax.plot(xmr, ymr, zmr, 'ro', label='measured receivers')
ax.plot(xmr, ymr, zmr, 'ro', markersize=markersize, label='measured receivers')
if len(xsc) > 0:
ax.plot(xsc, ysc, zsc, 'b*', label='shot locations')
ax.plot(xsc, ysc, zsc, 'b*', markersize=markersize, label='shot locations')
ax.set_xlabel('X [m]');
ax.set_ylabel('Y [m]');
ax.set_zlabel('Z [m]')
ax.legend()
if legend == True:
ax.legend()
return ax
@ -887,9 +891,9 @@ class SeisArray(object):
from matplotlib import cm
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
plt.interactive(True)
if ax == None:
plt.interactive(True)
fig = plt.figure()
ax = plt.axes(projection='3d')
@ -908,7 +912,7 @@ class SeisArray(object):
zgrid = griddata((x, y), z, (xgrid, ygrid), method=method)
surf = ax.plot_surface(xgrid, ygrid, zgrid, linewidth=0, cmap=cm.jet, vmin=min(z), vmax=max(z))
cbar = plt.colorbar(surf)
cbar = ax.figure.colorbar(surf)
cbar.set_label('Elevation [m]')
if exag == False:

View File

@ -908,15 +908,16 @@ class SeismicShot(object):
alpha=0.85)
ax.text(0.5, 0.95, 'shot: %s' % self.getShotnumber(), transform=ax.transAxes
, horizontalalignment='center')
sc = ax.scatter(x, y, c=z, s=30, label='picked shots', vmin=tmin, vmax=tmax, cmap=cmap, linewidths=1.5)
label = None
sc = ax.scatter(x, y, c=z, s=30, label='active traces', vmin=tmin, vmax=tmax, cmap=cmap, linewidths=1.5)
for xyz in zip(xcut, ycut, zcut):
x, y, z = xyz
count += 1
if z > tmax:
count += 1
z = 'w'
if count == 1:
label = 'cut out shots'
if count == 1:
label = 'inactive traces'
else:
label = None
ax.scatter(x, y, c=z, s=30, edgecolor='m', label=label, vmin=tmin, vmax=tmax, cmap=cmap, linewidths=1.5)
if colorbar == True:
cbar = plt.colorbar(sc)

View File

@ -208,8 +208,8 @@ def plotScatterStats4Shots(survey, variable, ax = None):
ax.text(0.5, 1.05,'Plot of all shots',
horizontalalignment='center', verticalalignment='center',
transform=ax.transAxes)
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_xlabel('X [m]')
ax.set_ylabel('Y [m]')
ax.set_aspect('equal')
cbar = ax.figure.colorbar(sc)
cbar.set_label(variable)
@ -272,8 +272,8 @@ def plotScatterStats4Receivers(survey, variable, ax = None):
ax.text(0.5, 1.05,'Plot of all receivers',
horizontalalignment='center', verticalalignment='center',
transform=ax.transAxes)
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_xlabel('X [m]')
ax.set_ylabel('Y [m]')
ax.set_aspect('equal')
cbar = ax.figure.colorbar(sc)
cbar.set_label(variable)

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'vtk_tools_layout.ui'
#
# Created: Wed Jul 6 11:39:58 2016
# Created: Thu Jul 7 14:25:26 2016
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!
@ -12,9 +12,9 @@ from PySide import QtCore, QtGui
class Ui_vtk_tools(object):
def setupUi(self, vtk_tools):
vtk_tools.setObjectName("vtk_tools")
vtk_tools.resize(362, 432)
self.verticalLayout_8 = QtGui.QVBoxLayout(vtk_tools)
self.verticalLayout_8.setObjectName("verticalLayout_8")
vtk_tools.resize(422, 471)
self.verticalLayout_9 = QtGui.QVBoxLayout(vtk_tools)
self.verticalLayout_9.setObjectName("verticalLayout_9")
self.verticalLayout = QtGui.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.verticalLayout_4 = QtGui.QVBoxLayout()
@ -75,15 +75,21 @@ class Ui_vtk_tools(object):
self.pushButton_vgref.setObjectName("pushButton_vgref")
self.horizontalLayout_4.addWidget(self.pushButton_vgref)
self.verticalLayout_7.addLayout(self.horizontalLayout_4)
self.horizontalLayout_3 = QtGui.QHBoxLayout()
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.verticalLayout_8 = QtGui.QVBoxLayout()
self.verticalLayout_8.setObjectName("verticalLayout_8")
self.verticalLayout_7.addLayout(self.verticalLayout_8)
self.label_5 = QtGui.QLabel(vtk_tools)
self.label_5.setObjectName("label_5")
self.horizontalLayout_3.addWidget(self.label_5)
self.verticalLayout_7.addWidget(self.label_5)
self.horizontalLayout_3 = QtGui.QHBoxLayout()
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.lineEdit_vgout = QtGui.QLineEdit(vtk_tools)
self.lineEdit_vgout.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.lineEdit_vgout.setObjectName("lineEdit_vgout")
self.horizontalLayout_3.addWidget(self.lineEdit_vgout)
self.pushButton_vtkout = QtGui.QPushButton(vtk_tools)
self.pushButton_vtkout.setObjectName("pushButton_vtkout")
self.horizontalLayout_3.addWidget(self.pushButton_vtkout)
self.pushButton_parav = QtGui.QPushButton(vtk_tools)
self.pushButton_parav.setObjectName("pushButton_parav")
self.horizontalLayout_3.addWidget(self.pushButton_parav)
@ -148,12 +154,12 @@ class Ui_vtk_tools(object):
self.verticalLayout_5.addWidget(self.start_rays)
self.verticalLayout_2.addLayout(self.verticalLayout_5)
self.verticalLayout.addLayout(self.verticalLayout_2)
self.verticalLayout_8.addLayout(self.verticalLayout)
self.verticalLayout_9.addLayout(self.verticalLayout)
self.buttonBox = QtGui.QDialogButtonBox(vtk_tools)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.verticalLayout_8.addWidget(self.buttonBox)
self.verticalLayout_9.addWidget(self.buttonBox)
self.retranslateUi(vtk_tools)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), vtk_tools.accept)
@ -197,8 +203,9 @@ class Ui_vtk_tools(object):
self.pushButton_vg.setText(QtGui.QApplication.translate("vtk_tools", "Browse", None, QtGui.QApplication.UnicodeUTF8))
self.label_4.setText(QtGui.QApplication.translate("vtk_tools", "Browse for reference velocity grid file (\'vgridsref.in\'):", None, QtGui.QApplication.UnicodeUTF8))
self.pushButton_vgref.setText(QtGui.QApplication.translate("vtk_tools", "Browse", None, QtGui.QApplication.UnicodeUTF8))
self.label_5.setText(QtGui.QApplication.translate("vtk_tools", "Output Filename", None, QtGui.QApplication.UnicodeUTF8))
self.label_5.setText(QtGui.QApplication.translate("vtk_tools", "Output Filename:", None, QtGui.QApplication.UnicodeUTF8))
self.lineEdit_vgout.setText(QtGui.QApplication.translate("vtk_tools", "vgrids.vtk", None, QtGui.QApplication.UnicodeUTF8))
self.pushButton_vtkout.setText(QtGui.QApplication.translate("vtk_tools", "Browse", None, QtGui.QApplication.UnicodeUTF8))
self.pushButton_parav.setToolTip(QtGui.QApplication.translate("vtk_tools", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"