Welcome to the BEAM Forum!

We encourage you to sign in our forum and participate in the BEAM community. The forum is maintained by the BEAM project team who will most likely answer your questions within 24 hours (except during common holidays) - if not done by other community members. Collaborate, share your knowledge and learn from other users!

If you don't find what you are looking for, please also consider the following external forums:

Combination View Flat View Tree View
Threads [ Previous | Next ]
Multiple bands created in same band math xml, inter-related?
toggle
I would have thought this should work, but I get an error "Error: Could not parse expression: log10(DOC)" The {lengthy expression} bit works correctly if I comment out the log10 target band.

 1<graph id="DOCGraph">
 2   <version>1.0</version>
 3     <node id="DOCNode">
 4       <operator>BandMaths</operator>
 5       <sources>
 6           <sourceProducts>${sourceProducts}</sourceProducts>
 7       </sources>
 8       <parameters>
 9           <targetBands>
10               <targetBand>
11                   <name>DOC</name>
12                   <expression>
13            {length expression to derive DOC from ag412}
14           </expression>
15                   <description>DOC derived from ag412</description>
16                   <validExpression>DOC &lt; 100</validExpression>
17                   <type>float32</type>
18                   <noDataValue>NaN</noDataValue>                  
19               </targetBand>
20               <targetBand>
21         <name>log10DOC</name>
22         <expression>log10(DOC)</expression>
23         <description>log10DOC</description>
24         <type>float32</type>
25         <noDataValue>NaN</noDataValue>
26           </targetBand>
27           </targetBands>
28       </parameters>
29  </node>
30</graph>

Thanks!
Bruce
Flag Flag
RE: Multiple bands created in same band math xml, inter-related?
11/27/14 11:19 AM as a reply to Bruce Bowler.
Hi Bruce,

The problem is that you can't reference a band which is created in the same step (operator). You can split the creation of the bands in two operations and merge both results afterwards into a single product. Your graph should look like the following.
 1<graph id="DOCGraph">
 2    <version>1.0</version>
 3    <node id="DOCNode">
 4        <operator>BandMaths</operator>
 5        <sources>
 6            <sourceProducts>${sourceProducts}</sourceProducts>
 7        </sources>
 8        <parameters>
 9            <targetBands>
10                <targetBand>
11                    <name>DOC</name>
12                    <expression>
13                        {length expression to derive DOC from ag412}
14                    </expression>
15                    <description>DOC derived from ag412</description>
16                    <validExpression>DOC &lt; 100</validExpression>
17                    <type>float32</type>
18                    <noDataValue>NaN</noDataValue>
19                </targetBand>
20            </targetBands>
21        </parameters>
22    </node>
23    <node id="LogDOCNode">
24        <operator>BandMaths</operator>
25        <sources>
26            <sourceProducts>DOCNode</sourceProducts>
27        </sources>
28        <parameters>
29            <targetBands>
30                <targetBand>
31                    <name>log10DOC</name>
32                    <expression>log10(DOC)</expression>
33                    <description>log10DOC</description>
34                    <type>float32</type>
35                    <noDataValue>NaN</noDataValue>
36                </targetBand>
37            </targetBands>
38        </parameters>
39    </node>
40    <node id="mergeNode">
41    <operator>Merge</operator>
42    <sources>
43        <masterProduct>DOCNode</masterProduct>
44        <logdocproduct>LogDOCNode</logdocproduct>
45    </sources>
46    </node>
47</graph>

I haven't tried this graph but I think it works (maybe with minor tweaks).

regards
Marco
Flag Flag