Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

earth and related environmental sciences

NDVI Time-Series Analysis of Potato Fields

A step-by-step guide to extracting and analyzing temporal NDVI profiles from potato fields for crop-type studies.

Authors
Affiliations
Eurac Research
Eurac Research
ESA EOPF Zarr Logo

🚀 Launch in JupyterHub

Run this notebook interactively with all dependencies pre-installed

Preface

The original notebook used as a starting point for this work is a openEO platform example, available here. The example has been adapted to use the data provided by the EOPF Zarr Samples project instead of the openEO API.

Introduction

This notebook demonstrates how to perform NDVI time-series analysis for potato fields using EOPF-ZARR Sentinel-2 Level-2A data. The focus is on extracting clean vegetation profiles that highlight the characteristic temporal patterns of potato growth. These profiles can later serve as input features for crop-type classification.

The workflow is structured as follows:

  • Data access: Connect to a STAC catalog and query Sentinel-2 scenes for a specific field and time range.

  • Preprocessing: Use the Scene Classification Layer (SCL) with an openEO-style mask_scl_dilation to remove clouds, shadows, snow, and other unwanted contamination.

  • NDVI computation: Derive NDVI from red (B04) and near-infrared (B08) bands, optionally scaling to match openEO conventions.

  • Temporal aggregation: Aggregate NDVI values into dekads (10-day periods), interpolate missing data, and filter to a specific season.

  • Analysis & visualization: Plot the field-mean NDVI profile with uncertainty, revealing the phenological stages of potato development.

This pipeline demonstrates how to transform raw Earth Observation data into interpretable temporal signals, laying the groundwork for future rule-based or machine learning-based crop classification.

Timeseries analysis of vegetation greenness

Different land cover types can be identified by their seasonal green-up and green-down patterns. NDVI time series capture these phenological dynamics:

  • Coniferous forests remain green all year round, showing little variation in NDVI.

  • Grasslands show moderate seasonal cycles with higher values in spring and summer.

  • Annual crops (e.g., sugar beet, maize, potato) exhibit strong seasonal fluctuations, with steep green-up during growth, a pronounced peak, and rapid decline after harvest.

An overview of NDVI trajectories for several crop types is shown in the plots below. These illustrate how temporal profiles can serve as fingerprints for distinguishing between vegetation classes.

Crop_Type_NDVI_Profiles

Setup

Start importing the necessary libraries

/home/mclaus@eurac.edu/micromamba/envs/eopf-zarr/lib/python3.11/site-packages/distributed/node.py:187: UserWarning: Port 8787 is already in use.
Perhaps you already have a cluster running?
Hosting the HTTP server on port 36871 instead
  warnings.warn(
Loading...

Area of Interest

The region of interest is located over the Belgium 31N tile, referenced in EPSG:32631. For the STAC query, the required input is the bounding box in EPSG:4326 (bbox_4326). Meanwhile, UTM-based slices are generated to subset the dataset, which is natively stored in UTM coordinates.

STAC Search

List of first Five Items returned from the STAC query: [<Item id=S02MSIL2A_20200131T105251_0000_A051_T973>, <Item id=S02MSIL2A_20200129T110209_0000_B094_T881>, <Item id=S02MSIL2A_20200126T105229_0000_B051_T215>, <Item id=S02MSIL2A_20200124T110331_0000_A094_T671>, <Item id=S02MSIL2A_20200121T105341_0000_A051_T512>]
List of first Five Zarr URLs returned from the STAC query: ['https://objects.eodc.eu/e05ab01a9d56408d82ac32d69a5aae2a:notebook-data/tutorial_data/cpm_v260/S2A_MSIL2A_20200131T105251_N0500_R051_T31UES_20230426T102522.zarr', 'https://objects.eodc.eu:443/e05ab01a9d56408d82ac32d69a5aae2a:notebook-data/tutorial_data/cpm_v260/S2B_MSIL2A_20200129T110209_N0500_R094_T31UES_20230628T193235.zarr', 'https://objects.eodc.eu:443/e05ab01a9d56408d82ac32d69a5aae2a:notebook-data/tutorial_data/cpm_v260/S2B_MSIL2A_20200126T105229_N0500_R051_T31UES_20230428T121217.zarr', 'https://objects.eodc.eu:443/e05ab01a9d56408d82ac32d69a5aae2a:notebook-data/tutorial_data/cpm_v260/S2A_MSIL2A_20200124T110331_N0500_R094_T31UES_20230428T065124.zarr', 'https://objects.eodc.eu:443/e05ab01a9d56408d82ac32d69a5aae2a:notebook-data/tutorial_data/cpm_v260/S2A_MSIL2A_20200121T105341_N0500_R051_T31UES_20230427T135726.zarr']

DataCube Creation

Loading...
/home/mclaus@eurac.edu/micromamba/envs/eopf-zarr/lib/python3.11/site-packages/distributed/client.py:3371: UserWarning: Sending large graph of size 56.08 MiB.
This may cause some slowdown.
Consider loading the data with Dask directly
 or using futures or delayed objects to embed the data into the graph without repetition.
See also https://docs.dask.org/en/stable/best-practices.html#load-data-with-dask for more information.
  warnings.warn(
Loading...

Applying Custom Mask SCL Dilation Process

Loading...

Compute NDVI

Loading...

Temporal Aggregation of NDVI

Loading...

Temporal Gap-Filling of Aggregated Mean NDVI

Loading...

Reducing Spatial Dimension

Visualising the Pattern

<Figure size 640x480 with 1 Axes>