sentinel1denoised
sentinel1denoised copied to clipboard
Error during interpolation caused by np.nans in noiseRangeVector
Thanks for the great work and the neat package.
Summary
The noise range lookup-table returned only 0s that were replaced by np.nan
s in get_noise_range_vectors
, which led to an error in InterpolatedUnivariateSpline
.
Setup Machine: Kubuntu 22.04, 8 x 11th Gen Intel Core i5, 15.4 GiB of RAM. Program: Python 3.8.15
Processing
- S1A_EW_GRDM_1SDH_20160912T132507_20160912T132607_013020_0149F1_B83A.SAFE (ascending)
- HV polarization
- Tested
remove_thermal_noise
andremove_texture_noise
Error
An error was raised in remove_texture_noise
and remove_thermal_noise
.
The investigation implies:
- The error was caused by the
InterpolatedUnivariateSpline
method called inget_shifted_noise_vectors
. -
InterpolatedUnivariateSpline
failed because empty vectors were passed to it. - The vectors were empty because the noise vector at this azimuth and range had only
np.nan
s. - The noise vector had only
np.nan
s because thenoiseRangeVector
had zeros that had been replaced bynp.nan
s inget_noise_range_vectors
. The corresponding line is 153 insentinel1image
:n[n == 0] = np.nan
. - Among 16673 pixels, 176 were
np.nan
in thenoise
vector filled inget_noise_range_vectors
.
Side note
- Processing HH of this product did not cause any error
- Processing HV and HH of a different product on the same date and in the same geographic region did not cause any error S1A_EW_GRDM_1SDH_20160912T033838_20160912T033942_013014_0149C3_BCC8.SAFE (descending)
Suggestions
A. Quick fix: Introduce an error handling that catches the exception raised by InterpolatedUnivariateSpline
.
B. Root cause: Find out why noiseRangeVector['noiseRangeLut'] has 0s and either address it and/or do A.
I'm afraid this image is too old and ESA doesn't provide noise range values in the auxiliary metadata.