The best way to do this is to use dask.delayed. In this case, you must create a delayed function to read the array, and then compose an array of objects from these objects delayedusing da.from_delayed. Sort of:
@dask.delayed(pure=True)
def load(file):
return gdal.Open(file).ReadAsArray()
data = [da.from_delayed(load(f), shape=shape_of_f, dtype=dtype_of_f)
for f in files]
x = da.stack(data, axis=0)
, . , load. gdal, ReadAsArray xoff/yoff/xsize/ysize ( ). , .
, rechunk, . , . , .
x = x.rechunk((500, 500, 500))