Open
Description
Please note that Mengqi & I were trying to use the regrid part of this code for the Building Energy Demand (BED) model and were running into issues when testing line 151-160 in gridded.py. We were performing a manual check on how this chunk was re-gridding examples co-ordinates and we thought it was not working as expected. Someone, should just double check this code again.
tethys/tethys/datareader/gridded.py
Line 151 in 933d117
if method == 'label':
ds = ds.isel(lon=np.arange(ds.lon.size).repeat(r)).coarsen(lon=s).max()
ds = ds.isel(lat=np.arange(ds.lat.size).repeat(r)).coarsen(lat=s).max()
else:
ds = ds.isel(lon=np.arange(ds.lon.size).repeat(r)).coarsen(lon=s).sum()
ds = ds.isel(lat=np.arange(ds.lat.size).repeat(r)).coarsen(lat=s).sum()
if method == 'extensive':
ds = ds / (r * r) # preserve original sum
elif method == 'intensive':
ds = ds / (s * s) # take average
Metadata
Metadata
Assignees
Labels
No labels