Skip to content

Commit

Permalink
Fixed performance issues with Daymet monthly subsetting.
Browse files Browse the repository at this point in the history
  • Loading branch information
stuckyb committed Aug 24, 2022
1 parent 7caa7c7 commit c05b49a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/library/datasets/daymet.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _loadData(self, varname, date_grain, request_date, subset_geom):
# Get the file name of the requested data.
if date_grain == dr.ANNUAL:
fname = self.fpatterns[varname].format('ann', request_date.year)
pref_ext = 1
pref_ext = 0
elif date_grain == dr.MONTHLY:
fname = self.fpatterns[varname].format('mon',request_date.year)
pref_ext = 0
Expand Down Expand Up @@ -111,7 +111,8 @@ def _loadData(self, varname, date_grain, request_date, subset_geom):
# Clip the data and update the cache.
self.cur_data_clipped = data.rio.clip(
[subset_geom.json],
all_touched = True
all_touched = True,
from_disk=True
)
self.current_clip = subset_geom

Expand Down

0 comments on commit c05b49a

Please sign in to comment.