Schedule icon
Script icon
Process icon
Download icon
If icon
ArchiveCompress icon
Log icon

Build a cloud-masked Sentinel-2 NDVI GeoTIFF from Earth Search

Query Earth Search, crop Sentinel-2 bands, apply SCL cloud masks, and package a verified NDVI GeoTIFF with provenance and checksums.

Categories
Data

Create a small, real vegetation-index artifact instead of downloading entire satellite tiles. Tile cloud percentage is only a search filter: the flow separately checks usable pixels inside the AOI.

How it works

  1. A disabled weekly schedule or manual execution validates inputs, then queries Earth Search for up to 100 Sentinel-2 L2A scenes.
  2. Select the lowest-cloud returned tile whose bounding box contains the full AOI. No matches produce no artifact. Search truncation is recorded, not hidden.
  3. Read red, near-infrared and scene-classification COG windows using HTTP range requests. Apply each band's STAC scale and offset. Keep SCL classes 4, 5 and 6 only and require positive reflectance sums.
  4. Fail before packaging if the usable fraction is too low. Write NDVI=(NIR-red)/(NIR+red), with -9999 nodata, and a provenance manifest.
  5. Reopen the raster, check dimensions, CRS, mask, counts and physical bounds, then hash and ZIP the verified outputs.

What you get

  • outputs.package_verified_raster.uri: ZIP containing ndvi.tif, manifest.json and SHA256SUMS, only when a scene passes.
  • Manifest includes source assets, calibration, AOI, scene ID, valid fraction and mean NDVI.
  • Partial tiles, oversized windows and missing calibration fail closed.

Who it's for

  • Geospatial engineers preparing small AOI vegetation inputs for downstream analysis.

Why orchestrate this with Kestra

  • Each catalog, processing, verification and publication task stays visible. Failed quality checks block the ZIP.

Prerequisites

  • Python 3.10+ with uv available on a trusted worker. Process tasks install pinned NumPy and Rasterio wheels; no Docker required.
  • HTTPS access to Earth Search, Sentinel COGs and Python package indexes.
  • AOI maximum 0.05 degrees per side, within +/-80 latitude, not crossing the antimeridian, and entirely in one tile. No mosaics.

Secrets

  • None. Catalog and source COGs are public. No uploads.

Quick start

  1. Import the flow. bbox is a JSON string; defaults select a small Fresno AOI. Dates default to the last 30 days. max_cloud_pct defaults to 20; min_valid_fraction defaults to 0.5.
  2. Execute and inspect selection.json and the verified ZIP. If no qualifying tile exists, widen the date interval. A cloudy AOI may still fail despite a clear tile average.
  3. Enable the weekly schedule only after a successful manual run.

How to extend

  • Feed the verified raster into a downstream model, or store the ZIP in object storage.
  • Add pagination for long search windows; selection is limited to returned results.
  • NDVI and SCL masks are analytical inputs, not ground-truth crop-health assessments.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.