rio.reproject fails for timedelta64['ns'] with NaT #459
-
Hi, I try to reproject a few datasets and some of them have dtype timedelta64['ns'] with nan values 'NaT'. import xarray as xr
import rioxarray
from rasterio.enums import Resampling
repro = dataarray.rio.write_crs('EPSG:4326')
resample = repro.rio.reproject('EPSG:3035', resolution=(1000,-1000), resampling=Resampling.bilinear)
ValueError: Could not convert object to NumPy timedelta If I try to set the nodata value it dos not work either repro.rio.write_nodata('NaT', inplace=True)
ValueError: could not convert string to float: 'NaT' According to the rioxarray description of reproject it uses the internal nodata value - which works fine for datat arrays that have no timedelta64['ns'] dtype. Does anyone know how to overcome this? Additionally the rio.reproject() seems to change my dataarray.time dimension dtype so that ncview can't read it anymore. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
timedelta is not supported. I recommend converting to float64 before reprojecting. |
Beta Was this translation helpful? Give feedback.
timedelta is not supported. I recommend converting to float64 before reprojecting.