In setIniPickP and setIniPickS: get parameters from pylot.in instead of hard programmed values.

This commit is contained in:
Ludger Küperkoch 2017-03-14 10:32:43 +01:00
parent f0c1ec14f2
commit c74205c46f

View File

@ -5,6 +5,7 @@ Created on Wed Mar 19 11:27:35 2014
@author: sebastianw @author: sebastianw
""" """
import os
import warnings import warnings
import copy import copy
import datetime import datetime
@ -27,7 +28,7 @@ from PySide.QtGui import QAction, QApplication, QCheckBox, QComboBox, \
from PySide.QtCore import QSettings, Qt, QUrl, Signal, Slot from PySide.QtCore import QSettings, Qt, QUrl, Signal, Slot
from PySide.QtWebKit import QWebView from PySide.QtWebKit import QWebView
from obspy import Stream, UTCDateTime from obspy import Stream, UTCDateTime
from pylot.core.io.inputs import FilterOptions from pylot.core.io.inputs import FilterOptions, AutoPickParameter
from pylot.core.pick.utils import getSNR, earllatepicker, getnoisewin, \ from pylot.core.pick.utils import getSNR, earllatepicker, getnoisewin, \
getResolutionWindow getResolutionWindow
from pylot.core.pick.compare import Comparison from pylot.core.pick.compare import Comparison
@ -823,14 +824,15 @@ class PickDlg(QDialog):
def setIniPickP(self, gui_event, wfdata, trace_number): def setIniPickP(self, gui_event, wfdata, trace_number):
infile = os.path.join(os.path.expanduser('~'), '.pylot', 'pylot.in')
parameter = AutoPickParameter(infile)
ini_pick = gui_event.xdata ini_pick = gui_event.xdata
settings = QSettings() nfac = parameter.get('nfacP')
twins = parameter.get('tsnrz')
nfac = settings.value('picking/nfac_P', 1.3) noise_win = twins[0]
noise_win = settings.value('picking/noise_win_P', 5.) gap_win = twins[1]
gap_win = settings.value('picking/gap_win_P', .2) signal_win = twins[2]
signal_win = settings.value('picking/signal_win_P', 3.)
itrace = int(trace_number) itrace = int(trace_number)
while itrace > len(wfdata) - 1: while itrace > len(wfdata) - 1:
@ -872,14 +874,15 @@ class PickDlg(QDialog):
def setIniPickS(self, gui_event, wfdata): def setIniPickS(self, gui_event, wfdata):
infile = os.path.join(os.path.expanduser('~'), '.pylot', 'pylot.in')
parameter = AutoPickParameter(infile)
ini_pick = gui_event.xdata ini_pick = gui_event.xdata
settings = QSettings() nfac = parameter.get('nfacS')
twins = parameter.get('tsnrh')
nfac = settings.value('picking/nfac_S', 1.5) noise_win = twins[0]
noise_win = settings.value('picking/noise_win_S', 5.) gap_win = twins[1]
gap_win = settings.value('picking/gap_win_S', .2) signal_win = twins[2]
signal_win = settings.value('picking/signal_win_S', 3.)
# copy data for plotting # copy data for plotting
data = self.getWFData().copy() data = self.getWFData().copy()