Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during interpolation caused by np.nans in noiseRangeVector #99

Open
hfisser opened this issue Apr 28, 2023 · 1 comment
Open

Error during interpolation caused by np.nans in noiseRangeVector #99

hfisser opened this issue Apr 28, 2023 · 1 comment

Comments

@hfisser
Copy link

hfisser commented Apr 28, 2023

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.

@akorosov
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants