[bugfix] Taupy used even if disabled when p start time > 0

If Taupy was disabled, but pstart was larger than zero, the and would lead to the function that modifies starttimes not exiting. This resulted in taupy being used even though it was disabled when the p starttime was above 0.
This commit is contained in:
Darius Arnold 2018-08-08 21:45:17 +02:00
parent 9929e3d441
commit b7d3568498

View File

@ -514,10 +514,11 @@ class AutopickStation(object):
' origin time using TauPy'.format(estFirstP, estFirstS))
return estFirstP, estFirstS
if (self.p_params.use_taup is False or not self.origin) and self.p_params.pstart < 0:
if self.p_params.use_taup is False or not self.origin or not self.metadata:
# correct user mistake where a relative cuttime is selected (pstart < 0) but use of taupy is disabled/ has
# not the required parameters
self.p_params.pstart = 0
if self.p_params.pstart < 0:
self.p_params.pstart = 0
return
print('autopickstation: use_taup flag active.')