Commit b3bb2e54 authored by Marius Kriegerowski's avatar Marius Kriegerowski
Browse files

snuffling: handle missing marker files in ifc

parent 791535d1
import copy import copy
import os import os
import numpy as num import numpy as num
import logging
from pyrocko import util, model, orthodrome, pile from pyrocko import util, model, orthodrome, pile
from pyrocko.gui import snuffler from pyrocko.gui import snuffler
from pyrocko.gui import marker as pmarker from pyrocko.gui import marker as pmarker
...@@ -9,6 +11,9 @@ from pyrocko.gui.snuffling import Snuffling, Param, Choice, Switch ...@@ -9,6 +11,9 @@ from pyrocko.gui.snuffling import Snuffling, Param, Choice, Switch
from lassie import geo, ifc from lassie import geo, ifc
logger = logging.getLogger('lassie.snuffling')
kind_default = '1 (green)' kind_default = '1 (green)'
...@@ -280,7 +285,11 @@ def snuffle(config): ...@@ -280,7 +285,11 @@ def snuffle(config):
elif isinstance(_ifc, ifc.TemplateMatchingIFC): elif isinstance(_ifc, ifc.TemplateMatchingIFC):
markers_path_extra = _ifc.template_markers_path markers_path_extra = _ifc.template_markers_path
s.add_markers(pmarker.load_markers(markers_path_extra)) if os.path.exists(markers_path_extra):
s.add_markers(pmarker.load_markers(markers_path_extra))
else:
logger.warn('No such file: %s (referenced in %s, named %s)' % (
markers_path_extra, _ifc.__class__.__name__, _ifc.name))
receivers = config.get_receivers() receivers = config.get_receivers()
stations = set() stations = set()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment