Error in bulk processing (attached bat, xml, properties files)

Input data is located at Y:\Input (2 GRDH products are there in zipped format)

Y:\Bulk_Pro_GPT>Calibrate.bat Calibrate_GRDH.xml Calibrate_GRDH.properties Y:\Input Y:\Bulk_Pro_GPT\Output Calibrate

Y:\Bulk_Pro_GPT>setlocal ENABLEDELAYEDEXPANSION

Y:\Bulk_Pro_GPT>set gptPath=“C:\Program Files\snap\bin\gpt.exe”

Y:\Bulk_Pro_GPT>set graphXmlPath=Calibrate_GRDH.xml

Y:\Bulk_Pro_GPT>set parameterFilePath=Calibrate_GRDH.properties

Y:\Bulk_Pro_GPT>set sourceDirectory=Y:\Input

Y:\Bulk_Pro_GPT>if t == \ set sourceDirectory=Y:\Inpu

Y:\Bulk_Pro_GPT>set targetDirectory=Y:\Bulk_Pro_GPT\Output

Y:\Bulk_Pro_GPT>if t == \ set targetDirectory=Y:\Bulk_Pro_GPT\Outpu

Y:\Bulk_Pro_GPT>set targetFilePrefix=Calibrate

Y:\Bulk_Pro_GPT>md Y:\Bulk_Pro_GPT\Output

Y:\Bulk_Pro_GPT>for / %F in (.zip) do (
echo.
set sourceFile=%~fF
echo Processing !sourceFile!
set targetFile=Y:\Bulk_Pro_GPT\Output\Calibrate_%~nF.dim
set procCmd=“C:\Program Files\snap\bin\gpt.exe” Calibrate_GRDH.xml -e -p Calibrate_GRDH.properties -t “!targetFile!” “!sourceFile!”
call !procCmd!
)

Y:\Bulk_Pro_GPT>(
echo.
set sourceFile=Y:\Input.zip
echo Processing !sourceFile!
set targetFile=Y:\Bulk_Pro_GPT\Output\Calibrate_.dim
set procCmd=“C:\Program Files\snap\bin\gpt.exe” Calibrate_GRDH.xml -e -p Calibrate_GRDH.properties -t “!targetFile!” “!sourceFile!”
call !procCmd!
)

Processing Y:\Input.zip
INFO: org.esa.snap.python.gpf.PyOperatorSpi: Python operator ‘py_sambuca_snap_op’ registered (Python module: ‘sambuca_snap_op’, class: ‘sambuca_snap_op’, root: ‘C:\Users\VVSK\AppData\Roaming\SNAP\modules\org-esa-sen2coral-sen2coral-inversion.jar’)
INFO: org.esa.snap.python.gpf.PyOperatorSpi: Python operator ‘S2RutOp’ registered (Python module: ‘s2_rut’, class: ‘S2RutOp’, root: ‘C:\Users\VVSK\AppData\Roaming\SNAP\modules\org-esa-snap-snap-rut.jar’)
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
Executing processing graph
done.
org.esa.snap.core.gpf.graph.GraphException: [NodeId: ReadOp@sourceProduct] Specified ‘file’ [Y:\Input.zip] does not exist.
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.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(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.esa.snap.runtime.Launcher.lambda$run$14(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(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:62)
at com.exe4j.runtime.WinLauncher.main(WinLauncher.java:101)
at com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:16)
Caused by: org.esa.snap.core.gpf.OperatorException: Specified ‘file’ [Y:\Input.zip] does not exist.
at org.esa.snap.core.gpf.common.ReadOp.initialize(ReadOp.java:81)
at org.esa.snap.core.gpf.internal.OperatorContext.initializeOperator(OperatorContext.java:486)
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)
… 30 more

Error: [NodeId: ReadOp@sourceProduct] Specified ‘file’ [Y:\Input.zip] does not exist.

Calibrate.bat (1.9 KB)
Calibrate_GRDH.properties (6 Bytes)
Calibrate_GRDH.xml (786 Bytes)

It might work if you remove the /D from the for-loop.
This is only needed if you use directories.
If your files are all in one directory the for-loop should look like

for %sourceDirectory% %%F in (.zip) do (

)

I changed it. Still it is not working

  1. It is working If I keep .zip.
    for /R %sourceDirectory% %%F in (
    .zip) do (
    Thanks for the quick help.

  2. The output file name is “Calibrate_S1A_IW_GRDH_1SDV_20151031T003131_20151031T003200_008389_00BD95_33F3.dim”. Is there any possibility that I can change the name to “Calibrate_20151031.dim”

  3. Is it possible through snappy? Do you have any examples with snappy? Which is faster snappy or gpt ?

You would need to extract the specific part from the file name (%%~nF)
On the last page of the Helpful Links you will find how to do it.

I think it will be faster from the command line. Especially because of some memory issue with snappy.