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

Something wrong with NDWI #14

Closed
abreufilho opened this issue Sep 23, 2022 · 2 comments
Closed

Something wrong with NDWI #14

abreufilho opened this issue Sep 23, 2022 · 2 comments

Comments

@abreufilho
Copy link

Hello, i've been trying to use the computeIndex for NDWI but apart from all other indexes working well, NDWI has been presenting issues so i've tested every way to compute it correctly but it seems something's wrong.

The image below shows the test i've made using the same variables but computeIndex returning the wrong range of values:

image

@abreufilho
Copy link
Author

UPDATE: Appears to be an issue with rasterio reading the band without casting ".astype(float)".

Using src.read(band_index).astype(float) fixed it for me.

@davemlz
Copy link
Member

davemlz commented Sep 23, 2022

Perfect!

I'm closing this issue. Please re-open it if you find it again working wrong ;)

Best,

David

@davemlz davemlz closed this as completed Sep 23, 2022
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