Error when attempting to extract shadow from a terrain-corrected SAR image

Hi,

I’m trying to perform a SAR-Simulation to extract the shadow and layover from a SAR image that was just before that calibrated, speckle-filtered, and terrain-correction (in this order).

Below is the error I get when I run the graph with gpt:

INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
Executing processing graph
INFO: org.hsqldb.persist.Logger: dataFileCache open start
..90% done.
org.esa.snap.core.gpf.OperatorException: 0
        at org.esa.snap.core.gpf.graph.GraphProcessor$GPFImagingListener.errorOccurred(GraphProcessor.java:363)
        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: 0
        at org.esa.s1tbx.sar.gpf.geometric.SARSimulationOp.computeTileStack(SARSimulationOp.java:510)
        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
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
        at org.esa.s1tbx.commons.SARGeocoding.computeRangeIndex(SARGeocoding.java:350)
        at org.esa.s1tbx.sar.gpf.geometric.SARSimulationOp.computeTileOverlapPercentage(SARSimulationOp.java:452)
        at org.esa.s1tbx.sar.gpf.geometric.SARSimulationOp.computeTileStack(SARSimulationOp.java:508)
        ... 14 more

Error: 0

Is it impossible to have the SAR-Simulation operator performed after the Terrain-Correction one?
Does it (SAR-Simulation) have to be followed by a SARSim-Terrain-Correction and Cross-Correlation instead, as mentioned here)?

Thanks.

I don’t think it makes sense after terrain correction. We should have an error check for that.
Thanks

Thanks for the prompt response.

I ended up performing the SAR-Simulation just before the Terrain-Correction, and then using BandMaths to transform all pixels in shadow or layover to NaN.

The good thing about this ordering of operations is that pixels set as NaN before the TC keep the same value after the TC.

1 Like