Page 1 of 1

Graph Processing Tool execution error

Posted: Thu Dec 21, 2017 2:52 am America/New_York
by swathy
Hi,
I was trying to run the following XML code.

node id="bandmathsNode">
  <operator>BandMaths</operator>
  <sources>
    <sourceProducts>${source}</sourceProducts>
  </sources>
  <parameters>
    <targetBands>
      <targetBand>
        <name>sst</name>
        <expression>!MY_MASK ? sst : NaN</expression>
        <description>sst</description>
        <type>float32</type>
        <validexpression>sst &gt; 5 AND sst &lt; 50</validexpression>
        <noDataValue>-32767.0</noDataValue>
      </targetBand>
    </targetBands>
    <variables>
      <variable>
        <name>MY_MASK</name>
        <type>boolean</type>
        <value>(l2_flags.CLDICE || l2_flags.STRAYLIGHT)
        </value>
      </variable>
    </variables>
  </parameters>
</node>

But ended up with the following error....
rslab@rslab-pc:~/swathy/asian_conference_test$ gpt.sh -h BandMaths.xml -Ssource=A2006001084500.L2_LAC_SST -t A2006001084500.L2_LAC_SST_bandmath -f netCDF4 CF
java.lang.ClassCastException: org.esa.beam.framework.gpf.graph.Node cannot be cast to org.esa.beam.framework.gpf.graph.Graph
  at org.esa.beam.framework.gpf.graph.GraphIO.read(GraphIO.java:83)
  at org.esa.beam.framework.gpf.main.DefaultCommandLineContext.readGraph(DefaultCommandLineContext.java:71)
  at org.esa.beam.framework.gpf.main.CommandLineUsage.getUsageTextForGraph(CommandLineUsage.java:113)
  at org.esa.beam.framework.gpf.main.CommandLineTool.printHelp(CommandLineTool.java:138)
  at org.esa.beam.framework.gpf.main.CommandLineTool.run(CommandLineTool.java:119)
  at org.esa.beam.framework.gpf.main.GPT.run(GPT.java:54)
  at org.esa.beam.framework.gpf.main.GPT.main(GPT.java:34)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at com.bc.ceres.launcher.Launcher.launch(Launcher.java:154)
  at com.bc.ceres.launcher.Launcher.main(Launcher.java:56)

Error: org.esa.beam.framework.gpf.graph.Node cannot be cast to org.esa.beam.framework.gpf.graph.Graph

It will be great if any of you can help me to solve this issue. I checked my connection, updated module manager but the result is same. Kindly give me some suggestions to sort it out...

Swathy.

Graph Processing Tool execution error

Posted: Fri Dec 22, 2017 1:46 pm America/New_York
by OB SeaDAS - knowles
There's a lot of bugs here.  Try this:

gpt BandMaths.xml -p BandMaths_SST_nc.par -Ssource=A2006001084500.L2_LAC_SST.nc -t outfile.nc -f netCDF4-CF

There is so much going on in your program which I guess needs to be pointed out
1.  you cannot put an expression where it is expecting a value
     <value>(l2_flags.CLDICE || l2_flags.STRAYLIGHT)
2. because of the above, you cannot make your MY_MASK variable
3. netCDF4-CF format does not write out some of the metadata like validexpression so this just gets lost
4. the parmeter is validExpression not validexpression
5. your graph is incomplete (it is only a node)

Also keep in mind that for SST there is a quality product qual_sst (this is currently what is  operationally used to determine validity of SST).  Keep in mind that nighttime granules cannot determine the CLDICE and STRAYLIGHT flags.
You can use this with your current mask or instead of your current mask.  Essentially if qual_sst &lt;= 2 then use it.

For this example I've combined your mask with the sst quality masking.

Danny
attachment 1

attachment 2

Graph Processing Tool execution error

Posted: Mon Dec 25, 2017 11:44 pm America/New_York
by swathy
Thank you so much... :smile: