[Bugfix] 'NoneType' object has no attribute 'axes'.

This commit is contained in:
Ludger Küperkoch 2017-08-08 11:53:21 +02:00
parent 6891591ae9
commit cc2da4fc41

View File

@ -289,7 +289,7 @@ def autopickstation(wfstream, pickparam, verbose=False,
fig = None fig = None
aicpick = AICPicker(aiccf, tsnrz, pickwinP, iplot, None, tsmoothP, fig=fig) aicpick = AICPicker(aiccf, tsnrz, pickwinP, iplot, None, tsmoothP, fig=fig)
# add pstart and pstop to aic plot # add pstart and pstop to aic plot
if fig.axes: if fig:
for ax in fig.axes: for ax in fig.axes:
ax.vlines(pstart, ax.get_ylim()[0], ax.get_ylim()[1], color='c', linestyles='dashed', label='P start') ax.vlines(pstart, ax.get_ylim()[0], ax.get_ylim()[1], color='c', linestyles='dashed', label='P start')
ax.vlines(pstop, ax.get_ylim()[0], ax.get_ylim()[1], color='c', linestyles='dashed', label='P stop') ax.vlines(pstop, ax.get_ylim()[0], ax.get_ylim()[1], color='c', linestyles='dashed', label='P stop')
@ -736,14 +736,6 @@ def autopickstation(wfstream, pickparam, verbose=False,
# re-create stream object including both horizontal components # re-create stream object including both horizontal components
hdat = edat.copy() hdat = edat.copy()
hdat += ndat hdat += ndat
elif (edat is not None and len(edat) > 0 and ndat is None) or (
edat is None and ndat is not None and len(ndat) > 0) and Pweight < 4:
msg = 'Go on picking S onset ...\n' \
'##################################################\n' \
'Using only one horizontal component!' \
'Working on S onset of station {0}\nFiltering horizontal ' \
'traces ...'.format(edat[0].stats.station)
if verbose: print(msg)
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!')