makepath / xarray-spatial

Raster-based Spatial Analytics for Python
https://xarray-spatial.readthedocs.io/
MIT License
805 stars 81 forks source link

[FEA] Cast xarray.DataArrays to cupy #730

Open taureandyernv opened 1 year ago

taureandyernv commented 1 year ago

Reason or Problem

Seems like there is a way to cast an xarray.Dataset to cupy, maybe not for xarray.DataArray

Proposal

I would like a way to cast an xarray.DataArray to cupy , as it does with xarray.Dataset

Usage: GPU direct read of DataArray objects

Stakeholders and Impacts

RAPIDS

Drawbacks

Unknown

Alternatives

data = cupy.asarray(xarray.open_rasterio('data.tif').data) works, but isn't as efficient as making it cupy in the first place

Unresolved Questions

shrugs

Additional Notes or Context

None....for now :)

brendancol commented 1 year ago

@thuydotm can you take a look at this?