Bandmath xml gpt

Hi there,

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.

Thank you for any help you can provide

Carlo

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)

1 Like

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?

You can use the ${varName} variables anywhere in the xml file. Also in the expression.

You can do
<expression>${otherName1} / ${otherName2}</expression>
and use on the command line
gpt -PotherName1=band5 -PotherName2=band3 ...

2 Likes

All right! there was a small typo i did not see!

Thanks again!

6 posts were split to a new topic: Problem when using FlhMci operator with preset parameter