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

No explicit handling of nans in lookup table enhancement #2934

Open
mraspaud opened this issue Oct 17, 2024 · 0 comments
Open

No explicit handling of nans in lookup table enhancement #2934

mraspaud opened this issue Oct 17, 2024 · 0 comments

Comments

@mraspaud
Copy link
Member

Describe the bug
While working on #2933, I saw there was a warning about coercing floats to ints in the lookup table enhancement test.
Turns out that the test uses data that contains NaNs, which don't seem to be explicitly taken care of.

To Reproduce

pytest -s satpy/tests/enhancement_tests/test_enhancements.py::TestEnhancementStretch::test_lookup

Expected behavior
I expect the test not to raise an warning, and that there was a way to explicitly tell the enhancement what to do with NaNs

Actual results
A warning is issued:

satpy/tests/enhancement_tests/test_enhancements.py::TestEnhancementStretch::test_lookup
  /home/a001673/usr/src/satpy/satpy/enhancements/__init__.py:292: RuntimeWarning: invalid value encountered in cast
    band_data = band_data.clip(0, lut.size - 1).astype(np.uint8)

Environment Info:

  • OS: Linux
  • Satpy Version: main
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

1 participant