You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importrioxarrayasrxrraster_files=glob.glob("/path/to/files") # 50 raster filesforfinraster_files:
withrxr.open_rasterio(f) asds:
# perform some operations and write out a new rasterds_max=ds.max(dim='band')
ds_max.rio.to_raster("/path/to/output/file")
Running this code causes the disk throughput and I/O to rise exponentially after about 20 files have been iterated over, leading to the system freezing. Since the files are being opened within a context manager, they should automatically close.
I tried recreating the same workflow using xarray, and faced no problems.
importxarrayasxrraster_files=glob.glob("/path/to/files") # 50 raster filesforfinraster_files:
withxr.open_dataset(f) asds:
# perform some operations and write out a new rasterds_max=ds.max(dim='band')
ds_max['band_data'].rio.to_raster("/path/to/output/file")
The above code snippet works just fine.
I also tried explicitly calling ds.close() for rioxarray, but the problem still perists.
Consider the following workflow:
Running this code causes the disk throughput and I/O to rise exponentially after about 20 files have been iterated over, leading to the system freezing. Since the files are being opened within a context manager, they should automatically close.
I tried recreating the same workflow using xarray, and faced no problems.
The above code snippet works just fine.
I also tried explicitly calling
ds.close()
for rioxarray, but the problem still perists.The text was updated successfully, but these errors were encountered: