No Data Value of DEM for Terrain Flattening

Hi S1TBX Team,
Thanks for offering the excellent toolbox for SAR data processing. We have been using SNAP for large volume of Sentinel-1 data processing since 2016. For generation of radiometric terrain corrected Gamma0, Terrain Flattening is included within the workflow. It is absolutely fine if the image was captured over land. But if the image covers a coastal region or involves open water, we normally use an external DEM and set the “externalDEMNoDataValue” to a small value to preserve the features on water surface. It is not feasible to do this if automatic downloaded DEM is used. Because of no option for setting no data value of DEM, all pixels (without DEM) were masked out. Please see the following examples:


where the red layer is the image processed with pre-downloaded COP 30m DEM as an external DEM, the green layer is the same source imaged processed with automatic download of Copernicus 30m Global DEM. One can find those waves, ships, jetties and bridges were masked out in the green layer.
We were wondering whether an option for setting the “DEMNoDataValue” could be also implemented to automatic downloaded DEM in the future update…
Thanks for your kind attention.

I have investigated this a little bit and I “think” that this is actually an incorrect setting in the model desriptor for both Copernicus DEM products. In Copernicus30mElevationModelDescriptor.java for example, the getNoDataValue() function returns a value of 0.
image

This has the effect ultimately of clipping out all marine data where the elevation is (legitimately) 0.

I agree that it would be might be useful to have this configurable, but in this instance, the model descriptor appears to be incorrect.

@zsz perhaps you can flag this with the “Problem Reports” category as well because I think that this is simply a problem in the code.