Skip to content

Commit

Permalink
Update gis.py
Browse files Browse the repository at this point in the history
small simplifications
  • Loading branch information
fmaussion committed Nov 29, 2022
1 parent d4ff09e commit fdcd575
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions oggm/core/gis.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,15 +334,15 @@ def define_glacier_region(gdir, entity=None, source=None):
# Open DEM
# We test DEM availability for glacier only (maps can grow big)
if isinstance(source, list): # when multiple sources are provided, try them sequentially
for i, src in enumerate(source):
for src in source:
source_exists = is_dem_source_available(src, *gdir.extent_ll)
if source_exists:
source = source[i] # pick the first source which exists
source = src # pick the first source which exists
break
else:
source_exists = is_dem_source_available(source, *gdir.extent_ll)

if source_exists is False:
if not source_exists:
raise InvalidWorkflowError(f'Source: {source} is not available for '
f'glacier {gdir.rgi_id} with border '
f"{cfg.PARAMS['border']}")
Expand Down

0 comments on commit fdcd575

Please sign in to comment.