Skip to content

Commit

Permalink
Command line option to parse ASDF file for event and picks information
Browse files Browse the repository at this point in the history
Note: the option will allow also reading traces and metadata from the
ASDF file (to be implemented in the next commits).

Also, renamed asdf.py to asdf_event.py
  • Loading branch information
claudiodsf committed Jul 19, 2024
1 parent ac05ad3 commit 51876d6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
6 changes: 5 additions & 1 deletion sourcespec2/input/event_and_picks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion sourcespec2/input/event_parsers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions sourcespec2/ssp_parse_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 51876d6

Please sign in to comment.