export and save picks to hard drive

This commit is contained in:
Sebastian Wehling-Benatelli 2015-07-13 09:24:16 +02:00
parent 108d6c75d6
commit e31890d8fc
2 changed files with 15 additions and 5 deletions

View File

@ -1 +1 @@
1abc-dirty 108d-dirty

View File

@ -3,9 +3,9 @@
import os import os
from obspy.core import (read, Stream, UTCDateTime) from obspy.core import read, Stream, UTCDateTime
from obspy import readEvents, read_inventory from obspy import readEvents, read_inventory
from obspy.core.event import (Event, Catalog) from obspy.core.event import Event, Catalog, ResourceIdentifier
from pylot.core.read.io import readPILOTEvent from pylot.core.read.io import readPILOTEvent
from pylot.core.util.utils import fnConstructor, getGlobalTimes from pylot.core.util.utils import fnConstructor, getGlobalTimes
@ -156,10 +156,20 @@ class Data(object):
def getEvtData(self): def getEvtData(self):
return self.evtdata return self.evtdata
def applyEVTData(self, data, type='pick'): def applyEVTData(self, data, type='pick', authority_id='rub'):
def applyPicks(picks): def applyPicks(picks):
pass firstonset = None
for phase in picks:
onset = picks[phase]['epp']
if firstonset is None or firstonset > onset:
firstonset = onset
if 'smi:local' in self.getID():
fonset_str = firstonset.strftime('%Y_%m_%d_%H_%M_%S')
ID = ResourceIdentifier(fonset_str)
ID.convertIDToQuakeMLURI(authority_id=authority_id)
def applyArrivals(arrivals): def applyArrivals(arrivals):
pass pass
def applyEvent(event): def applyEvent(event):