diff --git a/sourcespec2/input/event_and_picks.py b/sourcespec2/input/event_and_picks.py index 6c073716..c32d20ea 100644 --- a/sourcespec2/input/event_and_picks.py +++ b/sourcespec2/input/event_and_picks.py @@ -19,8 +19,9 @@ import logging from ..setup import config, ssp_exit from .event_parsers import ( + parse_source_spec_event_file, parse_hypo71_hypocenter, parse_hypo71_picks, parse_hypo2000_file, - parse_qml_file, parse_source_spec_event_file + parse_qml_file, parse_asdf_event_picks ) logger = logging.getLogger(__name__.rsplit('.', maxsplit=1)[-1]) @@ -102,6 +103,9 @@ def read_event_and_picks(trace1=None): # parse QML file if config.options.qml_file is not None: ssp_event, picks = parse_qml_file() + # parse ASDF file + if config.options.asdf_file is not None: + ssp_event, picks = parse_asdf_event_picks(config.options.asdf_file) if ssp_event is not None: _log_event_info(ssp_event) diff --git a/sourcespec2/input/event_parsers/__init__.py b/sourcespec2/input/event_parsers/__init__.py index c50957e4..a3e3b588 100644 --- a/sourcespec2/input/event_parsers/__init__.py +++ b/sourcespec2/input/event_parsers/__init__.py @@ -9,7 +9,7 @@ CeCILL Free Software License Agreement v2.1 (http://www.cecill.info/licences.en.html) """ -from .asdf import parse_asdf_event_picks # noqa +from .asdf_event import parse_asdf_event_picks # noqa from .hypo71 import parse_hypo71_hypocenter, parse_hypo71_picks # noqa from .hypo2000 import parse_hypo2000_file # noqa from .obspy_catalog import parse_obspy_catalog # noqa diff --git a/sourcespec2/input/event_parsers/asdf.py b/sourcespec2/input/event_parsers/asdf_event.py similarity index 100% rename from sourcespec2/input/event_parsers/asdf.py rename to sourcespec2/input/event_parsers/asdf_event.py diff --git a/sourcespec2/ssp_parse_arguments.py b/sourcespec2/ssp_parse_arguments.py index dda63df7..3ef87a7e 100644 --- a/sourcespec2/ssp_parse_arguments.py +++ b/sourcespec2/ssp_parse_arguments.py @@ -118,6 +118,13 @@ def _init_parser(description, epilog, nargs): help='get picks and hypocenter information from QuakeML FILE', metavar='FILE' ) + parser.add_argument( + '-a', '--asdffile', dest='asdf_file', + action='store', default=None, + help='get picks, hypocenter information, traces and metadata from\n' + 'ASDF FILE', + metavar='FILE' + ) parser.add_argument( '-H', '--hypocenter', dest='hypo_file', action='store', default=None,