[gdal-dev] gdal_calc.py: multiply each band of a multispectral raster by a factor

Agustin Lobo alobolistas at gmail.com
Tue Dec 18 00:54:22 PST 2018


Dear devs,
Is it possible to use gdal_calc.py to multiply each band of a
multispectral raster by a factor?
I've tried:

gdal_calc.py -A ReflPCA.tif --allBands=A --outfile=result.tif
--calc="A*[1,2,3,4,5,6]" --overwrite

it works fine with 1 single value,
gdal_calc.py -A ReflPCA.tif --allBands=A --outfile=result.tif
--calc="A*2" --overwrite

but do not know how to do it with a vector of factors. Perhaps because
of I'm not familiar with python numpy.

Thanks


More information about the gdal-dev mailing list