add save data method

This commit is contained in:
2014-12-17 12:16:32 +01:00
parent 92ed582c01
commit f0d60de745
3 changed files with 16 additions and 4 deletions

View File

@@ -7,6 +7,7 @@ from obspy.core import (read, Stream)
from obspy import readEvents
from obspy.core.event import (Event, Catalog)
from pylot.core.util import fnConstructor
from pylot.core.util.errors import FormatError
class Data(object):
@@ -71,7 +72,8 @@ class Data(object):
from pylot.core.util.defaults import OUTPUTFORMATS
if evtformat.strip() not in OUTPUTFORMATS.values():
evtformat = OUTPUTFORMATS.values()[0]
errmsg = 'selected format {0} not available'.format(evtformat)
raise FormatError(errmsg)
if fnout is None:
ID = self.evtdata.getEventID()

View File

@@ -8,3 +8,6 @@ Created on Thu Mar 20 09:47:04 2014
class OptionsError(Exception):
pass
class FormatError(Exception):
pass