Merge branch 'feature/magnitude4QtPyLoT' into develop

Conflicts:
	pylot/core/analysis/magnitude.py
	pylot/core/util/widgets.py
This commit is contained in:
2016-09-29 13:54:18 +02:00
11 changed files with 638 additions and 646 deletions

View File

@@ -216,12 +216,8 @@ def restitute_data(data, invtype, inobj, unit='VEL', force=False):
for tr in data:
seed_id = tr.get_id()
# check, whether this trace has already been corrected
# TODO read actual value of processing key in Trace's stats instead
# of just looking for thr key: if processing is setit doesn't
# necessarily mean that the trace has been corrected so far but only
# processed in some way, e.g. normalized
if 'processing' in tr.stats.keys() \
and np.all(['remove' in p for p in tr.stats.processing]) \
and np.any(['remove' in p for p in tr.stats.processing]) \
and not force:
print("Trace {0} has already been corrected!".format(seed_id))
continue
@@ -254,7 +250,7 @@ def restitute_data(data, invtype, inobj, unit='VEL', force=False):
finv = invlist[0]
inventory = read_inventory(finv, format='STATIONXML')
else:
restflag.append(False)
data.remove(tr)
continue
# apply restitution to data
try:
@@ -270,7 +266,9 @@ def restitute_data(data, invtype, inobj, unit='VEL', force=False):
if msg0 not in e.message or msg1 not in e.message:
raise
else:
restflag.append(False)
# restitution done to copies of data thus deleting traces
# that failed should not be a problem
data.remove(tr)
continue
restflag.append(True)
# check if ALL traces could be restituted, take care of large datasets

View File

@@ -24,3 +24,6 @@ class OverwriteError(IOError):
class ParameterError(Exception):
pass
class ProcessingError(RuntimeError):
pass

View File

@@ -33,8 +33,8 @@ from pylot.core.pick.compare import Comparison
from pylot.core.util.defaults import OUTPUTFORMATS, FILTERDEFAULTS, LOCTOOLS, \
COMPPOSITION_MAP
from pylot.core.util.utils import prepTimeAxis, full_range, scaleWFData, \
demeanTrace, isSorted, findComboBoxIndex, clims, find_horizontals
demeanTrace, isSorted, findComboBoxIndex, clims
import icons_rc
def getDataType(parent):
type = QInputDialog().getItem(parent, "Select phases type", "Type:",
@@ -1377,7 +1377,9 @@ class LocalisationTab(PropTab):
def selectDirectory(self, edit):
selected_directory = QFileDialog.getExistingDirectory()
edit.setText(selected_directory)
# check if string is empty
if selected_directory:
edit.setText(selected_directory)
def getValues(self):
loctool = self.locToolComboBox.currentText()