Terrain-Flattening not working for C2 Matrix?

Hi all,

I have a problem running the Terrain-Flattening for VV/VH-covariance Matrix (C2 ), error massage: [NodeID: Terrain-Flattening] java.lang.NullPointerException.

I am running latest SNAP version 8.0.3 (S1TBX). I tried the processing: (i) using the GUI and applying the functions step-by-step, (ii) using the graph builder, (iii) using the GPT. Same error for all instances.

I also tried for several Sentinel-1 datasets of different locations (all within the SRTM coverage).

Interestingly, the Terrain-Flattening works for the same datasets, when I go for the beta0 calibration and not for the C2 Matrix

Any ideas?

Thanks and kind regards,
Tobiasgraphexample.xml (4.0 KB)

I have just tested it with quad-pol ALOS C3 data and receive the same error.

Apparently, there was already a ticket for this, so I raised it again: https://senbox.atlassian.net/browse/SITBX-607

Thanks for the reply and for the ticket.
I have used the Terrain-Flattening for C2 Matrix many times in SNAP version 7, so I suppose it is related to the update of the version.
Regards

Hi @ABraun,
Have there been any updates about this error?
I am having the same issues with Sentinel-1 data.
I am working with version 8.0.5
Thanks!

Hi all,

maybe Mr. @TobiasUllmann faced the same problem like me:

While performing Terrain-Flatteing on Sentinel-1 SLC IW Data the following error message occur:

INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: GDAL not found on system. Internal GDAL 3.0.0 from distribution will be used. (f1)
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.
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.
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.
Executing processing graph
INFO: org.hsqldb.persist.Logger: dataFileCache open start
…10%…java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
90% done.
org.esa.snap.core.gpf.OperatorException: java.lang.NullPointerException
at org.esa.snap.core.gpf.graph.GraphProcessor$GPFImagingListener.errorOccurred(GraphProcessor.java:379)
at com.sun.media.jai.util.SunTileScheduler.sendExceptionToListener(Unknown Source)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
at javax.media.jai.OpImage.getTile(Unknown Source)
at javax.media.jai.PlanarImage.cobbleFloat(Unknown Source)
at javax.media.jai.PlanarImage.getData(Unknown Source)
at com.bc.ceres.glevel.MultiLevelImage.getData(MultiLevelImage.java:64)
at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:449)
at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:435)
at org.esa.snap.core.gpf.Operator.getSourceTile(Operator.java:459)
at org.esa.s1tbx.sar.gpf.filtering.SpeckleFilters.LeeSigma.performFiltering(LeeSigma.java:384)
at org.esa.s1tbx.sar.gpf.filtering.SpeckleFilters.LeeSigma.computeTile(LeeSigma.java:349)
at org.esa.s1tbx.sar.gpf.filtering.SpeckleFilterOp.computeTile(SpeckleFilterOp.java:291)
at org.esa.snap.core.gpf.internal.OperatorImage.computeRect(OperatorImage.java:82)
at javax.media.jai.SourcelessOpImage.computeTile(Unknown Source)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
at javax.media.jai.OpImage.getTile(Unknown Source)
at javax.media.jai.PlanarImage.cobbleFloat(Unknown Source)
at javax.media.jai.PlanarImage.getData(Unknown Source)
at com.bc.ceres.glevel.MultiLevelImage.getData(MultiLevelImage.java:64)
at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:449)
at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:435)
at org.esa.snap.core.gpf.Operator.getSourceTile(Operator.java:459)
at org.esa.s1tbx.sar.gpf.MultilookOp.computeTile(MultilookOp.java:183)
at org.esa.snap.core.gpf.internal.OperatorImage.computeRect(OperatorImage.java:82)
at javax.media.jai.SourcelessOpImage.computeTile(Unknown Source)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
at javax.media.jai.OpImage.getTile(Unknown Source)
at javax.media.jai.PlanarImage.cobbleFloat(Unknown Source)
at javax.media.jai.PlanarImage.getData(Unknown Source)
at com.bc.ceres.glevel.MultiLevelImage.getData(MultiLevelImage.java:64)
at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:449)
at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:435)
at org.esa.snap.core.gpf.Operator.getSourceTile(Operator.java:459)
at org.esa.s1tbx.sar.gpf.geometric.RangeDopplerGeocodingOp.computeTileStack(RangeDopplerGeocodingOp.java:949)
at org.esa.snap.core.gpf.internal.OperatorImageTileStack.computeRect(OperatorImageTileStack.java:122)
at org.esa.snap.core.gpf.internal.OperatorImageTileStack.computeTile(OperatorImageTileStack.java:86)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
at javax.media.jai.OpImage.getTile(Unknown Source)
at javax.media.jai.PlanarImage.getData(Unknown Source)
at com.bc.ceres.glevel.MultiLevelImage.getData(MultiLevelImage.java:64)
at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:449)
at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:435)
at org.esa.snap.core.gpf.internal.OperatorImageTileStack.computeRect(OperatorImageTileStack.java:116)
at org.esa.snap.core.gpf.internal.OperatorImageTileStack.computeTile(OperatorImageTileStack.java:86)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
at javax.media.jai.OpImage.getTile(Unknown Source)
at com.sun.media.jai.util.RequestJob.compute(Unknown Source)
at com.sun.media.jai.util.WorkerThread.run(Unknown Source)
Caused by: org.esa.snap.core.gpf.OperatorException: java.lang.NullPointerException
at org.esa.snap.engine_utilities.gpf.OperatorUtils.catchOperatorException(OperatorUtils.java:432)
at org.esa.s1tbx.sar.gpf.geometric.TerrainFlatteningOp.computeTileStack(TerrainFlatteningOp.java:514)
at org.esa.snap.core.gpf.internal.OperatorImageTileStack.computeRect(OperatorImageTileStack.java:122)
at org.esa.snap.core.gpf.internal.OperatorImageTileStack.computeTile(OperatorImageTileStack.java:86)
… 47 more
Caused by: org.esa.snap.core.gpf.OperatorException: java.lang.NullPointerException
at org.esa.snap.engine_utilities.gpf.OperatorUtils.catchOperatorException(OperatorUtils.java:432)
at org.esa.s1tbx.sar.gpf.geometric.TerrainFlatteningOp.outputNormalizedImage(TerrainFlatteningOp.java:883)
at org.esa.s1tbx.sar.gpf.geometric.TerrainFlatteningOp.computeTileStack(TerrainFlatteningOp.java:503)
… 49 more
Caused by: java.lang.NullPointerException
at org.esa.s1tbx.commons.SARGeocoding.getSRGRCoefficients(SARGeocoding.java:409)
at org.esa.s1tbx.sar.gpf.geometric.TerrainFlatteningOp.outputNormalizedImage(TerrainFlatteningOp.java:857)
… 50 more

Error: java.lang.NullPointerException

The strange thing about that is that the code used to run, but after a update of SNAP now this error accures. Using SNAP Version is 8.0.7. I also tried GUI and GPT, all available DEMs & Terrain-Flattening-Settings, SNAP Performance settings etc.

Additional I ran through all SLC processing steps (mainly after a post of @ABraun, thx by the way for your valuable posts and information! :slight_smile: ) and only the Terrain-Flattening leads to an error.

Let me know if more Information is needed to solve that problem. Would be really happy about your help.

Kind regards

2 Likes

Hi all, thanks for the answers!
I am still facing the problem: no Terrain-Flattening is possible with C2 Matrix, running SNAP Version 8.0.9 and S1TBX 8.0.5
Thanks and kind regards

I believe line 183 of the Terrain Flatting code at s1tbx/TerrainFlatteningOp.java at master · senbox-org/s1tbx · GitHub should be revised such that if (!validator.isCalibrated()) should be separate from the if condition at line 180. Otherwise, for polarimetric matrix sourceProductType, the variable newSourceProduct is null.

Hope this bug can be resolved in the next update.

1 Like

@jun_lu Could you please help resolve this bug in the repository?

I have pulled the source code and revised Line 183 of the Terrain Flattening code as the following, and tested with a polarimetric C2 matrix image successfully.

Thanks