Working on input file format (SEG2/SEGY) etc.

This commit is contained in:
Marcel Paffrath 2016-06-27 15:20:17 +02:00
parent 253e9f4b1e
commit 8714616d1b
7 changed files with 47 additions and 39 deletions

View File

@ -49,7 +49,9 @@ class Survey(object):
shotlist = self.getShotlist()
for shotnumber in shotlist: # loop over data files
# generate filenames and read manual picks to a list
obsfile = os.path.join(self._obsdir, str(shotnumber)) + '_pickle.dat'
#fileending = '_pickle.dat'
fileending = '.sg2'
obsfile = os.path.join(self._obsdir, str(shotnumber)) + fileending
if obsfile not in shot_dict.keys():
shot_dict[shotnumber] = []
shot_dict[shotnumber] = seismicshot.SeismicShot(obsfile)
@ -375,7 +377,7 @@ class Survey(object):
shotlist = []
for line in srcfile.readlines():
line = line.split()
shotlist.append(int(line[0]))
shotlist.append(line[0])
return shotlist

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'asp3d_layout.ui'
#
# Created: Mon Jun 27 13:23:32 2016
# Created: Mon Jun 27 15:18:25 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 'fmtomo_parameters_layout.ui'
#
# Created: Mon Jun 27 13:23:32 2016
# Created: Mon Jun 27 15:18:25 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: Mon Jun 27 13:23:32 2016
# Created: Mon Jun 27 15:18:25 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,67 +2,67 @@
# Form implementation generated from reading ui file 'generate_survey_layout.ui'
#
# Created: Mon Jun 27 13:23:33 2016
# Created: Mon Jun 27 15:18:25 2016
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(380, 160)
class Ui_generate_survey(object):
def setupUi(self, generate_survey):
generate_survey.setObjectName("generate_survey")
generate_survey.resize(380, 160)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap("../asp3d_icon.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
Dialog.setWindowIcon(icon)
self.verticalLayout = QtGui.QVBoxLayout(Dialog)
generate_survey.setWindowIcon(icon)
self.verticalLayout = QtGui.QVBoxLayout(generate_survey)
self.verticalLayout.setObjectName("verticalLayout")
self.gridLayout = QtGui.QGridLayout()
self.gridLayout.setObjectName("gridLayout")
self.lineEdit_rec = QtGui.QLineEdit(Dialog)
self.lineEdit_rec = QtGui.QLineEdit(generate_survey)
self.lineEdit_rec.setObjectName("lineEdit_rec")
self.gridLayout.addWidget(self.lineEdit_rec, 0, 1, 1, 1)
self.pushButton_rec = QtGui.QPushButton(Dialog)
self.pushButton_rec = QtGui.QPushButton(generate_survey)
self.pushButton_rec.setObjectName("pushButton_rec")
self.gridLayout.addWidget(self.pushButton_rec, 0, 2, 1, 1)
self.label_rec = QtGui.QLabel(Dialog)
self.label_rec = QtGui.QLabel(generate_survey)
self.label_rec.setObjectName("label_rec")
self.gridLayout.addWidget(self.label_rec, 0, 0, 1, 1)
self.lineEdit_obs = QtGui.QLineEdit(Dialog)
self.lineEdit_obs = QtGui.QLineEdit(generate_survey)
self.lineEdit_obs.setObjectName("lineEdit_obs")
self.gridLayout.addWidget(self.lineEdit_obs, 2, 1, 1, 1)
self.label_obs = QtGui.QLabel(Dialog)
self.label_obs = QtGui.QLabel(generate_survey)
self.label_obs.setObjectName("label_obs")
self.gridLayout.addWidget(self.label_obs, 2, 0, 1, 1)
self.pushButton_obs = QtGui.QPushButton(Dialog)
self.pushButton_obs = QtGui.QPushButton(generate_survey)
self.pushButton_obs.setObjectName("pushButton_obs")
self.gridLayout.addWidget(self.pushButton_obs, 2, 2, 1, 1)
self.label_src = QtGui.QLabel(Dialog)
self.label_src = QtGui.QLabel(generate_survey)
self.label_src.setObjectName("label_src")
self.gridLayout.addWidget(self.label_src, 1, 0, 1, 1)
self.lineEdit_src = QtGui.QLineEdit(Dialog)
self.lineEdit_src = QtGui.QLineEdit(generate_survey)
self.lineEdit_src.setObjectName("lineEdit_src")
self.gridLayout.addWidget(self.lineEdit_src, 1, 1, 1, 1)
self.pushButton_src = QtGui.QPushButton(Dialog)
self.pushButton_src = QtGui.QPushButton(generate_survey)
self.pushButton_src.setObjectName("pushButton_src")
self.gridLayout.addWidget(self.pushButton_src, 1, 2, 1, 1)
self.verticalLayout.addLayout(self.gridLayout)
self.buttonBox = QtGui.QDialogButtonBox(Dialog)
self.buttonBox = QtGui.QDialogButtonBox(generate_survey)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.verticalLayout.addWidget(self.buttonBox)
self.retranslateUi(Dialog)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), Dialog.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), Dialog.reject)
QtCore.QMetaObject.connectSlotsByName(Dialog)
self.retranslateUi(generate_survey)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), generate_survey.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), generate_survey.reject)
QtCore.QMetaObject.connectSlotsByName(generate_survey)
def retranslateUi(self, Dialog):
Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Generate new Survey", None, QtGui.QApplication.UnicodeUTF8))
self.pushButton_rec.setText(QtGui.QApplication.translate("Dialog", "Browse", None, QtGui.QApplication.UnicodeUTF8))
self.label_rec.setToolTip(QtGui.QApplication.translate("Dialog", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
def retranslateUi(self, generate_survey):
generate_survey.setWindowTitle(QtGui.QApplication.translate("generate_survey", "Generate new Survey", None, QtGui.QApplication.UnicodeUTF8))
self.pushButton_rec.setText(QtGui.QApplication.translate("generate_survey", "Browse", None, QtGui.QApplication.UnicodeUTF8))
self.label_rec.setToolTip(QtGui.QApplication.translate("generate_survey", "<!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"
"</style></head><body style=\" font-family:\'Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
@ -76,9 +76,9 @@ class Ui_Dialog(object):
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Trace ID 100 with the coordinates (12.3 [m], 100.5 [m], 20.3 [m]).</p>\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">100 12.3 100.5 20.3</p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
self.label_rec.setText(QtGui.QApplication.translate("Dialog", "Receiver\n"
self.label_rec.setText(QtGui.QApplication.translate("generate_survey", "Receiver\n"
"File [?]", None, QtGui.QApplication.UnicodeUTF8))
self.label_obs.setToolTip(QtGui.QApplication.translate("Dialog", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
self.label_obs.setToolTip(QtGui.QApplication.translate("generate_survey", "<!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"
"</style></head><body style=\" font-family:\'Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
@ -90,10 +90,10 @@ class Ui_Dialog(object):
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Shot number 100 containing seismograms for all traces with the name:</p>\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">100_pickle.dat</p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
self.label_obs.setText(QtGui.QApplication.translate("Dialog", "Seismogram\n"
self.label_obs.setText(QtGui.QApplication.translate("generate_survey", "Seismogram\n"
"Directory [?]", None, QtGui.QApplication.UnicodeUTF8))
self.pushButton_obs.setText(QtGui.QApplication.translate("Dialog", "Browse", None, QtGui.QApplication.UnicodeUTF8))
self.label_src.setToolTip(QtGui.QApplication.translate("Dialog", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
self.pushButton_obs.setText(QtGui.QApplication.translate("generate_survey", "Browse", None, QtGui.QApplication.UnicodeUTF8))
self.label_src.setToolTip(QtGui.QApplication.translate("generate_survey", "<!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"
"</style></head><body style=\" font-family:\'Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
@ -107,7 +107,7 @@ class Ui_Dialog(object):
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Source number 100 with the coordinates (12.3 [m], 100.5 [m], 20.3 [m]).</p>\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">100 12.3 100.5 20.3</p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
self.label_src.setText(QtGui.QApplication.translate("Dialog", "Source\n"
self.label_src.setText(QtGui.QApplication.translate("generate_survey", "Source\n"
"File [?]", None, QtGui.QApplication.UnicodeUTF8))
self.pushButton_src.setText(QtGui.QApplication.translate("Dialog", "Browse", None, QtGui.QApplication.UnicodeUTF8))
self.pushButton_src.setText(QtGui.QApplication.translate("generate_survey", "Browse", None, QtGui.QApplication.UnicodeUTF8))

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'picking_parameters_layout.ui'
#
# Created: Mon Jun 27 13:23:33 2016
# Created: Mon Jun 27 15:18:25 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

@ -33,6 +33,7 @@ class SeismicShot(object):
:type: string
'''
self.traces = read(obsfile)
self.renameChannelIDs()
self.recCoordlist = None
self.srcCoordlist = None
self.traceIDs = None
@ -47,6 +48,11 @@ class SeismicShot(object):
self.paras['shotname'] = obsfile
self.folm = None
def renameChannelIDs(self):
for trace in self.traces:
if trace.stats._format == 'SEG2':
trace.stats.channel = int(trace.stats.seg2['CHANNEL_NUMBER'])
def removeEmptyTraces(self):
traceIDs = []
coordlist = self.getRecCoordlist()
@ -495,7 +501,7 @@ class SeismicShot(object):
'''
coordlist = self.getSrcCoordlist()
for i in range(0, len(coordlist)):
if int(coordlist[i].split()[0]) == self.paras['shotnumber']:
if coordlist[i].split()[0] == self.paras['shotnumber']:
x = coordlist[i].split()[1]
y = coordlist[i].split()[2]
z = coordlist[i].split()[3]