Improper handling of thermal noise removal.
The problem
The heuristic used in !69 (merged) to remove thermal noise is flawed.
Description
Indeed, S1 products generated with IPF v2.9 use 0 to indicate nodata on image sides. This region is not parallel to images sides and its width may vary.
In the end, Border Cutting done with fixed margin of 1000px may not be enough: we may encounter 1000px margins made of 0's contiguous to bands of 1e-7 values that should have been null as well.
The actual border cutting needs to use the 0's in S1 images as a mask to correctly keep nodata as 0, and nosignal value at 1e-7.
Correction proposition
-
Calibration with or without NoiseRemoval
-
In case of NoiseRemoval
- BandMath, with
exp = im{sar}b1 == 0 ? 0 : im{cal}b1 == 0 ? 1e-7 : im{cal}b1
- BandMath, with
-
ResetMargin is conditionally applied
- if there are lines to cut at the start and/or end of the image,
- or if IPF version is < 2.9 for images sides -- cutting the first/last lines may also be executed simultaneously