Documents

geoskill-extreme-weather-detection

Try it

基于百分位阈值检测热浪、寒潮与暴雨等极端天气事件,统计强度、持续时间与空间范围,输出事件清单 JSON 与空间分布栅格。Percentile-threshold detection of heatwaves, cold spells, and heavy rainfall, reporting intensity, duration, and spatial extent with an event-list JSON and spatial raster.

What it does

基于百分位阈值检测热浪、寒潮与暴雨等极端天气事件,统计强度、持续时间与空间范围,输出事件清单 JSON 与空间分布栅格。Percentile-threshold detection of heatwaves, cold spells, and heavy rainfall, reporting intensity, duration, and spatial extent with an event-list JSON and spatial raster.

The skill document

极端天气事件检测 | Extreme Weather Detection

Detects extreme weather events from temperature / precipitation time series using the percentile-threshold method, reporting each event's intensity, duration, and spatial extent. Suitable for heatwave / cold-spell / heavy-rainfall event cataloging, extreme-climate risk screening, and rapid disaster assessment.

Detection rules:

  • Heatwave: temperature above a high percentile threshold (e.g., P90) for ≥ 3 consecutive days.
  • Cold spell: temperature below a low percentile threshold (e.g., P10).
  • Heavy rainfall: precipitation above P95 / P99.

By default the threshold is determined per pixel from the quantiles of the series itself (percentile ≥ 50 = upper-tail extreme, < 50 = lower-tail extreme). Events are extracted by connected-component labeling on the (time, y, x) 3-D exceedance volume (scipy.ndimage.label, with temporal adjacency plus 4-connected spatial connectivity); for each event the start/end time, duration in days, peak/mean intensity, number of spatial pixels, and centroid are reported.

A built-in --synthetic mode generates simulated series with embedded known extreme events (persistent heatwaves / heavy rainfall) for offline validation of detection correctness.

Dependencies / 依赖

pip install numpy rasterio scipy

Usage / 使用方法

Basic usage (synthetic data, offline)

python geoskill-extreme-weather-detection.py --bbox 116.0 39.0 117.0 40.0 --output-dir ./output

Example 1: heatwave detection (temperature P90, ≥3 consecutive days)

python geoskill-extreme-weather-detection.py --bbox 116 39 117 40 --variable temperature --threshold p90 --n-dates 30 --output-dir ./heatwave

Example 2: heavy rainfall detection (precipitation P99)

python geoskill-extreme-weather-detection.py --bbox 121 31 122 32 --variable precipitation --threshold p99 --output-dir ./heavy_rain

Example 3: cold spell detection (temperature P10 lower tail)

python geoskill-extreme-weather-detection.py --bbox 116 39 117 40 --variable temperature --threshold p10 --output-dir ./cold_spell

Example 4: real multi-temporal raster + custom minimum duration

python geoskill-extreme-weather-detection.py --input temp_daily.tif --variable temperature --threshold p95 --min-duration 5 --output-dir ./real_events

Example 5: bbox-only auto-synthesis + silent mode

python geoskill-extreme-weather-detection.py --bbox 110 30 111 31 --variable precipitation --threshold p95 --output-dir ./auto --quiet

Output / 输出

FileFormatDescription
extreme_events.tifGeoTIFF (float32, 2 band)band1 = exceedance days per pixel, band2 = maximum anomaly intensity, EPSG:4326
event_list.jsonJSONEvent list (start/end/duration/intensity/spatial extent) + summary
output-manifest.jsonJSONRun manifest (inputs/outputs/QA/software versions)

Data Source / 数据源 / Source

  • Input mode: local multi-temporal GeoTIFF (each band = one time step).
  • Synthetic mode: generated locally with embedded known extreme events; no external data sources.

Privacy / 隐私声明 / Privacy

  • Runs fully offline by default and makes no network requests.
  • --synthetic mode reads no external data.
  • All computation is done locally; user data is never uploaded.

License / License

MIT



name: geoskill-extreme-weather-detection description: '基于百分位阈值检测热浪、寒潮与暴雨等极端天气事件,统计强度、持续时间与空间范围,输出事件清单 JSON 与空间分布栅格。Percentile-threshold detection of heatwaves, cold spells, and heavy rainfall, reporting intensity, duration, and spatial extent with an event-list JSON and spatial raster.'

极端天气事件检测 | Extreme Weather Detection

基于百分位阈值法从温度 / 降水时间序列中检测极端天气事件,并逐个统计 其强度、持续时间与空间范围。适用于热浪 / 寒潮 / 暴雨事件编目、极端气候 风险筛查与灾害快速评估。

检测规则:

  • 热浪(heatwave):温度高于高分位阈值(如 P90)且连续 ≥ 3 天。
  • 寒潮(cold spell):温度低于低分位阈值(如 P10)。
  • 暴雨(heavy rainfall):降水高于 P95 / P99。

阈值默认逐像元由序列自身的分位数确定(百分位 ≥ 50 为上尾极端,< 50 为 下尾极端)。事件通过在 (时间, y, x) 三维 exceedance 体上做连通分量标记 (scipy.ndimage.label,时间相邻 + 四邻域空间连通)提取,逐个统计起止时间、 持续天数、峰值 / 平均强度、空间像元数与质心。

内置 --synthetic 模式生成内嵌已知极端事件(持续热浪 / 强降水)的模拟 序列,用于离线验证检测正确性。

依赖

pip install numpy rasterio scipy

使用方法

基本用法(合成数据,离线)

python geoskill-extreme-weather-detection.py --bbox 116.0 39.0 117.0 40.0 --output-dir ./output

示例 1:热浪检测(温度 P90,连续 ≥3 天)

python geoskill-extreme-weather-detection.py --bbox 116 39 117 40 --variable temperature --threshold p90 --n-dates 30 --output-dir ./heatwave

示例 2:暴雨检测(降水 P99)

python geoskill-extreme-weather-detection.py --bbox 121 31 122 32 --variable precipitation --threshold p99 --output-dir ./heavy_rain

示例 3:寒潮检测(温度 P10 下尾)

python geoskill-extreme-weather-detection.py --bbox 116 39 117 40 --variable temperature --threshold p10 --output-dir ./cold_spell

示例 4:真实多期栅格 + 自定义最短持续天数

python geoskill-extreme-weather-detection.py --input temp_daily.tif --variable temperature --threshold p95 --min-duration 5 --output-dir ./real_events

示例 5:仅 bbox 自动合成 + 静默

python geoskill-extreme-weather-detection.py --bbox 110 30 111 31 --variable precipitation --threshold p95 --output-dir ./auto --quiet

输出

文件格式说明
extreme_events.tifGeoTIFF (float32, 2 band)band1=每像元 exceedance 天数,band2=最大异常强度,EPSG:4326
event_list.jsonJSON事件清单(起止/持续/强度/空间范围)+ 汇总
output-manifest.jsonJSON运行清单(输入/输出/QA/软件版本)

数据源 / Source

  • 输入模式:本地多期 GeoTIFF(每波段 = 一个时间步)。
  • 合成模式:本地生成,内嵌已知极端事件,无外部数据源。

隐私声明 / Privacy

  • 默认完全离线运行,不发起任何网络请求。
  • --synthetic 模式不读取任何外部数据。
  • 所有计算在本地完成,不上传用户数据。

License

MIT

Related skills

热浪影响评估:逐像元 P90 分位数阈值 + 连续≥3天连通域热浪检测,Stull/简化湿球温度健康风险分级,人口暴露与脆弱性制图。Heatwave impact assessment: per-pixel P90 threshold with connected-run detection, wet-bulb temperature health risk, population exposure and vulnerability mapping. 输出热浪日数/暴露人口/脆弱性/湿球风险 GeoTIFF + 事件清单 JSON。

对温度/降水时序执行 Mann-Kendall 趋势检验与 Sen 斜率(Sen slope)估计,输出趋势斜率栅格、显著性(p 值)栅格与时序统计 JSON。Mann-Kendall trend test and Sen slope estimator for temperature/precipitation time series, outputting slope raster, significance (p-value) raster, and time-series JSON.

计算温度距平(当期温度减多年同期气候态)与标准化距平,划分暖/冷异常等级,输出距平栅格、异常等级 GeoTIFF 与时序 JSON。Temperature anomaly mapping: current minus multi-year climatology, standardized anomalies, and warm/cold anomaly classes, outputting anomaly rasters, a class GeoTIFF, and a time-series JSON.

1 installs

基于月均温与月降水栅格的气候区划,支持柯本-盖格(Köppen-Geiger)规则树与简化 Strahler 发生分类,输出气候类别码 GeoTIFF + 面积统计 JSON,可选双期变化检测。Climate zone classification from monthly temperature/precipitation rasters (Köppen-Geiger rule tree & simplified Strahler), with area statistics and optional change detection.

LSTM 时序预测网络(torch+CUDA,默认) + 经典线性/多项式/AR(p) 解释基线:多步外推 + 留出 MAE/RMSE 验证 + 逐像元栅格输出

1 installs

融合 SPI(标准化降水指数,Gamma 分布拟合+正态反演)与 VHI(植被健康指数)的综合干旱分级。Combined drought grading fusing SPI (Gamma-fit standardized precipitation index) and VHI (vegetation health index). 输出干旱等级/SPI 栅格 + 面积统计 JSON。