Export of phases for VELEST, hypoDD and HASH only possible if event location is available.

This commit is contained in:
Ludger Küperkoch 2017-03-22 12:02:01 +01:00
parent 92a1c77f9c
commit 15fd175813

View File

@ -2,7 +2,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import print_function from __future__ import print_function
import pdb
import argparse import argparse
import glob import glob
import os import os
@ -114,6 +114,13 @@ def autoPyLoT(inputfile):
for event in events: for event in events:
data.setWFData(glob.glob(os.path.join(datapath, event, '*'))) data.setWFData(glob.glob(os.path.join(datapath, event, '*')))
evID = os.path.split(event)[-1] evID = os.path.split(event)[-1]
# the following is necessary because within
# multiple event processing no event ID is provided
# in autopylot.in
try:
parameter.get('eventID')
except:
parameter.setParam(eventID=event)
print('Working on event %s' % event) print('Working on event %s' % event)
print(data) print(data)
wfdat = data.getWFData() # all available streams wfdat = data.getWFData() # all available streams
@ -229,6 +236,7 @@ def autoPyLoT(inputfile):
print("Network moment magnitude: %4.1f" % net_mw.mag) print("Network moment magnitude: %4.1f" % net_mw.mag)
else: else:
print("autoPyLoT: No NLLoc-location file available! Stop iteration!") print("autoPyLoT: No NLLoc-location file available! Stop iteration!")
locflag = 9
########################################################## ##########################################################
# write phase files for various location # write phase files for various location
# and fault mechanism calculation routines # and fault mechanism calculation routines
@ -244,6 +252,7 @@ def autoPyLoT(inputfile):
# HYPOSAT # HYPOSAT
hyposatfile = '%s/autoPyLoT_HYPOSAT_phases' % event hyposatfile = '%s/autoPyLoT_HYPOSAT_phases' % event
hyposat.export(picks, hyposatfile, parameter) hyposat.export(picks, hyposatfile, parameter)
if locflag == 1:
# VELEST # VELEST
velestfile = '%s/autoPyLoT_VELEST_phases.cnv' % event velestfile = '%s/autoPyLoT_VELEST_phases.cnv' % event
velest.export(picks, velestfile, parameter, evt) velest.export(picks, velestfile, parameter, evt)