Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop
This commit is contained in:
@@ -800,6 +800,7 @@ def autopickstation(wfstream, pickparam):
|
||||
|
||||
return picks
|
||||
|
||||
|
||||
def iteratepicker(wf, NLLocfile, picks, badpicks, pickparameter):
|
||||
'''
|
||||
Repicking of bad onsets. Uses theoretical onset times from NLLoc-location file.
|
||||
@@ -816,8 +817,8 @@ def iteratepicker(wf, NLLocfile, picks, badpicks, pickparameter):
|
||||
'''
|
||||
|
||||
print("#######################################################")
|
||||
print("autoPyLoT: Found bad onsets at station(s) %s, starting re-picking them ...") \
|
||||
% badpicks
|
||||
print("autoPyLoT: Found %d bad onsets at station(s) %s, starting re-picking them ...") \
|
||||
% (len(badpicks), badpicks)
|
||||
|
||||
newpicks = {}
|
||||
for i in range(0, len(badpicks)):
|
||||
@@ -838,32 +839,44 @@ def iteratepicker(wf, NLLocfile, picks, badpicks, pickparameter):
|
||||
# modify some picking parameters
|
||||
pstart_old = pickparameter.getParam('pstart')
|
||||
pstop_old = pickparameter.getParam('pstop')
|
||||
sstop_old = pickparameter.getParam('sstop')
|
||||
pickwinP_old = pickparameter.getParam('pickwinP')
|
||||
Precalcwin_old = pickparameter.getParam('Precalcwin')
|
||||
noisefactor_old = pickparameter.getParam('noisefactor')
|
||||
zfac_old = pickparameter.getParam('zfac')
|
||||
pickparameter.setParam(pstart=badpicks[i][1] - wf2pick[0].stats.starttime \
|
||||
- pickparameter.getParam('tlta'))
|
||||
pickparameter.setParam(pstop=pickparameter.getParam('pstart') + \
|
||||
(3 * pickparameter.getParam('tlta')))
|
||||
pickparameter.setParam(sstop=pickparameter.getParam('sstop') / 2)
|
||||
pickparameter.setParam(pickwinP=pickparameter.getParam('pickwinP') / 2)
|
||||
pickparameter.setParam(Precalcwin=pickparameter.getParam('Precalcwin') / 2)
|
||||
pickparameter.setParam(noisefactor=1.0)
|
||||
pickparameter.setParam(zfac=1.0)
|
||||
print("iteratepicker: The following picking parameters have been modified for iterative picking:")
|
||||
print("pstart: %fs => %fs" % (pstart_old, pickparameter.getParam('pstart')))
|
||||
print("pstop: %fs => %fs" % (pstop_old, pickparameter.getParam('pstop')))
|
||||
print("sstop: %fs => %fs" % (sstop_old, pickparameter.getParam('sstop')))
|
||||
print("pickwinP: %fs => %fs" % (pickwinP_old, pickparameter.getParam('pickwinP')))
|
||||
print("Precalcwin: %fs => %fs" % (Precalcwin_old, pickparameter.getParam('Precalcwin')))
|
||||
|
||||
print("noisefactor: %f => %f" % (noisefactor_old, pickparameter.getParam('noisefactor')))
|
||||
print("zfac: %f => %f" % (zfac_old, pickparameter.getParam('zfac')))
|
||||
|
||||
# repick station
|
||||
newpicks = autopickstation(wf2pick, pickparameter)
|
||||
|
||||
# replace old dictionary with new one
|
||||
picks[badpicks[i][0]] = newpicks
|
||||
|
||||
# reset temporary change of picking parameters
|
||||
print("iteratepicker: Resetting picking parameters ...")
|
||||
pickparameter.setParam(pstart=pstart_old)
|
||||
pickparameter.setParam(pstop=pstop_old)
|
||||
pickparameter.setParam(pickwinP=pickwinP_old)
|
||||
pickparameter.setParam(Precalcwin=Precalcwin_old)
|
||||
# reset temporary change of picking parameters
|
||||
print("iteratepicker: Resetting picking parameters ...")
|
||||
pickparameter.setParam(pstart=pstart_old)
|
||||
pickparameter.setParam(pstop=pstop_old)
|
||||
pickparameter.setParam(sstop=sstop_old)
|
||||
pickparameter.setParam(pickwinP=pickwinP_old)
|
||||
pickparameter.setParam(Precalcwin=Precalcwin_old)
|
||||
pickparameter.setParam(noisefactor=noisefactor_old)
|
||||
pickparameter.setParam(zfac=zfac_old)
|
||||
|
||||
return picks
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ from matplotlib.widgets import MultiCursor
|
||||
from PySide.QtGui import QAction, QApplication, QComboBox, QDateTimeEdit, \
|
||||
QDialog, QDialogButtonBox, QDoubleSpinBox, QGroupBox, QGridLayout, \
|
||||
QIcon, QKeySequence, QLabel, QLineEdit, QMessageBox, QPixmap, QSpinBox, \
|
||||
QTabWidget, QToolBar, QVBoxLayout, QWidget
|
||||
QTabWidget, QToolBar, QVBoxLayout, QWidget, QPushButton, QFileDialog
|
||||
from PySide.QtCore import QSettings, Qt, QUrl, Signal, Slot
|
||||
from PySide.QtWebKit import QWebView
|
||||
from obspy import Stream, UTCDateTime
|
||||
@@ -789,6 +789,7 @@ class PropertiesDlg(QDialog):
|
||||
self.tabWidget.addTab(OutputsTab(self), "Outputs")
|
||||
self.tabWidget.addTab(PhasesTab(self), "Phases")
|
||||
self.tabWidget.addTab(GraphicsTab(self), "Graphics")
|
||||
self.tabWidget.addTab(LocalisationTab(self), "Loc Tools")
|
||||
self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok |
|
||||
QDialogButtonBox.Apply |
|
||||
QDialogButtonBox.Close)
|
||||
@@ -842,10 +843,14 @@ class InputsTab(PropTab):
|
||||
|
||||
# get the full name of the actual user
|
||||
self.fullNameEdit = QLineEdit()
|
||||
self.fullNameEdit.setText(fulluser)
|
||||
try:
|
||||
self.fullNameEdit.setText(fulluser)
|
||||
except TypeError as e:
|
||||
self.fullNameEdit.setText(fulluser[0])
|
||||
|
||||
# information about data structure
|
||||
dataroot = settings.value("data/dataRoot")
|
||||
curstructure = settings.value("data/Structure")
|
||||
dataDirLabel = QLabel("data root directory: ")
|
||||
self.dataDirEdit = QLineEdit()
|
||||
self.dataDirEdit.setText(dataroot)
|
||||
@@ -857,6 +862,10 @@ class InputsTab(PropTab):
|
||||
|
||||
self.structureSelect.addItems(DATASTRUCTURE.keys())
|
||||
|
||||
dsind = findComboBoxIndex(self.structureSelect, curstructure)
|
||||
|
||||
self.structureSelect.setCurrentIndex(dsind)
|
||||
|
||||
layout = QGridLayout()
|
||||
layout.addWidget(dataDirLabel, 0, 0)
|
||||
layout.addWidget(self.dataDirEdit, 0, 1)
|
||||
@@ -929,14 +938,60 @@ class LocalisationTab(PropTab):
|
||||
toolind = findComboBoxIndex(self.locToolComboBox, curtool)
|
||||
|
||||
self.locToolComboBox.setCurrentIndex(toolind)
|
||||
|
||||
|
||||
curroot = settings.value("loc/tool", None)
|
||||
curroot = settings.value("%s/rootPath".format(curtool), None)
|
||||
curbin = settings.value("%s/binPath".format(curtool), None)
|
||||
|
||||
self.rootlabel = QLabel("root directory")
|
||||
self.binlabel = QLabel("bin directory")
|
||||
|
||||
self.rootedit = QLineEdit('')
|
||||
self.binedit = QLineEdit('')
|
||||
|
||||
if curroot is not None:
|
||||
self.rootedit.setText(curroot)
|
||||
if curbin is not None:
|
||||
self.binedit.setText(curbin)
|
||||
|
||||
rootBrowse = QPushButton('...', self)
|
||||
rootBrowse.clicked.connect(lambda: self.selectDirectory(self.rootedit))
|
||||
|
||||
binBrowse = QPushButton('...', self)
|
||||
binBrowse.clicked.connect(lambda: self.selectDirectory(self.binedit))
|
||||
|
||||
self.locToolComboBox.currentIndexChanged.connect(self.updateUi)
|
||||
|
||||
self.updateUi()
|
||||
|
||||
layout = QGridLayout()
|
||||
layout.addWidget(loctoollabel, 0, 0)
|
||||
layout.addWidget(self.locToolComboBox, 0, 1)
|
||||
layout.addWidget(self.rootlabel, 1, 0)
|
||||
layout.addWidget(self.rootedit, 1, 1)
|
||||
layout.addWidget(rootBrowse, 1, 2)
|
||||
layout.addWidget(self.binlabel, 2, 0)
|
||||
layout.addWidget(self.binedit, 2, 1)
|
||||
layout.addWidget(binBrowse, 2, 2)
|
||||
|
||||
self.setLayout(layout)
|
||||
|
||||
def updateUi(self):
|
||||
curtool = self.locToolComboBox.currentText()
|
||||
if curtool is not None:
|
||||
rootlabel = QLabel("{0} root dircetory".format(curtool))
|
||||
else:
|
||||
rootlabel = QLabel("root dircetory")
|
||||
rootlabel.setDisabled()
|
||||
self.rootlabel.setText("{0} root directory".format(curtool))
|
||||
self.binlabel.setText("{0} bin directory".format(curtool))
|
||||
|
||||
def selectDirectory(self, edit):
|
||||
selected_directory = QFileDialog.getExistingDirectory()
|
||||
edit.setText(selected_directory)
|
||||
|
||||
def getValues(self):
|
||||
loctool = self.locToolComboBox.currentText()
|
||||
values = {"%s/rootPath".format(loctool): self.rootedit.text(),
|
||||
"%s/binPath".format(loctool): self.binedit.text(),
|
||||
"loc/tool": loctool}
|
||||
return values
|
||||
|
||||
|
||||
|
||||
class NewEventDlg(QDialog):
|
||||
|
||||
Reference in New Issue
Block a user