Closed cdubos-fr closed 2 years ago
This is likely the line causing troubles: https://github.com/corteva/rioxarray/blob/570150fbb0d359c5567a08a71adb5efc908164f0/rioxarray/_io.py#L683
I believe this can be fixed by wrapping with this function: https://github.com/corteva/rioxarray/blob/570150fbb0d359c5567a08a71adb5efc908164f0/rioxarray/_io.py#L339-L347
A PR with the fix is welcome.
Code Sample, a copy-pastable example if possible
Problem description
When opening a file with
rioxarray.open_rasterio
passingchunks=True
,rasterio.DatasetReader
can have"complex_int16"
dtype, that is incompatible withdask.core.normalize_chunk
dtype parameter (line 682 inrioxarray._io
) and causeTypeError: data type 'complex_int16' not understood
.rasterio manage
complex_int16
when reading data withrasterio.dtypes._getnpdtype
andrasterio.dtypes._is_complex_int
to translate internalcomplex_int16
tonp.complex64
.Expected Output
rioxarray.open_rasterio
should work and provide axarray.DataArray
withnp.complex64
dtype in the case of processing a rasterio file withcomplex_int16
dtype.Environment Information
Installation method
pip install rioxarray==${TARGET_VERSION}