diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d3d9a443507..2988dcef80e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -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: diff --git a/obspy/clients/fdsn/client.py b/obspy/clients/fdsn/client.py index 8d29cebd293..b577be3df2c 100644 --- a/obspy/clients/fdsn/client.py +++ b/obspy/clients/fdsn/client.py @@ -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. @@ -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 diff --git a/obspy/clients/fdsn/header.py b/obspy/clients/fdsn/header.py index be6878a6884..93930047ce2 100644 --- a/obspy/clients/fdsn/header.py +++ b/obspy/clients/fdsn/header.py @@ -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, @@ -226,6 +227,7 @@ class FDSNNoServiceException(FDSNException): "includearrivals": bool, "matchtimeseries": bool, "eventid": str, + "eventtype": str, "limit": int, "offset": int, "orderby": str, @@ -269,6 +271,7 @@ class FDSNNoServiceException(FDSNException): "includearrivals": False, "matchtimeseries": False, "eventid": None, + "eventtype": None, "limit": None, "offset": 1, "orderby": "time",