Implemented new function wadaticheck.

This commit is contained in:
Ludger Küperkoch 2015-06-19 15:27:24 +02:00
parent 613bef1678
commit b91f4c9619

View File

@ -12,7 +12,7 @@ from pylot.core.util import _getVersionString
from pylot.core.read import Data, AutoPickParameter from pylot.core.read import Data, AutoPickParameter
from pylot.core.pick.run_autopicking import run_autopicking from pylot.core.pick.run_autopicking import run_autopicking
from pylot.core.util.structure import DATASTRUCTURE from pylot.core.util.structure import DATASTRUCTURE
from pylot.core.pick.utils import wadaticheck
__version__ = _getVersionString() __version__ = _getVersionString()
@ -35,6 +35,11 @@ def autoPyLoT(inputfile):
parameter = AutoPickParameter(inputfile) parameter = AutoPickParameter(inputfile)
# get some parameters for quality control from
# parameter input file (usually autoPyLoT.in).
wdttolerance = parameter.getParam('wdttolerance')
iplot = parameter.getParam('iplot')
data = Data() data = Data()
# getting information on data structure # getting information on data structure
@ -67,6 +72,10 @@ def autoPyLoT(inputfile):
########################################################## ##########################################################
# !automated picking starts here! # !automated picking starts here!
procstats = [] procstats = []
# initialize dictionary for onsets
picks = None
station = wfdat[0].stats.station
allonsets = {station: picks}
for i in range(len(wfdat)): for i in range(len(wfdat)):
stationID = wfdat[i].stats.station stationID = wfdat[i].stats.station
# check if station has already been processed # check if station has already been processed
@ -74,12 +83,18 @@ def autoPyLoT(inputfile):
procstats.append(stationID) procstats.append(stationID)
# find corresponding streams # find corresponding streams
statdat = wfdat.select(station=stationID) statdat = wfdat.select(station=stationID)
######################################################
# get onset times and corresponding picking errors # get onset times and corresponding picking errors
picks = run_autopicking(statdat, parameter) picks = run_autopicking(statdat, parameter)
######################################################
# add station and corresponding onsets to dictionary
station = stationID
allonsets[station] = picks
# quality control # quality control
# check S-P times (Wadati)
# jackknife on P onset times # jackknife on P onset times
# check S-P times (Wadati)
checkedonsets = wadaticheck(allonsets, wdttolerance, iplot)
# jackknife on S onset times # jackknife on S onset times
print '------------------------------------------' print '------------------------------------------'
print '-----Finished event %s!-----' % event print '-----Finished event %s!-----' % event
@ -100,20 +115,25 @@ def autoPyLoT(inputfile):
station = wfdat[0].stats.station station = wfdat[0].stats.station
allonsets = {station: picks} allonsets = {station: picks}
for i in range(len(wfdat)): for i in range(len(wfdat)):
#for i in range(0,5):
stationID = wfdat[i].stats.station stationID = wfdat[i].stats.station
#check if station has already been processed #check if station has already been processed
if stationID not in procstats: if stationID not in procstats:
procstats.append(stationID) procstats.append(stationID)
#find corresponding streams #find corresponding streams
statdat = wfdat.select(station=stationID) statdat = wfdat.select(station=stationID)
# get onset times and corresponding picking errors ######################################################
# get onset times and corresponding picking parameters
picks = run_autopicking(statdat, parameter) picks = run_autopicking(statdat, parameter)
station = stationID ######################################################
# add station and corresponding onsets to dictionary # add station and corresponding onsets to dictionary
station = stationID
allonsets[station] = picks allonsets[station] = picks
#quality control #quality control
#check S-P times (Wadati)
#jackknife on P onset times #jackknife on P onset times
#check S-P times (Wadati)
checkedonsets = wadaticheck(allonsets, wdttolerance, iplot)
#jackknife on S onset times #jackknife on S onset times
print '------------------------------------------' print '------------------------------------------'
print '-------Finished event %s!-------' % parameter.getParam('eventID') print '-------Finished event %s!-------' % parameter.getParam('eventID')