Skip to content

Commit

Permalink
edu package update (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaussion committed Feb 4, 2021
1 parent e2afe9c commit 8395e3d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions oggm_edu/funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,8 +769,13 @@ def compute_climate_statistics(gdir, tmin='1985', tmax='2015', lapse_rate=0.0065
during tmin-tmax
"""

with xr.open_dataset(gdir.get_filepath('climate_monthly')) as ds:
ds = ds.load()
try:
with xr.open_dataset(gdir.get_filepath('climate_monthly')) as ds:
ds = ds.load()
except FileNotFoundError:
with xr.open_dataset(gdir.get_filepath('climate_historical')) as ds:
ds = ds.load()


ds = ds.sel(time=slice(str(tmin), str(tmax)))

Expand Down

0 comments on commit 8395e3d

Please sign in to comment.