From e31890d8fcbc07b0f0e31a7119f21b178cc05ecd Mon Sep 17 00:00:00 2001 From: Sebastian Wehling-Benatelli Date: Mon, 13 Jul 2015 09:24:16 +0200 Subject: [PATCH] export and save picks to hard drive --- pylot/RELEASE-VERSION | 2 +- pylot/core/read/data.py | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/pylot/RELEASE-VERSION b/pylot/RELEASE-VERSION index 52c00f77..d034b5be 100644 --- a/pylot/RELEASE-VERSION +++ b/pylot/RELEASE-VERSION @@ -1 +1 @@ -1abc-dirty +108d-dirty diff --git a/pylot/core/read/data.py b/pylot/core/read/data.py index 2ca981ed..cd24eccd 100644 --- a/pylot/core/read/data.py +++ b/pylot/core/read/data.py @@ -3,9 +3,9 @@ import os -from obspy.core import (read, Stream, UTCDateTime) +from obspy.core import read, Stream, UTCDateTime 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.util.utils import fnConstructor, getGlobalTimes @@ -156,10 +156,20 @@ class Data(object): def getEvtData(self): return self.evtdata - def applyEVTData(self, data, type='pick'): + def applyEVTData(self, data, type='pick', authority_id='rub'): 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): pass def applyEvent(event):