Skip to content

Commit

Permalink
Merge pull request #163 from bird-house/fix_162
Browse files Browse the repository at this point in the history
Adapt to CLISOPS empty subset error (clisops#152)
  • Loading branch information
aulemahal authored Mar 25, 2021
2 parents cdb13ce + e2dc76e commit 5fdfa41
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions finch/processes/subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,18 @@ def _subset(resource):

dataset = dataset[variables] if variables else dataset

subsetted = subset_bbox(
dataset,
lon_bnds=[lon0, lon1],
lat_bnds=[lat0, lat1],
start_date=start_date,
end_date=end_date,
)
try:
subsetted = subset_bbox(
dataset,
lon_bnds=[lon0, lon1],
lat_bnds=[lat0, lat1],
start_date=start_date,
end_date=end_date,
)
except ValueError:
subsetted = False

if not all(subsetted.dims.values()):
if subsetted is False or not all(subsetted.dims.values()):
LOGGER.warning(f"Subset is empty for dataset: {resource.url}")
return

Expand Down

0 comments on commit 5fdfa41

Please sign in to comment.