Good morning,

I unable to use gdal_calc to make a pixel-wise computation between two
tiffs with several bands.

I have two tifs, each contains time series of the same spectral band.
For example, file1.tif contains a time series of RED and file2.tif
contains a time series of NIR (near infrared). The dates of the time
series in both files match. I would like to create a third file with a
pixel-wise computation between the first two files for which I'm using
gdal_calc as follows:

gdal_calc.py -A file1.tif -B file2.tif --calc="((A - B) / (A + B +
0.00001)) * 10000" --outfile=result.tif

This runs but only uses the first band in both files. I know about the
"allBands" flag, but it only handles one of the files, not both. For
example, this produces the wrong results because it only uses the first
band in file2.tif:

gdal_calc.py -A file1.tif -B file2.tif --calc="((A - B) / (A + B
+0.00001)) * 10000" --outfile=result.tif --allBands=A --allBands=B

Am I doing something wrong? Is there another way?

By the way, I prepared two samples files, available here:

https://www.dropbox.com/sh/a3yoxz34rsm1qqi/AAChpBHarBc5fiC19AlEnyk3a?dl=0

I'm sorry if I'm posting this question in the wrong list.

Thanks a lot!

-- 
Alber Sánchez
National Institute for Space Research
Earth System Science Center
São José dos Campos, SP, Brazil





Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to