This repository contains two integrated components:
- ETL & Benchmarking — converts QPESUMS HDF5 radar files to Zarr, derives radar products, exports typhoon-event datasets, and evaluates chunking strategies for efficient analysis with Dask.
- STAC-based Typhoon WebGIS — a FastAPI backend and browser-based map viewer for exploring typhoon radar data (Zarr rasters) and landslide inventory layers (GeoJSON), organised as a STAC catalog.
This copy was prepared for the Environmental Big Data final project submission by Ping-Hung Yang. The repository keeps the upstream project history intact and adds this note to identify the submitted copy and its intended course context.
flowchart TD
A[QPESUMS HDF5 files] --> B[h5_to_zarr_with_derived_year.py]
B --> C[Yearly derived Zarr]
C --> D[export_event_zarrs.py]
D --> E[Typhoon event Zarr exports]
A --> F[convert_qpesums_to_zarr.py]
F --> G[Chunk-strategy Zarr stores]
G --> H[task1_benchmark.py]
G --> I[task2_benchmark.py]
G --> J[chunk_compute_5day_all_products_custom_strategies_median5.ipynb]
H --> K[Benchmark CSVs, reports, figures]
I --> K
J --> K
C --> L[Typhoon_2024_accu_rain.py]
L --> M[Rainfall accumulation Zarr exports]
flowchart TD
N[STAC_catalog/] --> O[backend/stac.py]
P[Typhoon event Zarr exports] --> O
Q[Landslide GeoJSON layers] --> O
O --> R[backend/app.py - FastAPI]
R --> S["/api/items"]
R --> T["/api/items/{id}/raster"]
R --> U["/api/items/{id}/vector"]
R --> V[frontend/static/]
V --> W[Browser map viewer - Leaflet]
W --> X[Radar raster overlay + landslide points]
.
├── backend/ # FastAPI server
│ ├── app.py # API routes and server entry point
│ ├── stac.py # STAC catalog parsing and asset resolution
│ └── render.py # Zarr → PNG raster rendering
├── frontend/
│ └── static/
│ ├── app.js # Leaflet-based map viewer
│ └── styles.css
├── catalog/ # STAC catalog JSON metadata
│ ├── catalog.json
│ ├── gaemi/
│ ├── kong-rey/
│ ├── krathon/
│ └── usagi/
├── events/ # Typhoon event data (Zarr + GeoJSON)
│ ├── Gaemi/
│ │ ├── QPESUMS/ # Radar product Zarr stores
│ │ └── landside_layers/ # Landslide GeoJSON
│ ├── KONG-REY/
│ ├── Krathon/
│ └── Usagi/
├── etl/ # ETL scripts
│ ├── h5_to_zarr_with_derived_year.py
│ ├── export_event_zarrs.py
│ ├── convert_qpesums_to_zarr.py
│ └── Typhoon_2024_accu_rain.py
├── benchmarks/ # Benchmark scripts and notebooks
│ ├── task1_benchmark.py
│ ├── task2_benchmark.py
│ └── chunk_compute_5day_all_products_custom_strategies_median5.ipynb
├── main.py
├── pyproject.toml
├── uv.lock
├── .gitignore
└── README.md
This project uses uv for dependency management.
-
Install
uvif it is not already available. -
Create and sync the environment:
uv sync- Run commands inside the managed environment:
uv run python --versionThe main workflow uses Python 3.11+ and Zarr v3.
The scripts use editable settings near the top of each file. Before running, prepare local folders for:
data/source_hdf5/ # raw QPESUMS HDF5 files
outputs/ # generated Zarr stores and benchmark outputs
Large generated datasets are intentionally excluded from GitHub by .gitignore.
Only code, notebooks, environment files, and metadata should be committed.
Edit the user settings in h5_to_zarr_with_derived_year.py:
HDF5_DIROUTPUT_ZARRSTART_TIMEandEND_TIME, if a subset is neededBATCH_MODE- Dask worker settings
Run:
uv run python h5_to_zarr_with_derived_year.pyThis creates a yearly Zarr dataset containing:
MAXDBZ: 2D maximum reflectivityDBZH: 3D reflectivityTOP18: echo top height above 18 dBZTOP45: echo top height above 45 dBZVIL: vertically integrated liquid water
Edit the user settings in export_event_zarrs.py:
SOURCE_ZARROUTPUT_ROOTEVENTS_UTC8EXTRA_HOURS_AFTER_CONVERSION
Run:
uv run python export_event_zarrs.pyFor each typhoon event, the script exports:
VIL.zarrEchoTop_18.zarrEchoTop_45.zarr
Event dates are defined in UTC+8 and converted to UTC before slicing the radar time coordinate.
Edit the user settings in convert_qpesums_to_zarr.py:
INPUT_DIRMISSING_CSVOUT_DIRBATCH_SIZEDBZH_STRATEGIESMAXDBZ_STRATEGIES
Run:
uv run python convert_qpesums_to_zarr.pyThis creates multiple Zarr stores for comparing chunk layouts of DBZH and
MAXDBZ.
Edit the user settings in task1_benchmark.py:
ROOTSTORES- event time window
- Dask worker settings
- report, figure, and CSV output folders
Run:
uv run python task1_benchmark.pyThis benchmark converts MAXDBZ to rain rate, computes accumulated rainfall,
and records latency, throughput, Dask task count, compute time, and transfer
time.
Edit the user settings in task2_benchmark.py:
ROOTSTATION_CSVSTORESSTATION_BATCH_SIZE- Dask worker settings
- report, figure, and CSV output folders
Run:
uv run python task2_benchmark.pyThis benchmark extracts vertical reflectivity profiles near selected stations and builds CFAD histograms for each chunking strategy.
Open:
chunk_compute_5day_all_products_custom_strategies_median5.ipynb
This is the core experiment notebook. It benchmarks a 5-day all-product
pipeline for VIL, TOP18, and TOP45, repeats runs, aggregates median and
mean performance metrics, and produces decision tables and figures.
Edit the user settings in Typhoon_2024_accu_rain.py:
- input
MAXDBZZarr store - output folder
- typhoon warning periods
- Z-R relationship constants
Run:
uv run python Typhoon_2024_accu_rain.pyThis creates event-window Zarr stores containing MAXDBZ, rain_rate, and
accum_rainfall.
Main ETL script. Reads QPESUMS HDF5 files, applies gain/offset and no-data
masking, adds coordinates, computes TOP18, TOP45, and VIL, and writes an
analysis-ready Zarr store in batches with Dask.
Subsets the yearly derived Zarr store into typhoon-event products. It exports VIL and echo-top products for each configured event.
Creates benchmark Zarr stores using several chunking strategies for DBZH and
MAXDBZ.
Benchmarks accumulated rainfall computation from MAXDBZ stores.
Benchmarks station-profile extraction and CFAD generation from DBZH stores.
Exports typhoon-event rainfall accumulation products from a MAXDBZ Zarr
store.
Core experimental notebook for comparing 5-day all-product chunking strategies using repeated benchmark runs and median-5 summaries.
The WebGIS viewer lets you browse typhoon radar products and landslide layers on an interactive map.
Install dependencies (same environment as above):
uv syncuv run python main.pyThen open http://localhost:8000 in your browser.
- Select a typhoon event from the left panel (Gaemi, KONG-REY, Krathon, Usagi)
- Choose a radar product (accumulated rainfall, MaxDBZ, VIL, echo top)
- Step through time frames or use the playback button
- Toggle the landslide inventory overlay on and off
- Click a landslide point to view its attributes
The catalog/ directory organises all data assets as a static STAC catalog.
Each typhoon has its own sub-catalog with two collections:
*-qpesums-zarr/— radar product Zarr stores (raster assets), pointing to files underevents/<typhoon>/QPESUMS/*-landcover/— landslide inventory GeoJSON (vector assets), pointing to files underevents/<typhoon>/landside_layers/
The backend reads this catalog at startup to discover available events and assets without any database.
Dataset metadata is documented in:
stac_catalog.json
The STAC catalog describes:
- source HDF5 assets
- yearly derived Zarr output
- typhoon event Zarr exports
- benchmark outputs
- spatial and temporal extent
- variables and processing software
The STAC file uses relative asset paths so the repository can be cloned and reused in another environment without depending on machine-specific paths.
- Code assets are included as Python scripts.
- The core experiment notebook is included.
pyproject.tomlanduv.lockdefine the reproducible environment.stac_catalog.jsondocuments dataset metadata.- This README includes the architecture diagram and operation steps.
- Large generated data products are excluded from GitHub by
.gitignore.