Processing Pipeline

Geospatial workflow orchestration — Sentinel-2 → cloud mask → NDVI → deforestation alert → carbon → report

Pipeline Runs

Sundarbans Mangrove Reserve

2025-06-25 06:00 UTC

running

running…

Sentinel-2 Download

7m 44s

Fetch L2A tiles from Copernicus Open Access Hub via boto3 / AWS S3 mirror

Cloud Masking

2m 50s

Apply Scene Classification Layer (SCL), mask classes 8–10. Rasterio + NumPy

NDVI Calculation

running…

NDVI = (B8 − B4) / (B8 + B4) · 30-day median composite · GDAL warping

Deforestation Alert

Compare current NDVI to 12-month rolling baseline. Flag Δ < −0.05. GeoPandas vectorise

Carbon Estimation

Allometric model: AGB → C → CO₂e. IPCC Tier 2. Monte Carlo uncertainty (n=10k)

Report Generation

Generate GeoTIFF outputs, certification summary JSON, and PDF via Jinja2 + WeasyPrint

Pipeline Definition (Prefect)

@flow(name="sentinel2-certification-pipeline")
def run_certification(project_id: str, date: str):
    tiles = download_sentinel2(project_id, date)
    masked = cloud_mask(tiles)
    ndvi = calculate_ndvi(masked)
    alerts = detect_deforestation(ndvi, project_id)
    carbon = estimate_carbon(ndvi, project_id)
    report = generate_report(
        project_id, ndvi, alerts, carbon
    )
    return report

@task(retries=2, retry_delay_seconds=60)
def download_sentinel2(project_id, date):
    bbox = get_project_bbox(project_id)
    return fetch_s2_l2a(bbox, date, bands=["B04","B08","SCL"])

@task
def calculate_ndvi(tiles):
    b8 = tiles["B08"].astype(float)
    b4 = tiles["B04"].astype(float)
    return (b8 - b4) / (b8 + b4)