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

Normalized difference calculation fixes #72

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

cgmorton
Copy link
Member

@cgmorton cgmorton commented Dec 5, 2024

No description provided.

Scaled all NDVI and NDWI input values by 10 to better match real reflectance values and allow for adjustments to high reflectance values.

Added separate tests for NDWI function.

Switched to using the "sr_image" object in the landsat tests.
…reflectance

The build in normalizedDifference function returns no data if the input values are negative, but the reflectance values over water are often negative in collection 2.  Also the normalized difference calculation is very sensitive to small changes when the reflectance values are very low and may not be representative of real differences.

Setting NDWI to zero for pixels with very low reflectance, and setting NDVI to -0.1 for pixels with very low reflectance that are flagged as water in the QA_PIXEL band, and 0 for all other (low reflectance) pixels.  These values, or the thresholds, may need to be changed or adjusted in the future.
Also had to add a QA_PIXEL band to the test Landsat image since the water mask is looked at in the NDVI calculation now.
In theory they should probably be much lower, but the goal for this change is only to catch saturated pixels that are returning invalid NDWI values.
Use the global surface water maximum extent layer to avoid assigning shadows that are misclassified as water with a negative NDVI.  This isn't a perfect solution but it will help with the really obvious ones.
This is needed because the tests are made using constant images.
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

Successfully merging this pull request may close these issues.

1 participant