Skip to content

Commit

Permalink
Add support for eventtype in Client.get_events()
Browse files Browse the repository at this point in the history
Merge pull request obspy#2780 from claudiodsf/eventtype
  • Loading branch information
d-chambers authored Feb 17, 2021
2 parents be03b01 + b5b5e57 commit 21b0744
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Changes:
read_events() functions (see #2743)
- obspy.clients.fdsn:
* introduce fine-grained FDSN client exceptions (see #2653)
* support for "eventtype" parameter in get_events(), as specified in version
1.2 of the FDSN event web service (see #2780)
- obspy.clients.filesystem:
* add get_waveforms_bulk() method to SDS client (see #2616, #2626)
- obspy.io.css:
Expand Down
15 changes: 11 additions & 4 deletions obspy/clients/fdsn/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,11 @@ def get_events(self, starttime=None, endtime=None, minlatitude=None,
latitude=None, longitude=None, minradius=None,
maxradius=None, mindepth=None, maxdepth=None,
minmagnitude=None, maxmagnitude=None, magnitudetype=None,
includeallorigins=None, includeallmagnitudes=None,
includearrivals=None, eventid=None, limit=None, offset=None,
orderby=None, catalog=None, contributor=None,
updatedafter=None, filename=None, **kwargs):
eventtype=None, includeallorigins=None,
includeallmagnitudes=None, includearrivals=None,
eventid=None, limit=None, offset=None, orderby=None,
catalog=None, contributor=None, updatedafter=None,
filename=None, **kwargs):
"""
Query the event service of the client.
Expand Down Expand Up @@ -475,6 +476,12 @@ def get_events(self, starttime=None, endtime=None, minlatitude=None,
:type magnitudetype: str, optional
:param magnitudetype: Specify a magnitude type to use for testing the
minimum and maximum limits.
:type eventtype: str, optional
:param eventtype: Limit to events with a specified event type.
Multiple types are comma-separated (e.g.,
``"earthquake,quarry blast"``). Allowed values are from QuakeML.
See :const:`obspy.core.event.header.EventType` for a list of
allowed event types.
:type includeallorigins: bool, optional
:param includeallorigins: Specify if all origins for the event should
be included, default is data center dependent but is suggested to
Expand Down
7 changes: 5 additions & 2 deletions obspy/clients/fdsn/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@ class FDSNNoServiceException(FDSNException):

OPTIONAL_EVENT_PARAMETERS = [
"latitude", "longitude", "minradius", "maxradius", "magnitudetype",
"includeallorigins", "includeallmagnitudes", "includearrivals", "eventid",
"limit", "offset", "catalog", "contributor", "updatedafter"]
"eventtype", "includeallorigins", "includeallmagnitudes",
"includearrivals", "eventid", "limit", "offset", "catalog", "contributor",
"updatedafter"]

DEFAULT_PARAMETERS = {
"dataselect": DEFAULT_DATASELECT_PARAMETERS,
Expand Down Expand Up @@ -226,6 +227,7 @@ class FDSNNoServiceException(FDSNException):
"includearrivals": bool,
"matchtimeseries": bool,
"eventid": str,
"eventtype": str,
"limit": int,
"offset": int,
"orderby": str,
Expand Down Expand Up @@ -269,6 +271,7 @@ class FDSNNoServiceException(FDSNException):
"includearrivals": False,
"matchtimeseries": False,
"eventid": None,
"eventtype": None,
"limit": None,
"offset": 1,
"orderby": "time",
Expand Down

0 comments on commit 21b0744

Please sign in to comment.