is it possible to define the name of a band in the bandmath graph as a variable that can be set when the gpt command is run (-Pbandname=bandname)? I tried with $bandname in the xml graph but it is not working.
This is possible. Probably you missed the brackets ‘{}’.
You should use
...
<targetBand>
<name>${bname}</name>
...
On the command line you can then use gpt "G:\EOData\Processor Requests\bandMaths.xml" -Pbname=MyName "G:\EOData\Meris\RR\MER_RR__2PNMAP20070325_095722_000003152056_00380_26486_0001.N1" -t %USERPROFILE%\test\target.dim
Attached is also the xml file I’ve used. bandMaths.xml (517 Bytes)
Thanks for the answer! What I want to do is bit different, though. I want to have a generic xml for processing images that have different bandname. In your example I assume the source file has a band called reflec_10, right? Is it possible to set this name? Everything is due to the fact that after the coregistration the band names got the suffix ‘_slv_DDmonYYYY’ but the math operation I want to perform is always the same. Any suggestion?