[change] check for real bool
This commit is contained in:
parent
c6fa6d8ff8
commit
4b6b3de547
@ -19,7 +19,7 @@ from pylot.core.pick.picker import AICPicker, PragPicker
|
|||||||
from pylot.core.pick.utils import checksignallength, checkZ4S, earllatepicker, \
|
from pylot.core.pick.utils import checksignallength, checkZ4S, earllatepicker, \
|
||||||
getSNR, fmpicker, checkPonsets, wadaticheck
|
getSNR, fmpicker, checkPonsets, wadaticheck
|
||||||
from pylot.core.util.utils import getPatternLine, gen_Pool, identifyPhase, loopIdentifyPhase, \
|
from pylot.core.util.utils import getPatternLine, gen_Pool, identifyPhase, loopIdentifyPhase, \
|
||||||
full_range
|
real_Bool
|
||||||
|
|
||||||
from obspy.taup import TauPyModel
|
from obspy.taup import TauPyModel
|
||||||
|
|
||||||
@ -140,7 +140,7 @@ def autopickstation(wfstream, pickparam, verbose=False,
|
|||||||
algoS = pickparam.get('algoS')
|
algoS = pickparam.get('algoS')
|
||||||
sstart = pickparam.get('sstart')
|
sstart = pickparam.get('sstart')
|
||||||
sstop = pickparam.get('sstop')
|
sstop = pickparam.get('sstop')
|
||||||
use_taup = pickparam.get('use_taup')
|
use_taup = real_Bool(pickparam.get('use_taup'))
|
||||||
taup_model = pickparam.get('taup_model')
|
taup_model = pickparam.get('taup_model')
|
||||||
bph1 = pickparam.get('bph1')
|
bph1 = pickparam.get('bph1')
|
||||||
bph2 = pickparam.get('bph2')
|
bph2 = pickparam.get('bph2')
|
||||||
@ -229,7 +229,7 @@ def autopickstation(wfstream, pickparam, verbose=False,
|
|||||||
|
|
||||||
# for global seismology: use tau-p method for estimating travel times (needs source and station coords.)
|
# for global seismology: use tau-p method for estimating travel times (needs source and station coords.)
|
||||||
# if not given: sets Lc to infinity to use full stream
|
# if not given: sets Lc to infinity to use full stream
|
||||||
if use_taup == True or use_taup == 'True':
|
if use_taup:
|
||||||
Lc = np.inf
|
Lc = np.inf
|
||||||
print('autopickstation: use_taup flag active.')
|
print('autopickstation: use_taup flag active.')
|
||||||
if not metadata[1]:
|
if not metadata[1]:
|
||||||
@ -262,14 +262,23 @@ def autopickstation(wfstream, pickparam, verbose=False,
|
|||||||
# modifiy pstart and pstop relative to estimated first P arrival (relative to station time axis)
|
# modifiy pstart and pstop relative to estimated first P arrival (relative to station time axis)
|
||||||
pstart += (source_origin.time + estFirstP) - zdat[0].stats.starttime
|
pstart += (source_origin.time + estFirstP) - zdat[0].stats.starttime
|
||||||
pstop += (source_origin.time + estFirstP) - zdat[0].stats.starttime
|
pstop += (source_origin.time + estFirstP) - zdat[0].stats.starttime
|
||||||
Lc = pstop - pstart
|
|
||||||
print('autopick: CF calculation times respectively:'
|
print('autopick: CF calculation times respectively:'
|
||||||
' pstart: {} s, pstop: {} s'.format(pstart, pstop))
|
' pstart: {} s, pstop: {} s'.format(pstart, pstop))
|
||||||
elif not origin:
|
elif not origin:
|
||||||
print('No source origins given!')
|
print('No source origins given!')
|
||||||
else:
|
|
||||||
|
# make sure pstart and pstop are inside zdat[0]
|
||||||
|
pstart = max(pstart, 0)
|
||||||
|
pstop = min(pstop, len(zdat[0])*zdat[0].stats.delta)
|
||||||
|
|
||||||
|
if not use_taup or origin:
|
||||||
Lc = pstop - pstart
|
Lc = pstop - pstart
|
||||||
|
|
||||||
Lwf = zdat[0].stats.endtime - zdat[0].stats.starttime
|
Lwf = zdat[0].stats.endtime - zdat[0].stats.starttime
|
||||||
|
if not Lwf > 0:
|
||||||
|
print('autopickstation: empty trace! Return!')
|
||||||
|
return
|
||||||
|
|
||||||
Ldiff = Lwf - Lc
|
Ldiff = Lwf - Lc
|
||||||
if Ldiff < 0:
|
if Ldiff < 0:
|
||||||
msg = 'autopickstation: Cutting times are too large for actual ' \
|
msg = 'autopickstation: Cutting times are too large for actual ' \
|
||||||
|
@ -221,6 +221,15 @@ def real_None(value):
|
|||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
||||||
|
def real_Bool(value):
|
||||||
|
if value == 'True':
|
||||||
|
return True
|
||||||
|
elif value == 'False':
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
return value
|
||||||
|
|
||||||
|
|
||||||
def four_digits(year):
|
def four_digits(year):
|
||||||
"""
|
"""
|
||||||
takes a two digit year integer and returns the correct four digit equivalent
|
takes a two digit year integer and returns the correct four digit equivalent
|
||||||
|
Loading…
Reference in New Issue
Block a user