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 > 5 AND sst < 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
-
- Subject Matter Expert
- Posts: 306
- Joined: Mon Apr 07, 2008 4:40 pm America/New_York
- Been thanked: 3 times
Graph Processing Tool execution error
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 <= 2 then use it.
For this example I've combined your mask with the sst quality masking.
Dannyattachment 1
attachment 2
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 <= 2 then use it.
For this example I've combined your mask with the sst quality masking.
Dannyattachment 1
attachment 2