Submitting a bug to the snap toolbox team

hi,
I posted an issue I was having creating a DEM to the step forum and it looks like it is an actual bug rather than something wrong with the steps I was taking. I have tested it on several different OSes and different software versions with the same problem. I even found that someone had submitted the same bug to github repos.

I tried to submit it to https://senbox.atlassian.net/ where a previous bug was logged but I cannot create an account as my domain is not recognised. Could someone escalate this as an issue with the toolbox?

Describe the bug in this forum. A full description is needed so that reproduction of the bug is possible.

Here is the information on the bug from the previous forum post:

I am getting an error during the final step of the DEM generation process when executing the phase to elevation function. I am using the Fogo dataset from the TOPS Interferometry tutorial. I will first outline how I am generating the data because the tutorial I was following focused on deformation, not topology and I may have missed a fundamental earlier step:

1 Open the products: For DEM generation the products must be Single Look Complex (SLC), and have the same Mode, Track and pass.

2 Coregister the images into a stack:
Radar -> S1 TOPS coregistration -> S1 TOPS Coregistration

3 In the TOPSAR-Split tab, select the IW3 subswath for each of the products.

4 Interferogram Formation:
Radar -> Interferometric -> Products -> Interferogram Formation

4 TOPS Deburst to join all burst data into a single image:
Radar -> Sentinel1 TOPS -> S1-TOPS deburst

5 Goldstein Phase Filtering
Radar -> Interferometric -> Filtering -> Goldstein Phase Filtering

6 Unwrap into SNAPHU format:
Radar -> Interferometric -> unwrapping -> Snaphu export
make sure the statistical cost mode if TOPO for DEM in snaphuExport

7 Run Snaphu. It must be compiled and run on linux (or possibly cygwin)
The export generates a snaphu.conf file that contains the command to execute, e.g.:
snaphu -f snaphu.conf Phase_ifg_IW3_VV_03Nov2014_27Nov2014.snaphu.img 3946

Snaphu currently crashes with Segmentation fault (core dumped) on 64 bit machines. This is due to a problem in the source:

Doris 9 – Segmentation fault: error in SNAPHU

In 64-bit operating system, SNAPHU may come into an segmentation error like this: snaphu v1.4.229 parameters input from file snaphu.conf (219 lines total) Logging run-time parameters to file snaphu…

This is caused by ctime() function in src/snaphu_io.c file [1]. To solve this problem, edit this file, change “#include ” into “#include ”, and then compile and install again

8 Import Snaphu:
Radar -> Interferometric -> unwrapping -> Snaphu import
make sure the read-phase is the package you exported and the read-unwrapped-phase is
the .hdr file outputted by snaphu

9 Generate DEM by converting phase to height:
Radar -> Interferometric -> products -> Phase to Elevation

10 Apply Range Doppler Terrain Correction:
Radar -> Geometric -> terrain correction -> Range Doppler Terrain Correction.

I get the following error at step 9:
org.esa.snap.core.gpf.OperatorException: java.lang.NullPointerException
at org.esa.snap.engine_utilities.gpf.OperatorUtils.catchOperatorException(OperatorUtils.java:421)
at org.esa.s1tbx.insar.gpf.PhaseToElevationOp.computeTileStack(PhaseToElevationOp.java:336)
at org.esa.snap.core.gpf.internal.OperatorImageTileStack.computeRect(OperatorImageTileStack.java:116)
at org.esa.snap.core.gpf.internal.OperatorImageTileStack.computeTile(OperatorImageTileStack.java:85)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904)
Caused: org.esa.snap.core.gpf.OperatorException: java.lang.NullPointerException
at org.esa.snap.core.gpf.internal.OperatorExecutor$GPFImagingListener.errorOccurred(OperatorExecutor.java:376)
at com.sun.media.jai.util.SunTileScheduler.sendExceptionToListener(SunTileScheduler.java:1646)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:921)
at javax.media.jai.OpImage.getTile(OpImage.java:1129)
at javax.media.jai.PlanarImage.getData(PlanarImage.java:2085)
at com.bc.ceres.glevel.MultiLevelImage.getData(MultiLevelImage.java:64)
at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:407)
at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:393)
at org.esa.snap.core.gpf.internal.OperatorImage.computeRect(OperatorImage.java:73)
at javax.media.jai.SourcelessOpImage.computeTile(SourcelessOpImage.java:137)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904)
at javax.media.jai.OpImage.getTile(OpImage.java:1129)
at com.sun.media.jai.util.RequestJob.compute(SunTileScheduler.java:247)
[catch] at com.sun.media.jai.util.WorkerThread.run(SunTileScheduler.java:468)

I have tried several variations on the approach but all of them get the same exception. I have also tried phase to height but when I click run, nothing is output. Any help understanding the bug or working out where I went wrong would be greatly appreciated.

Hi,
Here are the details of the bug:

Hi,
I am getting an error during the final step of the DEM generation process
when executing the phase to elevation function. I am using the Fogo dataset
from the TOPS Interferometry tutorial. I will first outline how I am
generating the data because the tutorial I was following focused on
deformation, not topology and I may have missed a fundamental earlier step:

1 Open the products: For DEM generation the products must be Single Look
Complex (SLC), and have the same Mode, Track and pass.

2 Coregister the images into a stack:
Radar -> S1 TOPS coregistration -> S1 TOPS Coregistration

3 In the TOPSAR-Split tab, select the IW3 subswath for each of the products.

4 Interferogram Formation:
Radar -> Interferometric -> Products -> Interferogram Formation

4 TOPS Deburst to join all burst data into a single image:
Radar -> Sentinel1 TOPS -> S1-TOPS deburst

5 Goldstein Phase Filtering
Radar -> Interferometric -> Filtering -> Goldstein Phase Filtering

6 Unwrap into SNAPHU format:
Radar -> Interferometric -> unwrapping -> Snaphu export
make sure the statistical cost mode if TOPO for DEM in snaphuExport

7 Run Snaphu. It must be compiled and run on linux (or possibly cygwin)
The export generates a snaphu.conf file that contains the command to
execute, e.g.:
snaphu -f snaphu.conf Phase_ifg_IW3_VV_03Nov2014_27Nov2014.snaphu.img 3946

Snaphu currently crashes with Segmentation fault (core dumped) on 64 bit
machines. This is due to a problem in the source:


https://yunjunz.com/2015/02/10/doris-9-segmentation-fault-error-in-snaphu/Doris
9 – Segmentation fault: error in SNAPHU
https://yunjunz.com/2015/02/10/doris-9-segmentation-fault-error-in-snaphu/

In 64-bit operating system, SNAPHU may come into an segmentation error like
this: snaphu v1.4.229 parameters input from file snaphu.conf (219 lines
total) Logging run-time parameters to file snaphu…

This is caused by ctime() function in src/snaphu_io.c file [1]. To solve
this problem, edit this file, change “#include ” into “#include ”, and then
compile and install again

8 Import Snaphu:
Radar -> Interferometric -> unwrapping -> Snaphu import
make sure the read-phase is the package you exported and the
read-unwrapped-phase is
the .hdr file outputted by snaphu

9 Generate DEM by converting phase to height:
Radar -> Interferometric -> products -> Phase to Elevation

10 Apply Range Doppler Terrain Correction:
Radar -> Geometric -> terrain correction -> Range Doppler Terrain
Correction.

I get the following error at step 9:
org.esa.snap.core.gpf.OperatorException: java.lang.NullPointerException
at
org.esa.snap.engine_utilities.gpf.OperatorUtils.catchOperatorException(OperatorUtils.java:421)
at
org.esa.s1tbx.insar.gpf.PhaseToElevationOp.computeTileStack(PhaseToElevationOp.java:336)
at
org.esa.snap.core.gpf.internal.OperatorImageTileStack.computeRect(OperatorImageTileStack.java:116)
at
org.esa.snap.core.gpf.internal.OperatorImageTileStack.computeTile(OperatorImageTileStack.java:85)
at
com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904)
Caused: org.esa.snap.core.gpf.OperatorException:
java.lang.NullPointerException
at
org.esa.snap.core.gpf.internal.OperatorExecutor$GPFImagingListener.errorOccurred(OperatorExecutor.java:376)
at
com.sun.media.jai.util.SunTileScheduler.sendExceptionToListener(SunTileScheduler.java:1646)
at
com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:921)
at javax.media.jai.OpImage.getTile(OpImage.java:1129)
at javax.media.jai.PlanarImage.getData(PlanarImage.java:2085)
at com.bc.ceres.glevel.MultiLevelImage.getData(MultiLevelImage.java:64)
at
org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:407)
at
org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:393)
at
org.esa.snap.core.gpf.internal.OperatorImage.computeRect(OperatorImage.java:73)
at javax.media.jai.SourcelessOpImage.computeTile(SourcelessOpImage.java:137)
at
com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904)
at javax.media.jai.OpImage.getTile(OpImage.java:1129)
at com.sun.media.jai.util.RequestJob.compute(SunTileScheduler.java:247)
[catch] at
com.sun.media.jai.util.WorkerThread.run(SunTileScheduler.java:468)

I have tried several variations on the approach but all of them get the
same exception. I have also tried phase to height but when I click run,
nothing is output. Any help understanding the bug or working out where I
went wrong would be greatly appreciated.

That’s not enough, you need to also specify operating system, toolbox version, used satellite products and share your processing graphs.

Apologies, here is the extra information:
Operating systems: Ubuntu 16.04, Windows 10
SNAP version: 5.0.0
JRE: 1.8.0_102-b14
Datasets: fogo tutorial S1A_IW_SLC__1SSV_20141103T195043_20141103T195057_003122_00395A_F396.zip S1A_IW_SLC__1SSV_20141127T195042_20141127T195056_003472_004117_2B48.zip

I did not use processing graphs, I manually selected the options in the toolbox.

Is there any more information required to submit the bug?

It’s not clear to me if there is a problem with SNAPHU or not in the end?

That is true, it could be a bug with snaphu but the import seems to work and I can see the unwrapped phase data.

I am running version 1.4.2 and there are no errors in the output. It is producing a hdr file and the relevant tiles that seem to produce the error. I will try an earlier version and see if that changes anything. Is there anything else I could look at regarding snaphu?

I uninstalled my source build and used the build from the repo. There only seems to be version 1.4.2 available online. I ran the new version and it ran successfully but phase to elevation produced the same error. I have attached an image of the unwrapped results and the snaphu log file. There doesnt seem to be any errors in the log.

snaphu.log (3.6 KB)

Have you had a chance to create a bug report or test it for yourself? The snaphu code was last updated in 2003 so I dont think it is a bug on their side. If you have a snaphu example please send it on.

Hello, I can not find " src/snaphu_io.c file" Where it can be found?

Phase to Elevation and Phase to Height still both cause an error in SNAP 6b. Could it be a bug (@junlu)?

I had a coregistered TanDEM-X scene, calculated an interferogram, filtered it, exported it, unwrapped it with SNAPHU and imported it back again using the snaphu import. But the calculation to absolute elevation values always fails (tried with STBX 1.1.1 with same error)

org.esa.snap.core.gpf.OperatorException: java.lang.NullPointerException
at org.esa.snap.core.gpf.internal.OperatorExecutor$GPFImagingListener.errorOccurred(OperatorExecutor.java:376)
at com.sun.media.jai.util.SunTileScheduler.sendExceptionToListener(SunTileScheduler.java:1646)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:921)
at javax.media.jai.OpImage.getTile(OpImage.java:1129)
at javax.media.jai.PlanarImage.getData(PlanarImage.java:2085)
at com.bc.ceres.glevel.MultiLevelImage.getData(MultiLevelImage.java:64)
at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:407)
at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:393)
at org.esa.snap.core.gpf.internal.OperatorImage.computeRect(OperatorImage.java:73)
at javax.media.jai.SourcelessOpImage.computeTile(SourcelessOpImage.java:137)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904)
at javax.media.jai.OpImage.getTile(OpImage.java:1129)
at com.sun.media.jai.util.RequestJob.compute(SunTileScheduler.java:247)
at com.sun.media.jai.util.WorkerThread.run(SunTileScheduler.java:468)
Caused by: org.esa.snap.core.gpf.OperatorException: java.lang.NullPointerException
at org.esa.snap.engine_utilities.gpf.OperatorUtils.catchOperatorException(OperatorUtils.java:421)
at org.esa.s1tbx.insar.gpf.PhaseToElevationOp.computeTileStack(PhaseToElevationOp.java:336)
at org.esa.snap.core.gpf.internal.OperatorImageTileStack.computeRect(OperatorImageTileStack.java:116)
at org.esa.snap.core.gpf.internal.OperatorImageTileStack.computeTile(OperatorImageTileStack.java:85)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904)
… 11 more

Thanks all for reporting the bugs. We will look into them.
Jun

The bug with Phase to Height has been fixed while the one with Phase to Elevation was somehow not repeatable. Can we know the S1 data set that you used for the test?

Thanks,
Jun

thank you for looking at it.
It was a TanDEM-X coregistered scene. If you want, I could provide it to you for testing reasons.