[cleanup] pycharm code inspection
This commit is contained in:
parent
a5d863bf95
commit
365657064f
68
QtPyLoT.py
68
QtPyLoT.py
@ -39,7 +39,7 @@ from PySide.QtCore import QCoreApplication, QSettings, Signal, QFile, \
|
|||||||
from PySide.QtGui import QMainWindow, QInputDialog, QIcon, QFileDialog, \
|
from PySide.QtGui import QMainWindow, QInputDialog, QIcon, QFileDialog, \
|
||||||
QWidget, QHBoxLayout, QVBoxLayout, QStyle, QKeySequence, QLabel, QFrame, QAction, \
|
QWidget, QHBoxLayout, QVBoxLayout, QStyle, QKeySequence, QLabel, QFrame, QAction, \
|
||||||
QDialog, QErrorMessage, QApplication, QPixmap, QMessageBox, QSplashScreen, \
|
QDialog, QErrorMessage, QApplication, QPixmap, QMessageBox, QSplashScreen, \
|
||||||
QActionGroup, QListWidget, QDockWidget, QLineEdit, QListView, QAbstractItemView, \
|
QActionGroup, QListWidget, QLineEdit, QListView, QAbstractItemView, \
|
||||||
QTreeView, QComboBox, QTabWidget, QPushButton, QGridLayout
|
QTreeView, QComboBox, QTabWidget, QPushButton, QGridLayout
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from obspy import UTCDateTime
|
from obspy import UTCDateTime
|
||||||
@ -68,7 +68,7 @@ from pylot.core.pick.utils import symmetrize_error, getQualityFromUncertainty
|
|||||||
from pylot.core.io.phases import picksdict_from_picks
|
from pylot.core.io.phases import picksdict_from_picks
|
||||||
import pylot.core.loc.nll as nll
|
import pylot.core.loc.nll as nll
|
||||||
from pylot.core.util.defaults import FILTERDEFAULTS, SetChannelComponents
|
from pylot.core.util.defaults import FILTERDEFAULTS, SetChannelComponents
|
||||||
from pylot.core.util.errors import FormatError, DatastructureError, \
|
from pylot.core.util.errors import DatastructureError, \
|
||||||
OverwriteError
|
OverwriteError
|
||||||
from pylot.core.util.connection import checkurl
|
from pylot.core.util.connection import checkurl
|
||||||
from pylot.core.util.dataprocessing import read_metadata, restitute_data
|
from pylot.core.util.dataprocessing import read_metadata, restitute_data
|
||||||
@ -801,12 +801,8 @@ class MainWindow(QMainWindow):
|
|||||||
settings = QSettings()
|
settings = QSettings()
|
||||||
return settings.value("data/dataRoot")
|
return settings.value("data/dataRoot")
|
||||||
|
|
||||||
def load_autopicks(self, fname=None):
|
|
||||||
self.load_data(fname, type='auto')
|
|
||||||
|
|
||||||
def load_loc(self, fname=None):
|
def load_loc(self, fname=None):
|
||||||
type = getDataType(self)
|
self.load_data(fname, loc=True)
|
||||||
self.load_data(fname, type=type, loc=True)
|
|
||||||
|
|
||||||
def load_pilotevent(self):
|
def load_pilotevent(self):
|
||||||
filt = "PILOT location files (*LOC*.mat)"
|
filt = "PILOT location files (*LOC*.mat)"
|
||||||
@ -821,10 +817,8 @@ class MainWindow(QMainWindow):
|
|||||||
filter=filt, dir=loc_dir)
|
filter=filt, dir=loc_dir)
|
||||||
fn_phases = fn_phases[0]
|
fn_phases = fn_phases[0]
|
||||||
|
|
||||||
type = getDataType(self)
|
|
||||||
|
|
||||||
fname_dict = dict(phasfn=fn_phases, locfn=fn_loc)
|
fname_dict = dict(phasfn=fn_phases, locfn=fn_loc)
|
||||||
self.load_data(fname_dict, type=type)
|
self.load_data(fname_dict)
|
||||||
|
|
||||||
def load_multiple_data(self):
|
def load_multiple_data(self):
|
||||||
if not self.okToContinue():
|
if not self.okToContinue():
|
||||||
@ -1355,6 +1349,8 @@ class MainWindow(QMainWindow):
|
|||||||
self.cmpw.show()
|
self.cmpw.show()
|
||||||
|
|
||||||
def compareMulti(self):
|
def compareMulti(self):
|
||||||
|
if not self.compareoptions:
|
||||||
|
return
|
||||||
for key, func, color in self.compareoptions:
|
for key, func, color in self.compareoptions:
|
||||||
if self.cmpw.rb_dict[key].isChecked():
|
if self.cmpw.rb_dict[key].isChecked():
|
||||||
# if radio button is checked break for loop and use func
|
# if radio button is checked break for loop and use func
|
||||||
@ -1863,27 +1859,27 @@ class MainWindow(QMainWindow):
|
|||||||
|
|
||||||
self.checkFilterOptions()
|
self.checkFilterOptions()
|
||||||
|
|
||||||
def updateFilterOptions(self):
|
# def updateFilterOptions(self):
|
||||||
try:
|
# try:
|
||||||
settings = QSettings()
|
# settings = QSettings()
|
||||||
if settings.value("filterdefaults",
|
# if settings.value("filterdefaults",
|
||||||
None) is None and not self.getFilters():
|
# None) is None and not self.getFilters():
|
||||||
for key, value in FILTERDEFAULTS.items():
|
# for key, value in FILTERDEFAULTS.items():
|
||||||
self.setFilterOptions(FilterOptions(**value), key)
|
# self.setFilterOptions(FilterOptions(**value), key)
|
||||||
elif settings.value("filterdefaults", None) is not None:
|
# elif settings.value("filterdefaults", None) is not None:
|
||||||
for key, value in settings.value("filterdefaults"):
|
# for key, value in settings.value("filterdefaults"):
|
||||||
self.setFilterOptions(FilterOptions(**value), key)
|
# self.setFilterOptions(FilterOptions(**value), key)
|
||||||
except Exception as e:
|
# except Exception as e:
|
||||||
self.update_status('Error ...')
|
# self.update_status('Error ...')
|
||||||
emsg = QErrorMessage(self)
|
# emsg = QErrorMessage(self)
|
||||||
emsg.showMessage('Error: {0}'.format(e))
|
# emsg.showMessage('Error: {0}'.format(e))
|
||||||
else:
|
# else:
|
||||||
self.update_status('Filter loaded ... '
|
# self.update_status('Filter loaded ... '
|
||||||
'[{0}: {1} Hz]'.format(
|
# '[{0}: {1} Hz]'.format(
|
||||||
self.getFilterOptions().getFilterType(),
|
# self.getFilterOptions().getFilterType(),
|
||||||
self.getFilterOptions().getFreq()))
|
# self.getFilterOptions().getFreq()))
|
||||||
if self.filterAction.isChecked():
|
# if self.filterAction.isChecked():
|
||||||
self.filterWaveformData()
|
# self.filterWaveformData()
|
||||||
|
|
||||||
def getSeismicPhase(self):
|
def getSeismicPhase(self):
|
||||||
return self.seismicPhase
|
return self.seismicPhase
|
||||||
@ -2114,6 +2110,8 @@ class MainWindow(QMainWindow):
|
|||||||
self.apw.show()
|
self.apw.show()
|
||||||
|
|
||||||
def start_autopick(self):
|
def start_autopick(self):
|
||||||
|
if not self.pickoptions:
|
||||||
|
return
|
||||||
for key, func, _ in self.pickoptions:
|
for key, func, _ in self.pickoptions:
|
||||||
if self.apw.rb_dict[key].isChecked():
|
if self.apw.rb_dict[key].isChecked():
|
||||||
# if radio button is checked break for loop and use func
|
# if radio button is checked break for loop and use func
|
||||||
@ -2341,6 +2339,7 @@ class MainWindow(QMainWindow):
|
|||||||
pen = make_pen(picktype, phaseID, 'lpp', quality)
|
pen = make_pen(picktype, phaseID, 'lpp', quality)
|
||||||
pw.plot([lpp, lpp], ylims,
|
pw.plot([lpp, lpp], ylims,
|
||||||
alpha=.25, pen=pen, name='LPP')
|
alpha=.25, pen=pen, name='LPP')
|
||||||
|
pen = make_pen(picktype, phaseID, 'mpp', quality)
|
||||||
if spe:
|
if spe:
|
||||||
# pen = make_pen(picktype, phaseID, 'spe', quality)
|
# pen = make_pen(picktype, phaseID, 'spe', quality)
|
||||||
# spe_l = pg.PlotDataItem([mpp - spe, mpp - spe], ylims, pen=pen,
|
# spe_l = pg.PlotDataItem([mpp - spe, mpp - spe], ylims, pen=pen,
|
||||||
@ -2357,7 +2356,6 @@ class MainWindow(QMainWindow):
|
|||||||
# fb = pw.addItem(fill)
|
# fb = pw.addItem(fill)
|
||||||
# except:
|
# except:
|
||||||
# print('Warning: drawPicks: Could not create fill for symmetric pick error.')
|
# print('Warning: drawPicks: Could not create fill for symmetric pick error.')
|
||||||
pen = make_pen(picktype, phaseID, 'mpp', quality)
|
|
||||||
pw.plot([mpp, mpp], ylims, pen=pen, name='{}-Pick'.format(phase))
|
pw.plot([mpp, mpp], ylims, pen=pen, name='{}-Pick'.format(phase))
|
||||||
else:
|
else:
|
||||||
pw.plot([mpp, mpp], ylims, pen=pen, name='{}-Pick (NO PICKERROR)'.format(phase))
|
pw.plot([mpp, mpp], ylims, pen=pen, name='{}-Pick (NO PICKERROR)'.format(phase))
|
||||||
@ -2802,7 +2800,7 @@ class MainWindow(QMainWindow):
|
|||||||
# raise ProcessingError('Restitution of waveform data failed!')
|
# raise ProcessingError('Restitution of waveform data failed!')
|
||||||
if type == 'ML':
|
if type == 'ML':
|
||||||
local_mag = LocalMagnitude(corr_wf, self.get_data().get_evt_data(), self.inputs.get('sstop'),
|
local_mag = LocalMagnitude(corr_wf, self.get_data().get_evt_data(), self.inputs.get('sstop'),
|
||||||
verbosity=True)
|
verbosity=True) ## MP MP missing parameter wascaling in function call!
|
||||||
return local_mag.updated_event()
|
return local_mag.updated_event()
|
||||||
elif type == 'Mw':
|
elif type == 'Mw':
|
||||||
moment_mag = MomentMagnitude(corr_wf, self.get_data().get_evt_data(), self.inputs.get('vp'),
|
moment_mag = MomentMagnitude(corr_wf, self.get_data().get_evt_data(), self.inputs.get('vp'),
|
||||||
@ -3201,8 +3199,8 @@ def create_window():
|
|||||||
app_created = True
|
app_created = True
|
||||||
# set aplication/organization name, domain (important to do this BEFORE setupUI is called for correct QSettings)
|
# set aplication/organization name, domain (important to do this BEFORE setupUI is called for correct QSettings)
|
||||||
app.setOrganizationName("Ruhr-University Bochum / BESTEC")
|
app.setOrganizationName("Ruhr-University Bochum / BESTEC")
|
||||||
app.setOrganizationDomain("rub.de");
|
app.setOrganizationDomain("rub.de")
|
||||||
app.setApplicationName("PyLoT");
|
app.setApplicationName("PyLoT")
|
||||||
app.references = set()
|
app.references = set()
|
||||||
# app.references.add(window)
|
# app.references.add(window)
|
||||||
# window.show()
|
# window.show()
|
||||||
|
@ -311,7 +311,7 @@ def autoPyLoT(input_dict=None, parameter=None, inputfile=None, fnames=None, even
|
|||||||
# calculate seismic moment Mo and moment magnitude Mw
|
# calculate seismic moment Mo and moment magnitude Mw
|
||||||
moment_mag = MomentMagnitude(corr_dat, evt, parameter.get('vp'),
|
moment_mag = MomentMagnitude(corr_dat, evt, parameter.get('vp'),
|
||||||
parameter.get('Qp'),
|
parameter.get('Qp'),
|
||||||
parameter.get('rho'), True, \
|
parameter.get('rho'), True,
|
||||||
iplot)
|
iplot)
|
||||||
# update pick with moment property values (w0, fc, Mo)
|
# update pick with moment property values (w0, fc, Mo)
|
||||||
for stats, props in moment_mag.moment_props.items():
|
for stats, props in moment_mag.moment_props.items():
|
||||||
@ -374,7 +374,7 @@ def autoPyLoT(input_dict=None, parameter=None, inputfile=None, fnames=None, even
|
|||||||
for key in picks:
|
for key in picks:
|
||||||
if picks[key]['P']['weight'] >= 4 or picks[key]['S']['weight'] >= 4:
|
if picks[key]['P']['weight'] >= 4 or picks[key]['S']['weight'] >= 4:
|
||||||
badpicks.append([key, picks[key]['P']['mpp']])
|
badpicks.append([key, picks[key]['P']['mpp']])
|
||||||
print("autoPyLoT: After iteration No. %d: %d bad onsets found ..." % (nlloccounter, \
|
print("autoPyLoT: After iteration No. %d: %d bad onsets found ..." % (nlloccounter,
|
||||||
len(badpicks)))
|
len(badpicks)))
|
||||||
if len(badpicks) == 0:
|
if len(badpicks) == 0:
|
||||||
print("autoPyLoT: No more bad onsets found, stop iterative picking!")
|
print("autoPyLoT: No more bad onsets found, stop iterative picking!")
|
||||||
@ -384,7 +384,7 @@ def autoPyLoT(input_dict=None, parameter=None, inputfile=None, fnames=None, even
|
|||||||
# calculate seismic moment Mo and moment magnitude Mw
|
# calculate seismic moment Mo and moment magnitude Mw
|
||||||
moment_mag = MomentMagnitude(corr_dat, evt, parameter.get('vp'),
|
moment_mag = MomentMagnitude(corr_dat, evt, parameter.get('vp'),
|
||||||
parameter.get('Qp'),
|
parameter.get('Qp'),
|
||||||
parameter.get('rho'), True, \
|
parameter.get('rho'), True,
|
||||||
iplot)
|
iplot)
|
||||||
# update pick with moment property values (w0, fc, Mo)
|
# update pick with moment property values (w0, fc, Mo)
|
||||||
for stats, props in moment_mag.moment_props.items():
|
for stats, props in moment_mag.moment_props.items():
|
||||||
@ -502,4 +502,4 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
picks = autoPyLoT(inputfile=str(cla.inputfile), fnames=str(cla.fnames),
|
picks = autoPyLoT(inputfile=str(cla.inputfile), fnames=str(cla.fnames),
|
||||||
eventid=str(cla.eventid), savepath=str(cla.spath),
|
eventid=str(cla.eventid), savepath=str(cla.spath),
|
||||||
ncores=cla.ncores, iplot=str(cla.iplot))
|
ncores=cla.ncores, iplot=int(cla.iplot))
|
||||||
|
@ -617,9 +617,9 @@ def calcsourcespec(wfstream, onset, vp, delta, azimuth, incidence,
|
|||||||
p3, = plt.loglog(F, YYcor, 'r')
|
p3, = plt.loglog(F, YYcor, 'r')
|
||||||
p4, = plt.loglog(F, fit, 'g')
|
p4, = plt.loglog(F, fit, 'g')
|
||||||
plt.loglog([fc, fc], [w0 / 100, w0], 'g')
|
plt.loglog([fc, fc], [w0 / 100, w0], 'g')
|
||||||
plt.legend([p1, p2, p3, p4], ['Raw Spectrum', \
|
plt.legend([p1, p2, p3, p4], ['Raw Spectrum',
|
||||||
'Used Raw Spectrum', \
|
'Used Raw Spectrum',
|
||||||
'Q-Corrected Spectrum', \
|
'Q-Corrected Spectrum',
|
||||||
'Fit to Spectrum'])
|
'Fit to Spectrum'])
|
||||||
plt.title('Source Spectrum from P Pulse, w0=%e m/Hz, fc=%6.2f Hz' \
|
plt.title('Source Spectrum from P Pulse, w0=%e m/Hz, fc=%6.2f Hz' \
|
||||||
% (w0, fc))
|
% (w0, fc))
|
||||||
|
@ -240,7 +240,7 @@ class Data(object):
|
|||||||
mstation = picks[i].waveform_id.station_code
|
mstation = picks[i].waveform_id.station_code
|
||||||
mstation_ext = mstation + '_'
|
mstation_ext = mstation + '_'
|
||||||
for k in range(len(picks_copy)):
|
for k in range(len(picks_copy)):
|
||||||
if ((picks_copy[k].waveform_id.station_code == mstation) or \
|
if ((picks_copy[k].waveform_id.station_code == mstation) or
|
||||||
(picks_copy[k].waveform_id.station_code == mstation_ext)) and \
|
(picks_copy[k].waveform_id.station_code == mstation_ext)) and \
|
||||||
(picks_copy[k].method_id == 'auto'):
|
(picks_copy[k].method_id == 'auto'):
|
||||||
del picks_copy[k]
|
del picks_copy[k]
|
||||||
@ -442,7 +442,6 @@ class Data(object):
|
|||||||
else:
|
else:
|
||||||
if self.get_evt_data().picks:
|
if self.get_evt_data().picks:
|
||||||
raise OverwriteError('Existing picks would be overwritten!')
|
raise OverwriteError('Existing picks would be overwritten!')
|
||||||
break
|
|
||||||
else:
|
else:
|
||||||
picks = picks_from_picksdict(picks)
|
picks = picks_from_picksdict(picks)
|
||||||
break
|
break
|
||||||
|
@ -865,7 +865,7 @@ def merge_picks(event, picks):
|
|||||||
if p.waveform_id.station_code == station\
|
if p.waveform_id.station_code == station\
|
||||||
and p.waveform_id.network_code == network\
|
and p.waveform_id.network_code == network\
|
||||||
and p.phase_hint == phase\
|
and p.phase_hint == phase\
|
||||||
and (str(p.method_id) in str(method)\
|
and (str(p.method_id) in str(method)
|
||||||
or str(method) in str(p.method_id)):
|
or str(method) in str(p.method_id)):
|
||||||
p.time, p.time_errors, p.waveform_id.network_code, p.method_id = time, err, network, method
|
p.time, p.time_errors, p.waveform_id.network_code, p.method_id = time, err, network, method
|
||||||
del time, err, phase, station, network, method
|
del time, err, phase, station, network, method
|
||||||
@ -907,14 +907,14 @@ def getQualitiesfromxml(xmlnames, ErrorsP, ErrorsS, plotflag=1):
|
|||||||
for mpick in arrivals_copy:
|
for mpick in arrivals_copy:
|
||||||
phase = identifyPhase(loopIdentifyPhase(Pick.phase_hint))
|
phase = identifyPhase(loopIdentifyPhase(Pick.phase_hint))
|
||||||
if phase == 'P':
|
if phase == 'P':
|
||||||
if ((mpick.waveform_id.station_code == mstation) or \
|
if ((mpick.waveform_id.station_code == mstation) or
|
||||||
(mpick.waveform_id.station_code == mstation_ext)) and \
|
(mpick.waveform_id.station_code == mstation_ext)) and \
|
||||||
((mpick.method_id).split('/')[1] == 'auto') and \
|
((mpick.method_id).split('/')[1] == 'auto') and \
|
||||||
(mpick.time_errors['uncertainty'] <= ErrorsP[3]):
|
(mpick.time_errors['uncertainty'] <= ErrorsP[3]):
|
||||||
del mpick
|
del mpick
|
||||||
break
|
break
|
||||||
elif phase == 'S':
|
elif phase == 'S':
|
||||||
if ((mpick.waveform_id.station_code == mstation) or \
|
if ((mpick.waveform_id.station_code == mstation) or
|
||||||
(mpick.waveform_id.station_code == mstation_ext)) and \
|
(mpick.waveform_id.station_code == mstation_ext)) and \
|
||||||
((mpick.method_id).split('/')[1] == 'auto') and \
|
((mpick.method_id).split('/')[1] == 'auto') and \
|
||||||
(mpick.time_errors['uncertainty'] <= ErrorsS[3]):
|
(mpick.time_errors['uncertainty'] <= ErrorsS[3]):
|
||||||
|
@ -859,7 +859,7 @@ def autopickstation(wfstream, pickparam, verbose=False,
|
|||||||
hdat += ndat
|
hdat += ndat
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print('autopickstation: No horizontal component data available or ' \
|
print('autopickstation: No horizontal component data available or '
|
||||||
'bad P onset, skipping S picking!')
|
'bad P onset, skipping S picking!')
|
||||||
|
|
||||||
##############################################################
|
##############################################################
|
||||||
|
@ -26,7 +26,7 @@ class CharacteristicFunction(object):
|
|||||||
SuperClass for different types of characteristic functions.
|
SuperClass for different types of characteristic functions.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
def __init__(self, data, cut, t2=None, order=None, t1=None, fnoise=None, stealthMode=False):
|
def __init__(self, data, cut, t2=None, order=None, t1=None, fnoise=None):
|
||||||
'''
|
'''
|
||||||
Initialize data type object with information from the original
|
Initialize data type object with information from the original
|
||||||
Seismogram.
|
Seismogram.
|
||||||
@ -63,7 +63,6 @@ class CharacteristicFunction(object):
|
|||||||
self.calcCF(self.getDataArray())
|
self.calcCF(self.getDataArray())
|
||||||
self.arpara = np.array([])
|
self.arpara = np.array([])
|
||||||
self.xpred = np.array([])
|
self.xpred = np.array([])
|
||||||
self._stealthMode = stealthMode
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return '''\n\t{name} object:\n
|
return '''\n\t{name} object:\n
|
||||||
@ -137,9 +136,6 @@ class CharacteristicFunction(object):
|
|||||||
def getXCF(self):
|
def getXCF(self):
|
||||||
return self.xcf
|
return self.xcf
|
||||||
|
|
||||||
def _getStealthMode(self):
|
|
||||||
return self._stealthMode()
|
|
||||||
|
|
||||||
def getDataArray(self, cut=None):
|
def getDataArray(self, cut=None):
|
||||||
'''
|
'''
|
||||||
If cut times are given, time series is cut from cut[0] (start time)
|
If cut times are given, time series is cut from cut[0] (start time)
|
||||||
@ -224,8 +220,6 @@ class AICcf(CharacteristicFunction):
|
|||||||
|
|
||||||
def calcCF(self, data):
|
def calcCF(self, data):
|
||||||
|
|
||||||
# if self._getStealthMode() is False:
|
|
||||||
# print 'Calculating AIC ...'
|
|
||||||
x = self.getDataArray()
|
x = self.getDataArray()
|
||||||
xnp = x[0].data
|
xnp = x[0].data
|
||||||
nn = np.isnan(xnp)
|
nn = np.isnan(xnp)
|
||||||
@ -264,13 +258,9 @@ class HOScf(CharacteristicFunction):
|
|||||||
if len(nn) > 1:
|
if len(nn) > 1:
|
||||||
xnp[nn] = 0
|
xnp[nn] = 0
|
||||||
if self.getOrder() == 3: # this is skewness
|
if self.getOrder() == 3: # this is skewness
|
||||||
# if self._getStealthMode() is False:
|
|
||||||
# print 'Calculating skewness ...'
|
|
||||||
y = np.power(xnp, 3)
|
y = np.power(xnp, 3)
|
||||||
y1 = np.power(xnp, 2)
|
y1 = np.power(xnp, 2)
|
||||||
elif self.getOrder() == 4: # this is kurtosis
|
elif self.getOrder() == 4: # this is kurtosis
|
||||||
# if self._getStealthMode() is False:
|
|
||||||
# print 'Calculating kurtosis ...'
|
|
||||||
y = np.power(xnp, 4)
|
y = np.power(xnp, 4)
|
||||||
y1 = np.power(xnp, 2)
|
y1 = np.power(xnp, 2)
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ def earllatepicker(X, nfac, TSNR, Pick1, iplot=0, verbosity=1, fig=None, linecol
|
|||||||
|
|
||||||
# get earliest possible pick
|
# get earliest possible pick
|
||||||
|
|
||||||
EPick = np.nan;
|
EPick = np.nan
|
||||||
count = 0
|
count = 0
|
||||||
pis = isignal
|
pis = isignal
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ def earllatepicker(X, nfac, TSNR, Pick1, iplot=0, stealthMode=False):
|
|||||||
|
|
||||||
# get earliest possible pick
|
# get earliest possible pick
|
||||||
|
|
||||||
EPick = np.nan;
|
EPick = np.nan
|
||||||
count = 0
|
count = 0
|
||||||
pis = isignal
|
pis = isignal
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ def run_makeCF(project, database, event, iplot, station=None):
|
|||||||
plt.ylim([-1.5, 1.5])
|
plt.ylim([-1.5, 1.5])
|
||||||
plt.xlabel('Time [s]')
|
plt.xlabel('Time [s]')
|
||||||
plt.ylabel('Normalized Counts')
|
plt.ylabel('Normalized Counts')
|
||||||
plt.title('%s, %s, CF-SNR=%7.2f, CF-Slope=%12.2f' % (tr.stats.station, \
|
plt.title('%s, %s, CF-SNR=%7.2f, CF-Slope=%12.2f' % (tr.stats.station,
|
||||||
tr.stats.channel, aicpick.getSNR(),
|
tr.stats.channel, aicpick.getSNR(),
|
||||||
aicpick.getSlope()))
|
aicpick.getSlope()))
|
||||||
plt.suptitle(tr.stats.starttime)
|
plt.suptitle(tr.stats.starttime)
|
||||||
@ -223,9 +223,9 @@ def run_makeCF(project, database, event, iplot, station=None):
|
|||||||
plt.plot([arhpick.getpick() - 0.5, arhpick.getpick() + 0.5], [-1, -1], 'r')
|
plt.plot([arhpick.getpick() - 0.5, arhpick.getpick() + 0.5], [-1, -1], 'r')
|
||||||
plt.plot([arhELpick.getLpick(), arhELpick.getLpick()], [-0.8, 0.8], 'r--')
|
plt.plot([arhELpick.getLpick(), arhELpick.getLpick()], [-0.8, 0.8], 'r--')
|
||||||
plt.plot([arhELpick.getEpick(), arhELpick.getEpick()], [-0.8, 0.8], 'r--')
|
plt.plot([arhELpick.getEpick(), arhELpick.getEpick()], [-0.8, 0.8], 'r--')
|
||||||
plt.plot([arhpick.getpick() + arhELpick.getPickError(), arhpick.getpick() + arhELpick.getPickError()], \
|
plt.plot([arhpick.getpick() + arhELpick.getPickError(), arhpick.getpick() + arhELpick.getPickError()],
|
||||||
[-0.2, 0.2], 'r--')
|
[-0.2, 0.2], 'r--')
|
||||||
plt.plot([arhpick.getpick() - arhELpick.getPickError(), arhpick.getpick() - arhELpick.getPickError()], \
|
plt.plot([arhpick.getpick() - arhELpick.getPickError(), arhpick.getpick() - arhELpick.getPickError()],
|
||||||
[-0.2, 0.2], 'r--')
|
[-0.2, 0.2], 'r--')
|
||||||
plt.yticks([])
|
plt.yticks([])
|
||||||
plt.ylim([-1.5, 1.5])
|
plt.ylim([-1.5, 1.5])
|
||||||
@ -245,9 +245,9 @@ def run_makeCF(project, database, event, iplot, station=None):
|
|||||||
plt.plot([arhpick.getpick() - 0.5, arhpick.getpick() + 0.5], [-1, -1], 'r')
|
plt.plot([arhpick.getpick() - 0.5, arhpick.getpick() + 0.5], [-1, -1], 'r')
|
||||||
plt.plot([arhELpick.getLpick(), arhELpick.getLpick()], [-0.8, 0.8], 'r--')
|
plt.plot([arhELpick.getLpick(), arhELpick.getLpick()], [-0.8, 0.8], 'r--')
|
||||||
plt.plot([arhELpick.getEpick(), arhELpick.getEpick()], [-0.8, 0.8], 'r--')
|
plt.plot([arhELpick.getEpick(), arhELpick.getEpick()], [-0.8, 0.8], 'r--')
|
||||||
plt.plot([arhpick.getpick() + arhELpick.getPickError(), arhpick.getpick() + arhELpick.getPickError()], \
|
plt.plot([arhpick.getpick() + arhELpick.getPickError(), arhpick.getpick() + arhELpick.getPickError()],
|
||||||
[-0.2, 0.2], 'r--')
|
[-0.2, 0.2], 'r--')
|
||||||
plt.plot([arhpick.getpick() - arhELpick.getPickError(), arhpick.getpick() - arhELpick.getPickError()], \
|
plt.plot([arhpick.getpick() - arhELpick.getPickError(), arhpick.getpick() - arhELpick.getPickError()],
|
||||||
[-0.2, 0.2], 'r--')
|
[-0.2, 0.2], 'r--')
|
||||||
plt.title([trH2_filt.stats.station, trH2_filt.stats.channel])
|
plt.title([trH2_filt.stats.station, trH2_filt.stats.channel])
|
||||||
plt.yticks([])
|
plt.yticks([])
|
||||||
|
2
setup.py
2
setup.py
@ -8,7 +8,7 @@ setup(
|
|||||||
packages=['pylot', 'pylot.core', 'pylot.core.loc', 'pylot.core.pick',
|
packages=['pylot', 'pylot.core', 'pylot.core.loc', 'pylot.core.pick',
|
||||||
'pylot.core.io', 'pylot.core.util', 'pylot.core.active',
|
'pylot.core.io', 'pylot.core.util', 'pylot.core.active',
|
||||||
'pylot.core.analysis', 'pylot.testing'],
|
'pylot.core.analysis', 'pylot.testing'],
|
||||||
requires=['obspy', 'PySide'],
|
requires=['obspy', 'PySide', 'matplotlib', 'numpy'],
|
||||||
url='dummy',
|
url='dummy',
|
||||||
license='LGPLv3',
|
license='LGPLv3',
|
||||||
author='Sebastian Wehling-Benatelli',
|
author='Sebastian Wehling-Benatelli',
|
||||||
|
Loading…
Reference in New Issue
Block a user