sentinel1denoised icon indicating copy to clipboard operation
sentinel1denoised copied to clipboard

Error during interpolation caused by np.nans in noiseRangeVector

Open hfisser opened this issue 1 year ago • 1 comments

Thanks for the great work and the neat package.

Summary The noise range lookup-table returned only 0s that were replaced by np.nans 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 and remove_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 in get_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.nans.
  • The noise vector had only np.nans because the noiseRangeVector had zeros that had been replaced by np.nans in get_noise_range_vectors. The corresponding line is 153 in sentinel1image: n[n == 0] = np.nan.
  • Among 16673 pixels, 176 were np.nan in the noise vector filled in get_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.

hfisser avatar Apr 28 '23 09:04 hfisser

I'm afraid this image is too old and ESA doesn't provide noise range values in the auxiliary metadata.

akorosov avatar May 24 '23 14:05 akorosov