Skip to content

Commit

Permalink
feat: add event_type optional argument to FDSNWS client
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidni committed Aug 15, 2023
1 parent e6095b1 commit 7b1a88e
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions catalog_tools/io/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ def get_events(self, start_time: Optional[datetime] = None,
request_url += f'&minmagnitude={min_magnitude}'
if include_all_magnitudes:
request_url += f'&includeallmagnitudes={include_all_magnitudes}'
if event_type:
request_url += f'&eventtype={event_type}'

print(request_url)

Expand All @@ -85,18 +87,3 @@ def get_events(self, start_time: Optional[datetime] = None,
df = Catalog.from_dict(catalog)

return df


def main():
# url = 'https://earthquake.usgs.gov/fdsnws/event/1/query'
url = 'http://arclink.ethz.ch/fdsnws/event/1/query'
client = FDSNWSEventClient(url)
cat = client.get_events(
start_time=datetime(2023, 7, 1),
include_all_magnitudes=True)

print(type(cat))


if __name__ == '__main__':
main()

0 comments on commit 7b1a88e

Please sign in to comment.