Python2 coreg_ifg_topsar.py project.conf Error

Hi
At the “python2 coreg_ifg_topsar.py project.conf” step this error messages appears. I’m using snap2stamps and Snap 9.0 updated version.

sinan@sinan:/media/sinan/SiliconPowe/7bolvadin/Project/bin$ python2 coreg_ifg_topsar.py project.conf
/media/sinan/SiliconPowe/7bolvadin/Project
/media/sinan/SiliconPowe/7bolvadin/Project/graphs
IW3
/media/sinan/SiliconPowe/7bolvadin/Project/master/S1A_IW_SLC__1SDV_20200908T035851_20200908T035918_034262_03FB55_D367_Orb.dim
/home/sinan/programs/snap/bin/gpt
/media/sinan/SiliconPowe/7bolvadin/Project/graphs/coreg_ifg_computation_subset.xml

#####################################################################

Coregistration and Interferogram computation started:

#####################################################################

/media/sinan/SiliconPowe/7bolvadin/Project/split/20170103/20170103_IW3.dim
[1] Processing slave file :20170103_IW3.dim

SNAP STDOUT:INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.
Executing processing graph
INFO: org.hsqldb.persist.Logger: dataFileCache open start
WARNING: org.esa.snap.core.gpf.common.SubsetOp: No intersection with source product boundary S1A_IW_SLC__1SDV_20200908T035851_20200908T035918_034262_03FB55_D367_Orb_Stack_Deb
done.
java.lang.ArithmeticException: / by zero
at javax.media.jai.PlanarImage.XToTileX(PlanarImage.java:832)
at org.esa.snap.core.gpf.internal.OperatorImageTileStack.createLocks(OperatorImageTileStack.java:190)
at org.esa.snap.core.gpf.internal.OperatorContext.setTargetImages(OperatorContext.java:750)
at org.esa.snap.core.gpf.internal.OperatorContext.initializeOperator(OperatorContext.java:531)
at org.esa.snap.core.gpf.internal.OperatorContext.getTargetProduct(OperatorContext.java:298)
at org.esa.snap.core.gpf.Operator.getTargetProduct(Operator.java:385)
at org.esa.snap.core.gpf.graph.NodeContext.initTargetProduct(NodeContext.java:77)
at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:199)
at org.esa.snap.core.gpf.graph.GraphContext.initOutput(GraphContext.java:166)
at org.esa.snap.core.gpf.graph.GraphContext.(GraphContext.java:85)
at org.esa.snap.core.gpf.graph.GraphContext.(GraphContext.java:58)
at org.esa.snap.core.gpf.graph.GraphProcessor.executeGraph(GraphProcessor.java:127)
at org.esa.snap.core.gpf.main.DefaultCommandLineContext.executeGraph(DefaultCommandLineContext.java:86)
at org.esa.snap.core.gpf.main.CommandLineTool.executeGraph(CommandLineTool.java:547)
at org.esa.snap.core.gpf.main.CommandLineTool.runGraph(CommandLineTool.java:391)
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:59)
at org.esa.snap.core.gpf.main.GPT.main(GPT.java:37)
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:84)
at com.install4j.runtime.launcher.UnixLauncher.start(UnixLauncher.java:66)
at install4j.org.esa.snap.runtime.Launcher_gpt.main(Unknown Source)

Error: / by zero
– org.jblas INFO Deleting /tmp/jblas5961854192594937543/libquadmath-0.so
– org.jblas INFO Deleting /tmp/jblas5961854192594937543/libjblas_arch_flavor.so
– org.jblas INFO Deleting /tmp/jblas5961854192594937543/libjblas.so
– org.jblas INFO Deleting /tmp/jblas5961854192594937543/libgfortran-4.so
– org.jblas INFO Deleting /tmp/jblas5961854192594937543

[1] Finished process in 4.13127303123 seconds.

#####################################################################

@ABraun @gnwiii

Thanks a lot for your help.

Hello, @cnoyd
It appears that you’re encountering an ArithmeticException: / by zero error when running the coreg_ifg_topsar.py script with SNAP. This type of error typically occurs when there is an attempt to divide by zero in a calculation, which is not allowed in mathematics or programming.

The warning message No intersection with source product boundary suggests that the subset operation in your processing graph might be trying to create a subset of the image that does not intersect with the actual image data. This could result in an empty subset, leading to division by zero when subsequent operations are performed on this empty data set.

To resolve this issue, you should:

Ensure that the subset defined in your project.conf or the processing graph XML file actually intersects with the source product.
Check the coordinates and the region of interest (ROI) you are using for the subset operation to make sure they are within the bounds of the source image.
Verify that the source product is correctly specified and that it contains the expected data.
If the problem persists, you might want to seek assistance on the STEP forum or check if there are any known issues with the version of SNAP you are using that might be related to this error. The community there might have encountered similar issues and could provide a solution.

Best Regard,
ryan1969

1 Like

The solution to my problem was exactly as you said.

Should have been “IW2”.

Thank you @ryan1969 .