Merge branch 'feature/port-to-python-3.9.0' of ssh://ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into feature/port-to-python-3.9.0

This commit is contained in:
Sebastian Wehling-Benatelli 2021-01-29 11:06:42 +01:00
commit 21f4567236
7 changed files with 106556 additions and 113472 deletions

1857
PyLoT.py

File diff suppressed because it is too large Load Diff

View File

@ -66,20 +66,34 @@ PyLoT has been tested on Mac OSX (10.11), Debian Linux 8 and on Windows 10.
#### Features: #### Features:
- event organisation in project files and waveform visualisation - centralize all functionalities of PyLoT and control them from within the main GUI
- consistent manual phase picking through predefined SNR dependant zoom level - handling multiple events inside GUI with project files (save and load work progress)
- consistent automatic phase picking routines using Higher Order Statistics, AIC and Autoregression - GUI based adjustments of pick parameters and I/O
- interactive tuning of auto-pick parameters - interactive tuning of parameters from within the GUI
- uniform uncertainty estimation from waveform's properties for automatic and manual picks - call automatic picking algorithm from within the GUI
- pdf representation and comparison of picks taking the uncertainty intrinsically into account - comparison of automatic with manual picks for multiple events using clear differentiation of manual picks into 'tune' and 'test-set' (beta)
- Richter and moment magnitude estimation - manual picking of different (user defined) phase types
- location determination with external installation of [NonLinLoc](http://alomax.free.fr/nlloc/index.html) - phase onset estimation with ObsPy TauPy
- interactive zoom/scale functionalities in all plots (mousewheel, pan, pan-zoom)
- array map to visualize stations and control onsets (beta feature, switch to manual picks not implemented)
#### Known issues: ##### Platform support:
- Python 3 support
- Windows support
- Sometimes an error might occur when using Qt ##### Performance:
- multiprocessing for automatic picking and restitution of multiple stations
- use pyqtgraph library for better performance on main waveform plot
We hope to solve these with the next release. ##### Visualization:
- pick uncertainty (quality classes) visualization with gradients
- pick color unification for all plots
- new icons and stylesheets
#### Known Issues:
- some Qt related errors might occur at runtime
- filter toggle not working in pickDlg
- PyLoT data structure requires at least three parent directories for waveform data directory
## Staff ## Staff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,8 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import sys, os, traceback
import multiprocessing import multiprocessing
import os from PySide2.QtCore import QThread, Signal, Qt, Slot, QRunnable, QObject
import sys from PySide2.QtWidgets import QDialog, QProgressBar, QLabel, QHBoxLayout, QPushButton
import traceback
from PySide.QtCore import QThread, Signal, Qt, Slot, QRunnable, QObject
from PySide.QtGui import QDialog, QProgressBar, QLabel, QHBoxLayout
class Thread(QThread): class Thread(QThread):
@ -27,7 +24,7 @@ class Thread(QThread):
if self.redirect_stdout: if self.redirect_stdout:
sys.stdout = self sys.stdout = self
try: try:
if self.arg is not None: if self.arg:
self.data = self.func(self.arg) self.data = self.func(self.arg)
else: else:
self.data = self.func() self.data = self.func()
@ -36,20 +33,31 @@ class Thread(QThread):
self._executed = False self._executed = False
self._executedError = e self._executedError = e
traceback.print_exc() traceback.print_exc()
exctype, value = sys.exc_info()[:2] exctype, value = sys.exc_info ()[:2]
self._executedErrorInfo = '{} {} {}'. \ self._executedErrorInfo = '{} {} {}'.\
format(exctype, value, traceback.format_exc()) format(exctype, value, traceback.format_exc())
sys.stdout = sys.__stdout__ sys.stdout = sys.__stdout__
def showProgressbar(self): def showProgressbar(self):
if self.progressText: if self.progressText:
# # generate widget if not given in init
# if not self.pb_widget:
# self.pb_widget = ProgressBarWidget(self.parent())
# self.pb_widget.setWindowFlags(Qt.SplashScreen)
# self.pb_widget.setModal(True)
self.pb_widget.label.setText(self.progressText) # generate widget if not given in init
if not self.pb_widget:
self.pb_widget = QDialog(self.parent())
self.pb_widget.setWindowFlags(Qt.SplashScreen)
self.pb_widget.setModal(True)
# add button
delete_button = QPushButton('X')
delete_button.clicked.connect(self.exit)
hl = QHBoxLayout()
pb = QProgressBar()
pb.setRange(0, 0)
hl.addWidget(pb)
hl.addWidget(QLabel(self.progressText))
if self.abortButton:
hl.addWidget(delete_button)
self.pb_widget.setLayout(hl)
self.pb_widget.show() self.pb_widget.show()
def hideProgressbar(self): def hideProgressbar(self):
@ -67,7 +75,6 @@ class Worker(QRunnable):
''' '''
Worker class to be run by MultiThread(QThread). Worker class to be run by MultiThread(QThread).
''' '''
def __init__(self, fun, args, def __init__(self, fun, args,
progressText=None, progressText=None,
pb_widget=None, pb_widget=None,
@ -75,7 +82,7 @@ class Worker(QRunnable):
super(Worker, self).__init__() super(Worker, self).__init__()
self.fun = fun self.fun = fun
self.args = args self.args = args
# self.kwargs = kwargs #self.kwargs = kwargs
self.signals = WorkerSignals() self.signals = WorkerSignals()
self.progressText = progressText self.progressText = progressText
self.pb_widget = pb_widget self.pb_widget = pb_widget
@ -89,9 +96,9 @@ class Worker(QRunnable):
try: try:
result = self.fun(self.args) result = self.fun(self.args)
except: except:
exctype, value = sys.exc_info()[:2] exctype, value = sys.exc_info ()[:2]
print(exctype, value, traceback.format_exc()) print(exctype, value, traceback.format_exc())
self.signals.error.emit((exctype, value, traceback.format_exc())) self.signals.error.emit ((exctype, value, traceback.format_exc ()))
else: else:
self.signals.result.emit(result) self.signals.result.emit(result)
finally: finally:
@ -133,13 +140,13 @@ class MultiThread(QThread):
def run(self): def run(self):
if self.redirect_stdout: if self.redirect_stdout:
sys.stdout = self sys.stdout = self
try: try:
if not self.ncores: if not self.ncores:
self.ncores = multiprocessing.cpu_count() self.ncores = multiprocessing.cpu_count()
pool = multiprocessing.Pool(self.ncores) pool = multiprocessing.Pool(self.ncores)
self.data = pool.map_async(self.func, self.args, callback=self.emitDone) self.data = pool.map_async(self.func, self.args, callback=self.emitDone)
# self.data = pool.apply_async(self.func, self.shotlist, callback=self.emitDone) #emit each time returned #self.data = pool.apply_async(self.func, self.shotlist, callback=self.emitDone) #emit each time returned
pool.close() pool.close()
self._executed = True self._executed = True
except Exception as e: except Exception as e:

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff