gjoseph92 / stackstac

Turn a STAC catalog into a dask-based xarray
https://stackstac.readthedocs.io
MIT License
250 stars 49 forks source link

Explicitly pass dtype during dataset read #208

Closed gjoseph92 closed 1 year ago

gjoseph92 commented 1 year ago

We weren't asking rasterio for arrays of the output dtype, so we'd just get whatever the native dtype was of the GeoTIFF. If the GeoTIFF was an integer dtype, but specified floating-point scale/offset, then applying the scaling would fail. This basically moves the cast-to-output-dtype before applying scaling, so whatever you pass for dtype= (float64 by default) will actually control it.

Closes https://github.com/gjoseph92/stackstac/issues/206