[bugfix] various, pick delete/plot behaviour

This commit is contained in:
2018-07-18 14:12:59 +02:00
parent 12082cb2a9
commit 90e26cbd8f
7 changed files with 28 additions and 20 deletions

View File

@@ -405,7 +405,7 @@ class Data(object):
# various pre-processing steps:
# remove possible underscores in station names
self.wfdata = remove_underscores(self.wfdata)
#self.wfdata = remove_underscores(self.wfdata)
# check for stations with rotated components
if checkRotated and metadata is not None:
self.wfdata = check4rotated(self.wfdata, metadata, verbosity=0)

View File

@@ -580,7 +580,7 @@ def restitute_data(data, metadata, unit='VEL', force=False, ncores=0):
restflag = list()
data = remove_underscores(data)
#data = remove_underscores(data)
# loop over traces
input_tuples = []

View File

@@ -185,7 +185,8 @@ class Event(ObsPyEvent):
self.pylot_picks[station] = pick
else:
try:
self.pylot_picks.pop(station)
if station in self.pylot_picks:
self.pylot_picks.pop(station)
except Exception as e:
print('Could not remove pick {} from station {}: {}'.format(pick, station, e))
self.clearObsPyPicks('manual')
@@ -236,7 +237,8 @@ class Event(ObsPyEvent):
self.pylot_autopicks[station] = pick
else:
try:
self.pylot_autopicks.pop(station)
if station in self.pylot_autopicks:
self.pylot_autopicks.pop(station)
except Exception as e:
print('Could not remove pick {} from station {}: {}'.format(pick, station, e))
self.clearObsPyPicks('auto')

View File

@@ -399,6 +399,10 @@ def full_range(stream):
:return: minimum start time and maximum end time
:rtype: (`~maximum start time and minimum end time`, maximum start time and minimum end time)
"""
if not stream:
print('full_range: Empty Stream!')
return None, None
min_start = min([trace.stats.starttime for trace in stream])
max_end = max([trace.stats.endtime for trace in stream])
@@ -831,9 +835,9 @@ def remove_underscores(data):
:return: data stream
:rtype: `~obspy.core.stream.Stream`
"""
for tr in data:
# remove underscores
tr.stats.station = tr.stats.station.strip('_')
#for tr in data:
# # remove underscores
# tr.stats.station = tr.stats.station.strip('_')
return data

View File

@@ -2525,8 +2525,9 @@ class PickDlg(QDialog):
if phase in self.phaseLines.keys():
del (self.phaseLines[phase])
# information output
msg = 'Deleted {} pick for phase {}, at timestamp {} (relative time: {} s)'
print(msg.format(picktype, phase, self.getStartTime() + pick_rel, pick_rel))
msg = 'Deleted {} pick for phase {}, station {} at timestamp {} (relative time: {} s)'
print(msg.format(picktype, phase, '{}.{}'.format(self.network, self.station),
self.getStartTime() + pick_rel, pick_rel))
self.setDirty(True)
def identify_selected_picks(self, x):
@@ -3167,7 +3168,7 @@ class TuneAutopicker(QWidget):
self.data.setWFData(fnames)
wfdat = self.data.getWFData() # all available streams
# remove possible underscores in station names
wfdat = remove_underscores(wfdat)
#wfdat = remove_underscores(wfdat)
# rotate misaligned stations to ZNE
# check for gaps and doubled channels
check4gaps(wfdat)