[bugfix] station name was in dictionary instead of a list item for autopickstations return value
Old implementation of autopickstation returned a list containing a dcitionary with results as a first value and a string with the station name as a second value. The new version used to return a single dict with a key/value station name pair, which the calling code could not unpack. The new implementation now also returns a list with picking results and station name.
This commit is contained in:
parent
2b9cf655ae
commit
0c4085ed76
@ -553,7 +553,7 @@ class AutopickStation(object):
|
|||||||
|
|
||||||
self.plot_pick_results()
|
self.plot_pick_results()
|
||||||
self.finish_picking()
|
self.finish_picking()
|
||||||
return {'P': self.p_results, 'S':self.s_results, 'station':self.ztrace.stats.station}
|
return [{'P': self.p_results, 'S':self.s_results}, self.ztrace.stats.station]
|
||||||
|
|
||||||
def finish_picking(self):
|
def finish_picking(self):
|
||||||
|
|
||||||
@ -1165,7 +1165,11 @@ def autopickstation(wfstream, pickparam, verbose=False, iplot=0, fig_dict=None,
|
|||||||
except MissingTraceException as e:
|
except MissingTraceException as e:
|
||||||
# Either vertical or both horizontal traces are missing
|
# Either vertical or both horizontal traces are missing
|
||||||
print(e)
|
print(e)
|
||||||
return None
|
try:
|
||||||
|
station_name = wfstream[0].stats.station
|
||||||
|
except IndexError:
|
||||||
|
station_name = 'None'
|
||||||
|
return None, station_name
|
||||||
|
|
||||||
|
|
||||||
def nautopickstation(wfstream, pickparam, verbose=False,
|
def nautopickstation(wfstream, pickparam, verbose=False,
|
||||||
|
Loading…
Reference in New Issue
Block a user