Calling a batch process from the command line with gpt


Is it possible to use the command line ~/snap/bin/gpt tool to call batch processes (a processing of more than one product with the same graph) as you would do on the GUI (Tools > Batch Processing)?

I mean is there an operator for that (I can’t see anything related to batch processing when I call gpt but maybe I’m missing it)?


You would have to create your own script to do that


There is an example for doing this. It is still for BEAM. But you should be able to apply it on SNAP.

1 Like

Hi, I have some slc products in my HPC cluster and I want to do topsar split for all the slc files by batch processing.
what is the parameter file mentioned in processDataset.bash (Unix). I have set the path to xml, source and target files but unable to understand parameter file path.

The parameter file is the file named in the example. It is a simple text file containing name-value pairs. It provides the values of the parameters used in the XML file.
Is the “Example Usage”-section not clear enough. Do you think it should be extended?

I am getting an error while running by batch script. The xml file, parameter file, batch script are in the same folder.

I have updated only two values in .bat file

  1. location of gpt.bat
  2. file extension in the for loop from *.N1 to *.zip

I run this in command prompt as an admin
C:\WINDOWS\system32>SplitDataset.bat Split.xml “E:\Flood\Data_Collection\S1_SLC\Top” “E:\Flood\Data_Collection\S1_SLC\Top_Output” Split
‘SplitDataset.bat’ is not recognized as an internal or external command,
operable program or batch file.

Split.xml (415 Bytes) (40 Bytes)
SplitDataset.bat (1.8 KB)

Is your SplitDataset.bat really located in C:\WINDOWS\system32? At least the message means that SplitDataset.bat cannot be found.

Oh, I guess I need to enter the directory where all the files(Split.xml,, SplitDataset.bat) are there. I will try it.

Thank you marpet.

Hi marpet,
I have the run cmd as an administrator mode and enter the proper location where the files are kept. The following message is shown.

E:\Flood\Data_Collection\S1_SLC>SplitDataset.bat Split.xml “E:\Flood\Data_Collection\S1_SLC\Top” “E:\Flood\Data_Collection\S1_SLC\Top_Output” Split
The syntax of the command is incorrect.

Thanking you,

Dear marpet.
the location of gpt.bat is different in my PC. So I changed it to C:\Program Files\S1TBX where my gpt.bat is there. Now the following error is occured even though I specify the firstBurstIndex parameter in the file.

SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See for further details.
org.esa.beam.framework.gpf.graph.GraphException: Operator ‘TOPSARSplitOp’: Unknown element ‘firstBurstIndex’
at org.esa.beam.framework.gpf.graph.NodeContext.initTargetProduct(
at org.esa.beam.framework.gpf.graph.GraphContext.initNodeContext(
at org.esa.beam.framework.gpf.graph.GraphContext.initNodeContext(
at org.esa.beam.framework.gpf.graph.GraphContext.initOutput(
at org.esa.beam.framework.gpf.graph.GraphContext.(
at org.esa.beam.framework.gpf.graph.GraphContext.(
at org.esa.beam.framework.gpf.graph.GraphProcessor.executeGraph(
at org.esa.beam.framework.gpf.main.DefaultCommandLineContext.executeGraph(
at org.esa.beam.framework.gpf.main.CommandLineTool.executeGraph(
at org.esa.beam.framework.gpf.main.CommandLineTool.runGraph(
at org.esa.beam.framework.gpf.main.CommandLineTool.runGraphOrOperator(
at org.esa.beam.framework.gpf.main.GPT.main(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.bc.ceres.launcher.Launcher.launch(
at com.bc.ceres.launcher.Launcher.main(
Caused by: org.esa.beam.framework.gpf.OperatorException: Operator ‘TOPSARSplitOp’: Unknown element ‘firstBurstIndex’
at org.esa.beam.framework.gpf.internal.OperatorContext.injectConfiguration(
at org.esa.beam.framework.gpf.internal.OperatorContext.initializeOperator(
at org.esa.beam.framework.gpf.internal.OperatorContext.getTargetProduct(
at org.esa.beam.framework.gpf.Operator.getTargetProduct(
at org.esa.beam.framework.gpf.graph.NodeContext.initTargetProduct(
… 20 more
Caused by: com.bc.ceres.binding.ConversionException: Unknown element ‘firstBurstIndex’
at com.bc.ceres.binding.dom.DefaultDomConverter.convertDomChildToPropertySet(
at com.bc.ceres.binding.dom.DefaultDomConverter.convertDomToPropertySet(
at com.bc.ceres.binding.dom.DefaultDomConverter.convertDomToValue(
at org.esa.beam.framework.gpf.internal.OperatorContext.configureOperator(
at org.esa.beam.framework.gpf.internal.OperatorContext.injectConfiguration(
… 24 more

Error: Operator ‘TOPSARSplitOp’: Unknown element ‘firstBurstIndex’