Skip to content

Commit

Permalink
bug: get_event_waveform: Correctly deal with parameters with zero values
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Jul 8, 2022
1 parent 89ef5be commit 51a330c
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions HinetPy/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,13 +817,18 @@ def get_event_waveform(
):
continue
# select events based on depth
if mindepth and event.depth < mindepth:
if mindepth is not None and event.depth < mindepth:
continue
if maxdepth and event.depth > maxdepth:
if maxdepth is not None and event.depth > maxdepth:
continue

# select events in a box region
if minlatitude or maxlatitude or minlongitude or maxlongitude:
if (
minlatitude is not None
or maxlatitude is not None
or minlongitude is not None
or maxlongitude is not None
):
if not point_inside_box(
event.latitude,
event.longitude,
Expand All @@ -835,7 +840,9 @@ def get_event_waveform(
continue

# select events in a circular region
if (latitude and longitude) and (minradius or maxradius):
if (latitude is not None and longitude is not None) and (
minradius is not None or maxradius is not None
):
if not point_inside_circular(
event.latitude,
event.longitude,
Expand Down

0 comments on commit 51a330c

Please sign in to comment.