Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop

Conflicts:
	autoPyLoT.py
This commit is contained in:
Ludger Küperkoch
2015-11-05 08:47:06 +01:00
8 changed files with 208 additions and 83 deletions

View File

@@ -32,19 +32,17 @@ def autoPyLoT(inputfile):
.. rubric:: Example
"""
print '************************************'
print '*********autoPyLoT starting*********'
print 'The Python picking and Location Tool'
print ' Version ', _getVersionString(), '2015'
print ' '
print 'Authors:'
print 'S. Wehling-Benatelli'
print ' Ruhr-Universität Bochum'
print 'L. Küperkoch'
print ' BESTEC GmbH, Landau (Pfalz)'
print 'K. Olbert'
print ' Christian-Albrechts Universität Kiel'
print '************************************'
splash = '''************************************\n
*********autoPyLoT starting*********\n
The Python picking and Location Tool\n
Version {version} 2015\n
\n
Authors:\n
S. Wehling-Benatelli (Ruhr-Universität Bochum)\n
L. Küperkoch (BESTEC GmbH, Landau i. d. Pfalz)\n
K. Olbert (Christian-Albrechts Universität zu Kiel)\n
***********************************'''.format(version=_getVersionString())
print(splash)
# reading parameter file
@@ -77,7 +75,7 @@ def autoPyLoT(inputfile):
# get path to NLLoc executable
nllocbin = parameter.getParam('nllocbin')
nlloccall = '%s/NLLoc' % nllocbin
# get name of phase file
# get name of phase file
phasef = parameter.getParam('phasefile')
phasefile = '%s/obs/%s' % (nllocroot, phasef)
# get name of NLLoc-control file
@@ -99,8 +97,8 @@ def autoPyLoT(inputfile):
if not parameter.hasParam('eventID'):
for event in [events for events in glob.glob(os.path.join(datapath, '*')) if os.path.isdir(events)]:
data.setWFData(glob.glob(os.path.join(datapath, event, '*')))
print 'Working on event %s' % event
print data
print('Working on event %s' % event)
print(data)
wfdat = data.getWFData() # all available streams
##########################################################
@@ -148,7 +146,7 @@ def autoPyLoT(inputfile):
##########################################################
# !automated picking starts here!
picks = autopickevent(wfdat, parameter)
##########################################################
# locating
if locflag == 1:
@@ -166,20 +164,24 @@ def autoPyLoT(inputfile):
filedata = nllfile.read()
if filedata.find(locfiles) < 0:
# replace old command
filedata = filedata.replace('LOCFILES', locfiles)
nllfile = open(locfile, 'w')
nllfile.write(filedata)
nllfile.close()
filedata = filedata.replace('LOCFILES', locfiles)
nllfile = open(locfile, 'w')
nllfile.write(filedata)
nllfile.close()
# locate the event
subprocess.call([nlloccall, locfile])
##########################################################
<<<<<<< HEAD
# write phase files for various location routines
# HYPO71
hypo71file = '%s/%s/autoPyLoT_HYPO71.pha' % (datapath, parameter.getParam('eventID'))
writephases(picks, 'HYPO71', hypo71file)
=======
>>>>>>> 223902f2d4a9fe992730bb1ba925bfa432f26550
print '------------------------------------------'
print '-------Finished event %s!-------' % parameter.getParam('eventID')