Skip to content

Commit

Permalink
check errors raised by empty query object from bounding box split in …
Browse files Browse the repository at this point in the history
…openaltimetry visualization (#220)

Co-authored-by: Jessica <JessicaS11@users.noreply.github.com>
  • Loading branch information
icetianli and JessicaS11 authored Sep 1, 2021
1 parent 37b4da7 commit b5bba02
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions icepyx/core/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,17 @@ def query_icesat2_filelist(self) -> tuple:

for bbox_i in bbox_list:

region = ipx.Query(
self.product,
bbox_i,
self.date_range,
cycles=self.cycles,
tracks=self.tracks,
)
icesat2_files = region.avail_granules(ids=True)[0]
try:
region = ipx.Query(
self.product,
bbox_i,
self.date_range,
cycles=self.cycles,
tracks=self.tracks,
)
icesat2_files = region.avail_granules(ids=True)[0]
except (AttributeError, AssertionError):
continue

if not icesat2_files:
continue
Expand Down Expand Up @@ -408,6 +411,8 @@ def parallel_request_OA(self) -> da.array:
# generate parameter lists for OA requesting
OA_para_list = self.generate_OA_parameters()

assert OA_para_list, "Your search returned no results; try different search parameters"

url_number = len(OA_para_list)

if url_number > 200:
Expand Down

0 comments on commit b5bba02

Please sign in to comment.