Skip to content

Commit 6dfd996

Browse files
author
roberto_esaclear
committed
feat: Add NDVI calculation explanation and formula to the notebook
1 parent 2342d6a commit 6dfd996

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

notebooks/3_interesect_S2_S1.ipynb

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,17 +1596,40 @@
15961596
"# Calculate NDVI"
15971597
]
15981598
},
1599+
{
1600+
"cell_type": "markdown",
1601+
"id": "f618310e",
1602+
"metadata": {},
1603+
"source": [
1604+
"### NDVI (Normalized Difference Vegetation Index)\n",
1605+
"\n",
1606+
"The **Normalized Difference Vegetation Index (NDVI)** quantifies vegetation greenness and health by comparing the reflectance in the near-infrared (NIR) and red (RED) spectral bands.\n",
1607+
"\n",
1608+
"**Formula:**\n",
1609+
"\n",
1610+
"NDVI = \\frac{(NIR - RED)}{(NIR + RED)}\n",
1611+
"\n",
1612+
"**Where:**\n",
1613+
"- **NIR** → Reflectance in the near-infrared band (typically 0.76–0.90 µm) \n",
1614+
"- **RED** → Reflectance in the red band (typically 0.63–0.69 µm)\n",
1615+
"\n",
1616+
"**Typical NDVI interpretation:**\n",
1617+
"\n",
1618+
"| NDVI range | Surface type / Vegetation condition |\n",
1619+
"|:-----------:|:------------------------------------|\n",
1620+
"| -1.0 – 0.0 | Water, snow, clouds (no vegetation) |\n",
1621+
"| 0.0 – 0.2 | Bare soil or sparse vegetation |\n",
1622+
"| 0.2 – 0.5 | Moderate vegetation (grasslands, crops) |\n",
1623+
"| 0.5 – 1.0 | Dense, healthy vegetation (forests, tropical areas) |\n"
1624+
]
1625+
},
15991626
{
16001627
"cell_type": "code",
16011628
"execution_count": null,
16021629
"id": "71b13ef8",
16031630
"metadata": {},
16041631
"outputs": [],
16051632
"source": [
1606-
"import rasterio\n",
1607-
"import numpy as np\n",
1608-
"import matplotlib.pyplot as plt\n",
1609-
"\n",
16101633
"# File paths for NIR (B08) and Red (B04) bands\n",
16111634
"band_paths = {\n",
16121635
" 'nir': './out/S2B_MSIL1C_20240320T095649_N0510_R122_T32TQM_20240320T120139.SAFE/GRANULE/L1C_T32TQM_A036756_20240320T100108/IMG_DATA/T32TQM_20240320T095649_B08.jp2',\n",

0 commit comments

Comments
 (0)