Skip to content

Commit

Permalink
Update lab 5 (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs authored Feb 11, 2025
1 parent 9aa147c commit 1838c2d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion book/labs/lab_05.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@
"source": [
"## Exercise 4: Calculating NDWI (Band Math)\n",
"\n",
"1. Open the multispectral image and extract the Green and Near-Infrared (NIR) bands.\n",
"1. Open the multispectral image and extract the Green and Near-Infrared (NIR) bands. This multispectral image has the following band order:\n",
" - Band 2: Blue\n",
" - Band 3: Green\n",
" - Band 4: Red\n",
" - Band 5: NIR\n",
"2. Compute the Normalized Difference Water Index ([NDWI](https://en.wikipedia.org/wiki/Normalized_difference_water_index)) using the formula:\n",
"\n",
" NDWI= (Green - NIR) / (Green + NIR)\n",
Expand Down
8 changes: 6 additions & 2 deletions book/labs/lab_05.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,14 @@ Make sure you have the following libraries installed:

## Exercise 4: Calculating NDWI (Band Math)

1. Open the multispectral image and extract the Green and Near-Infrared (NIR) bands.
1. Open the multispectral image and extract the Green and Near-Infrared (NIR) bands. This multispectral image has the following band order:
- Band 2: Blue
- Band 3: Green
- Band 4: Red
- Band 5: NIR
2. Compute the Normalized Difference Water Index ([NDWI](https://en.wikipedia.org/wiki/Normalized_difference_water_index)) using the formula:

NDWI= (Green - NIR) / (Green + NIR)
NDWI= (Green - NIR) / (Green + NIR)

3. Visualize the NDWI result using a water-friendly colormap (e.g., cmap='Blues') to highlight water bodies.
4. Save the resulting NDWI image as a new raster file named ndwi.tif.
Expand Down

0 comments on commit 1838c2d

Please sign in to comment.