Repository navigation
Replies: 1 comment
|
This comes from the warp option
foo_resampled = foo.rio.reproject(
foo.rio.crs,
resolution=8,
resampling=Resampling.average,
UNIFIED_SRC_NODATA="NO", # "PARTIAL" also works here
)which gives i.e. the same result as reprojecting each time slice separately (checked with rioxarray main, rasterio 1.5.1, GDAL 3.12). |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Following this thread, when using
reprojectfor a 2-D DataArray, after explicitly setting NoData value usingwrite_nodata,Resampling.averagecan correctly calculate the average of all non-Nodata pixels.However, this seems not to work for a 3-D DataArray.
reprojectwill propagate nan value, instead of calculating the average of all non-Nodata pixels, even after setting the NoData value. Here is an example:foo:foo_resampled:What I expected for
foo_resampled:Does that imply
reprojectcan only correctly handle Nan value in 2-D case? I appreciate any suggestions or helps.All reactions