Skip to content

importing 'ordinary' tif files with a 'basic' open_rasterio #4698

Answered by patquem
patquem asked this question in Q&A
Discussion options

You must be logged in to vote

Finally, I have used the following code using scikit-image to not be dependant of rasterio and GDAL libraries install

fnames = glob.glob(....)
xarr_list = []
for fname in fnames:
    arr = skimage.io.imread(fname)
    y = 0.5 + np.arange(arr.shape[0])
    x = 0.5 + np.arange(arr.shape[1])
    xarr_list.append(xr.DataArray(arr, coords=[("y", y), ("x", x)]))
stack3d = xr.concat(xarr_list, "z")
stack3d.coords["z"] = ....

Patrick

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by andersy005
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant