Skip to content

Improve NDWI numerical stability and clean redundant imports in create_masks.py#88

Open
LJitendra05 wants to merge 3 commits intofwitmer:masterfrom
LJitendra05:improve-ndwi-stability
Open

Improve NDWI numerical stability and clean redundant imports in create_masks.py#88
LJitendra05 wants to merge 3 commits intofwitmer:masterfrom
LJitendra05:improve-ndwi-stability

Conversation

@LJitendra05
Copy link
Copy Markdown

@LJitendra05 LJitendra05 commented Mar 6, 2026

fixes #87
This PR improves the create_masks.py preprocessing script by cleaning redundant imports and improving the numerical stability of the NDWI calculation.

Changes

  • Removed duplicate imports (mask, os)

  • Improved NDWI calculation to prevent division-by-zero:

    ndwi = (green - nir) / (green + nir + 1e-8)
    
  • Minor code cleanup for readability.

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.

Enhancement: Improve NDWI stability and clean redundant imports in create_masks.py

1 participant