I have in input a single band 2 axis tif raster (float32 values). Using gdal_calc
I need to produce an output raster (same dimensions of input) that contains in every pixel the mean value of the whole input raster (to be used in other calculation) - basically a "uniform" raster. To do this I use:
gdal_calc.py --calc="mean(A,dtype=float64)" --type="Float32" --overwrite --NoDataValue=-32768 --outfile output.tif -A input.tif
Based on
gdalinfo -stats input.tif
I get a mean of 0.45 approx. So I was expecting an output.tif with this value for every pixel, but what I get is a different image (constant horizontally but different values vertically). I tried several numpy.mean parameters (axis, keepdims) but nothing changed.
Any suggestion or work around?