import dask.array as da
import skimage.io
x = da.random.random((2000, 2000), chunks=(200, 200)) # make a dask array
def save_file(arr, block_info=None):
""" Save file to foo-x-y.tif, where x and y are block locations """
filename = "foo-" + "-".join(map(str, block_info[0]["chunk-location"])) + ".tif"
skimage.io.imsave(filename, arr)
return arr
x.map_blocks(save_file, dtype=x.dtype).compute() # call function on every block
是的。你知道吗
$ ls
foo-0-0.tif
foo-0-1.tif
...
foo-9-8.tif
foo-9-9.tif
理想情况下会有某种
imsave
函数。到2019年10月31日为止,我还找不到一个,但您可能希望在将来观看https://image.dask.org,了解这种功能。你知道吗今天,您可以使用地图块和浏览.io.imread你知道吗
是的。你知道吗
相关问题 更多 >
编程相关推荐