Skip to content

Adding two new indices (NDWI and VCI) - #22

Closed
astroAycha wants to merge 2 commits into
mainfrom
new-indx
Closed

Adding two new indices (NDWI and VCI)#22
astroAycha wants to merge 2 commits into
mainfrom
new-indx

Conversation

@astroAycha

Copy link
Copy Markdown
Owner

Adding two new indices (NDWI and VCI). These two are calculated from Sentinel-2 bands. They are better indices for tracking conditions that could lead to wildfires.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds two additional vegetation/water-related indices (NDWI, VCI) to the existing spectral-index extraction pipeline and exposes them in the Dash dashboard, so AOI time-series visualizations can incorporate more wildfire-relevant signals derived from Sentinel-2/HLS bands.

Changes:

  • Added NDWI and VCI computations to SpectralIndices.
  • Extended the data download/extraction pipeline to compute/store NDWI and VCI in the time-series parquet output.
  • Updated the Dash app to load and render NDWI/VCI charts alongside existing indices.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
scripts/spec_indices.py Adds calc_ndwi and calc_vci spectral index helpers.
scripts/data_download.py Computes NDWI/VCI time series and writes them into the AOI parquet outputs; updates logging summary.
app.py Adds NDWI/VCI metadata, reads NDWI/VCI columns from parquet, and renders two additional charts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/spec_indices.py
Comment on lines +141 to +143
print("Calculating Normalized Difference Water Index (NDWI)...")
denominator = nir + swir1
return xr.where(denominator != 0, (nir - swir1) / denominator, np.nan)
Comment thread app.py
Comment on lines +81 to 85
tbl = pq.read_table(
buf,
columns=["time", "ndvi", "bsi", "ndmi", "nbr", "ndwi", "vci", "aoi_name"],
)
dfs.append(tbl.to_pandas())
Comment thread scripts/data_download.py
Comment on lines +253 to +255
vci = SpectralIndices.calc_vci(ndvi_mean_ts)
vci_mean_ts = vci.groupby("time.week").mean(dim=['x', 'y']).interp(method='nearest')
spec_indices_ts.append(vci_mean_ts)
@astroAycha astroAycha closed this Aug 5, 2026
@astroAycha
astroAycha deleted the new-indx branch August 5, 2026 11:29
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.

2 participants