Skip to content

jadeconstantinou/openhydro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Earth Observation Processing over Shitou Koumen Reservoir

Sentinel-2 Surface Reflectance & ERA5 Air Temperature


Overview

This repository contains a remote sensing processing workflow developed as part of a technical assignment for OpenHydro.

The objective is to:

  • Extract satellite and reanalysis data for a water reservoir
  • Apply basic processing steps
  • Summarise assumptions, limitations, and operational relevance

Two datasets are used:

  • Sentinel-2 optical imagery (surface reflectance)
  • ERA5 reanalysis (2 m air temperature)

The study area is Shitou Koumen Reservoir (China), with analysis focused on October 2024.


Data Sources

Sentinel-2

  • Collection: sentinel-2-l2a
  • Provider: Microsoft Planetary Computer (STAC)
  • Product: Level-2A Bottom-Of-Atmosphere (BOA) reflectance
  • Spatial resolution: 10 m
  • Units: Scaled integer reflectance (scale factor = 10,000)

Bands used:

  • Band 4 (Red)
  • Band 8 (Near-Infrared, used for cloud masking)

ERA5

  • Dataset: ERA5 single-level monthly means
  • Provider: Copernicus Climate Data Store (CDS)
  • Variable: 2 m air temperature
  • Spatial resolution: ~31 km
  • Units: Kelvin (converted to °C during processing)

Sentinel-2 Processing Workflow

  1. Query Sentinel-2 Level-2A scenes via STAC
  2. Filter scenes by:
    • Time range (October 2024)
    • Scene cloud cover (< 60%)
    • Spatial intersection with the reservoir AOI
  3. Clip imagery to the reservoir polygon
  4. Apply cloud masking using NIR reflectance thresholding
  5. Compute:
    • Per-image mean reflectance
    • Monthly pixel-wise mean reflectance
  6. Export raster and tabular outputs

ERA5 Processing Workflow

  1. Download ERA5 monthly mean 2 m air temperature
  2. Fix longitude convention (0–360 → −180–180)
  3. Assign geographic CRS (EPSG:4326)
  4. Extract reservoir values using:
    • Polygon clipping (default)
    • Centroid sampling (optional)
  5. Compute reservoir-level statistics
  6. Export clipped raster and CSV summary

Key Design Choices

  • Sentinel-2 cloud masking uses NIR reflectance rather than SCL classes to better target clouds over water
  • Radiometric scaling (division by 10,000) is applied at the statistics stage to reduce memory usage
  • ERA5 extraction uses buffering to ensure at least one grid cell overlaps the reservoir
  • Monthly aggregation is used to reduce noise and simplify interpretation

Outputs

Sentinel-2

  • Monthly mean reflectance GeoTIFF
  • Per-image statistics CSV
  • Monthly statistics CSV

ERA5

  • Reservoir-clipped temperature GeoTIFF
  • Monthly reservoir mean temperature CSV

How to Run

Environment Setup (Poetry)

This project uses Poetry for dependency management and reproducible environments.

1. Install Poetry

If Poetry is not already installed:

curl -sSL https://install.python-poetry.org | python3 -

Ensure Poetry is available on your path:

poetry --version

Install dependancies poetry install

Activate Poetry environment poetry env activate

Then run the line that is printed in the terminal to activate the environment.

poetry install

2.ERA5 Authentication

ERA5 data is downloaded from the Copernicus Climate Data Store (CDS).

Before running ERA5 scripts, configure your CDS credentials:

Create an account at: https://cds.climate.copernicus.eu

Create a file at ~/.cdsapirc with the following contents:

url: https://cds.climate.copernicus.eu/api/v2 key: :

Run the notebook (notebooks/main_notebook.ipynb)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published