Error when selecting multiple bands from SLSTR file

Hi,

I am trying to extract and write to geotiff a specific band from SLSTR data as well as the SZA using gpt and a xml graph. I manage to extract the band alone [DEBUG_SLSTR_ex1.xml (976 Bytes)
] and the SZA alone DEBUG_SLSTR_ex3.xml (973 Bytes)
but when trying to combine the two steps in a single graph DEBUG_SLSTR_ex2.xml (1.5 KB) I get the following error:

(base) ubuntu-bav@ubuntubav-VirtualBox:~/bav_win/SICE$ gpt DEBUG_SLSTR_ex2.xml -Ssource=SLSTR_scenes//S3A_SL_1_RBT____20180808T104851_20180808T105151_20180809T151857_0179_034_208_1620_LN2_O_NT_003.SEN3/xfdumanifest.xml -PtargetFolder=SLSTR_out/20180808T104851 -e
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
SEVERE: org.esa.s2tbx.dataio.gdal.activator.GDALDistributionInstaller: The environment variable LD_LIBRARY_PATH is not set. It must contain the current folder ‘.’.
Executing processing graph
INFO: org.hsqldb.persist.Logger: dataFileCache open start
done.
org.esa.snap.core.gpf.graph.GraphException: [NodeId: BandSelect_04] Operator ‘BandSelectOp’: Value for ‘Source Bands’ is invalid: ‘S4_radiance_an’
at org.esa.snap.core.gpf.graph.NodeContext.initTargetProduct(NodeContext.java:79)
at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:195)
at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:178)
at org.esa.snap.core.gpf.graph.GraphContext.initOutput(GraphContext.java:162)
at org.esa.snap.core.gpf.graph.GraphContext.(GraphContext.java:91)
at org.esa.snap.core.gpf.graph.GraphContext.(GraphContext.java:64)
at org.esa.snap.core.gpf.graph.GraphProcessor.executeGraph(GraphProcessor.java:128)
at org.esa.snap.core.gpf.main.DefaultCommandLineContext.executeGraph(DefaultCommandLineContext.java:86)
at org.esa.snap.core.gpf.main.CommandLineTool.executeGraph(CommandLineTool.java:534)
at org.esa.snap.core.gpf.main.CommandLineTool.runGraph(CommandLineTool.java:388)
at org.esa.snap.core.gpf.main.CommandLineTool.runGraphOrOperator(CommandLineTool.java:287)
at org.esa.snap.core.gpf.main.CommandLineTool.run(CommandLineTool.java:188)
at org.esa.snap.core.gpf.main.CommandLineTool.run(CommandLineTool.java:121)
at org.esa.snap.core.gpf.main.GPT.run(GPT.java:54)
at org.esa.snap.core.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 org.esa.snap.runtime.Launcher.lambda$run$0(Launcher.java:55)
at org.esa.snap.runtime.Engine.runClientCode(Engine.java:189)
at org.esa.snap.runtime.Launcher.run(Launcher.java:51)
at org.esa.snap.runtime.Launcher.main(Launcher.java:31)
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.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:62)
at com.install4j.runtime.launcher.UnixLauncher.main(UnixLauncher.java:57)
Caused by: org.esa.snap.core.gpf.OperatorException: Operator ‘BandSelectOp’: Value for ‘Source Bands’ is invalid: ‘S4_radiance_an’
at org.esa.snap.core.gpf.internal.OperatorContext.injectConfiguration(OperatorContext.java:1101)
at org.esa.snap.core.gpf.internal.OperatorContext.initializeOperator(OperatorContext.java:484)
at org.esa.snap.core.gpf.internal.OperatorContext.getTargetProduct(OperatorContext.java:273)
at org.esa.snap.core.gpf.Operator.getTargetProduct(Operator.java:387)
at org.esa.snap.core.gpf.graph.NodeContext.initTargetProduct(NodeContext.java:77)
… 28 more
Caused by: com.bc.ceres.binding.ValidationException: Value for ‘Source Bands’ is invalid: ‘S4_radiance_an’
at com.bc.ceres.binding.validators.ValueSetValidator.validateValue(ValueSetValidator.java:37)
at com.bc.ceres.binding.validators.ArrayValidator.validateValue(ArrayValidator.java:37)
at com.bc.ceres.binding.validators.MultiValidator.validateValue(MultiValidator.java:52)
at com.bc.ceres.binding.Property.validate(Property.java:270)
at com.bc.ceres.binding.Property.setValue(Property.java:172)
at com.bc.ceres.binding.dom.DefaultDomConverter.convertDomChildToProperty(DefaultDomConverter.java:194)
at com.bc.ceres.binding.dom.DefaultDomConverter.convertDomChildToPropertySet(DefaultDomConverter.java:182)
at com.bc.ceres.binding.dom.DefaultDomConverter.convertDomToPropertySet(DefaultDomConverter.java:165)
at com.bc.ceres.binding.dom.DefaultDomConverter.convertDomToValue(DefaultDomConverter.java:158)
at org.esa.snap.core.gpf.internal.OperatorContext.configureOperator(OperatorContext.java:1117)
at org.esa.snap.core.gpf.internal.OperatorContext.injectConfiguration(OperatorContext.java:1097)
… 32 more

Error: [NodeId: BandSelect_04] Operator ‘BandSelectOp’: Value for ‘Source Bands’ is invalid: ‘S4_radiance_an’

Can someone see what I am doing wrong?

Thanks!
Baptiste

Probably this issue is the reason: https://senbox.atlassian.net/browse/SIIITBX-245
This might get fixed with the next version.
As a workaround, you can add a read node add the beginning of your graph.

...
<node id="SLSTR_Product">
<operator>Read</operator>
<sources/>
<parameters>
  <file>${slstrFile}</file>
  <formatName>Sen3</formatName> <!-- Sen3 ensures that SLSTR is read as multisize -->
</parameters>
</node>
<node id="bandMathsNode">
<operator>BandMaths</operator>
<sources>
<sourceProducts>SLSTR_Product</sourceProducts>
</sources>
...

Probably you need to add a resampling node too. The bands need to have a common resolution.

1 Like

Thanks Marco, that was the issue!

Here is the final xml: DEBUG_SLSTR.xml (2.1 KB).

The path of the file should be given as parameter to gpt:

gpt DEBUG_SLSTR.xml -Ssource=SLSTR_scenes//S3A_SL_1_RBT____20180808T104851_20180808T105151_20180809T151857_0179_034_208_1620_LN2_O_NT_003.SEN3/xfdumanifest.xml -Ppathfile=SLSTR_scenes//S3A_SL_1_RBT____20180808T104851_20180808T105151_20180809T151857_0179_034_208_1620_LN2_O_NT_003.SEN3/xfdumanifest.xml -PtargetFolder=SLSTR_out/20180808T104851

1 Like