From 40e76d8b5c3c0bf1e0a949e04c4ed671f99c8446 Mon Sep 17 00:00:00 2001 From: Claudio Satriano Date: Mon, 25 Jan 2021 19:09:10 +0100 Subject: [PATCH 1/3] Add documentation for `eventtype` in Client.get_events() --- obspy/clients/fdsn/client.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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 From fda5e2a6fc09ad037439dae46562bc6d9f2d1d4d Mon Sep 17 00:00:00 2001 From: Claudio Satriano Date: Mon, 8 Feb 2021 21:15:19 +0100 Subject: [PATCH 2/3] Add `eventtype` to lists in `clients.fdsn.header` --- obspy/clients/fdsn/header.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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", From b5b5e57de613d112b658944a4f0ca915a040e9d4 Mon Sep 17 00:00:00 2001 From: Claudio Satriano Date: Wed, 17 Feb 2021 11:42:03 +0100 Subject: [PATCH 3/3] Changelog entry for "eventtype" in get_events() --- CHANGELOG.txt | 2 ++ 1 file changed, 2 insertions(+) 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: