I am trying to calculate percentiles with gdal_calc.py
using my command line.
I have a raster stack (11bands) and I would like to calculate the 0.85 percentile for each pixel over the entire stack (time).
Is there a way to do this?
Right now, I am using the numpy bindings of gdal_calc:
gdal_calc.py -A stack.vrt allBands=A --calc='nanpercentile(A.astype(int16),85,axis=0)' --outfile out.tif
I am trying to use the nanpercentile function from numpy. But I am not sure which parameters to use for axis and keepdims: https://docs.scipy.org/doc/numpy-dev/reference/generated/numpy.nanpercentile.html#numpy.nanpercentile
I am getting an output with this call, which however looks entirely wrong (the pixels look warped - it seems like the axis parameter is wrong).