Geoskill: Forest Carbon Estimate
Estimate forest carbon stock from remote sensing data using BEF, allometric equations, or IPCC Tier 1/2 methods. Includes Monte Carlo uncertainty analysis. Supports raster (GeoTIFF…
ruiduobao
@ruiduobao
What This Skill Does
Command-line tool that estimates forest carbon stock from remote sensing data using BEF, allometric equations, or IPCC Tier 1/2 methods, with Monte Carlo uncertainty analysis. Supports raster (GeoTIFF) and tabular (CSV) inputs for single-point, plot-level, or wall-to-wall mapping.
Replaces manual carbon stock calculations and spreadsheet-based IPCC methods by automating estimation from remote sensing data with built-in uncertainty propagation.
When to Use It
- Estimate carbon stock from LiDAR-derived forest height rasters using allometric equations
- Calculate above- and below-ground carbon for a forest plot using BEF method with AGB input
- Generate IPCC Tier 1 carbon stock report for a boreal forest area using default emission factors
- Run Monte Carlo uncertainty analysis on a single-point allometric estimate with 5000 iterations
- Process a GeoTIFF of forest height to produce a wall-to-wall carbon stock map
- Convert plot-level AGB measurements from CSV into carbon stock estimates with root-shoot ratios
Install
$ openclaw skills install @ruiduobao/forest-carbon-estimateforest-carbon-estimate
Estimate forest carbon stock from remote sensing data using multiple methods with uncertainty analysis.
Features
- BEF Method: Biomass Expansion Factor from AGB
- Allometric Equations: AGB = a × H^b from forest height
- IPCC Tier 1/2: Default factors by forest type
- Monte Carlo Uncertainty: Propagate input uncertainties
- Raster Processing: Direct GeoTIFF input/output
- Tabular Processing: CSV with plot-level data
- Multiple Forest Types: Tropical, temperate, boreal, mangrove
Usage
# Single-point estimate (allometric)
python scripts\forest-carbon-estimate.py estimate --method allometric --height 15 --forest-type tropical
# Single-point estimate (BEF)
python scripts\forest-carbon-estimate.py estimate --method bef --agb 200 --forest-type temperate
# IPCC Tier 1 default
python scripts\forest-carbon-estimate.py estimate --method ipcc --forest-type boreal --area-ha 100
# Raster processing
python scripts\forest-carbon-estimate.py estimate --input height.tif --method allometric --output carbon.tif
# Uncertainty analysis
python scripts\forest-carbon-estimate.py uncertainty --method allometric --height 15 --iterations 5000
# Report from CSV
python scripts\forest-carbon-estimate.py report --input carbon_stock.csv
Parameters
| Parameter | Description | Default |
|---|---|---|
--input | Input GeoTIFF or CSV | None (single-point) |
--method | Estimation method | allometric |
--forest-type | Forest type for default factors | default |
--height | Forest height (m) for allometric | None |
--agb | Above-ground biomass (t/ha) for BEF | None |
--area-ha | Area in hectares (IPCC) | 1.0 |
--agb-band | Band number for raster input | 1 |
--iterations | Monte Carlo iterations | 1000 |
--output | Output file path | Auto-generated |
Calculation Chain
AGB (Above-ground biomass)
↓
BGB = AGB × root_shoot_ratio (default 0.26)
↓
Total biomass = AGB + BGB
↓
Carbon stock = Total biomass × carbon_fraction (default 0.47)
Methods
| Method | Input | Description |
|---|---|---|
| BEF | AGB (t/ha) | Total biomass = AGB × BEF |
| Allometric | Height (m) | AGB = a × H^b |
| IPCC | Forest type | Default density from IPCC tables |
Installation
pip install requests>=2.28.0 tqdm numpy scipy rasterio
# Or: pip install -r scripts/requirements.txt
Dependencies
| Package | Purpose |
|---|---|
numpy | Numerical computation and Monte Carlo |
rasterio | GeoTIFF I/O for raster mode |
scipy | Statistical functions |
requests | Data download (if applicable) |
tqdm | Progress bars |
Data Source
- IPCC Guidelines for National Greenhouse Gas Inventories (2006, 2019 Refinement)
- IPCC EFDB (Emission Factor Database)
BEF Values per Forest Type
| Forest Type | BEF Range |
|---|---|
| Tropical | 1.5 – 3.0 |
| Temperate | 1.2 – 1.8 |
| Boreal | 1.0 – 1.5 |
| Mangrove | 1.2 – 1.8 |
Default BEF = 1.32 (temperate mixed forest). Adjust with --bef parameter.
Allometric Coefficients
For AGB = a × H^b (H = forest height in m):
| Forest Type | a | b |
|---|---|---|
| Tropical | 0.0673 | 0.976 |
| Temperate | 0.0592 | 1.030 |
| Boreal | 0.0450 | 1.050 |
These are DBH-based defaults. For height-based allometry, use --coeff-a and --coeff-b to override.
IPCC Default Wood Density
| Forest Type | Wood Density (g/cm³) |
|---|---|
| Tropical | 0.57 – 0.69 |
| Temperate | 0.41 – 0.56 |
| Boreal | 0.38 – 0.51 |
Default: 0.55 g/cm³. Override with --wood-density.
Method Selection Guidance
| Method | Best For | Input Required |
|---|---|---|
| BEF | Forest inventory data | AGB (t/ha) |
| Allometric | Remote sensing (LiDAR/InSAR height) | Forest height (m) |
| IPCC Tier 1 | Quick estimates, no field data | Forest type + area |
Output Units
Carbon stock is reported in Mg C/ha (megagrams of carbon per hectare), equivalent to t C/ha.
For total stock: multiply by area (ha) → total Mg C.
Nodata Handling
Nodata pixels in input rasters are skipped. Output GeoTIFF uses the same nodata value as input. No interpolation is performed on nodata areas.
Custom Parameters
# Custom carbon fraction and root-shoot ratio
python scripts\forest-carbon-estimate.py estimate --method bef --agb 200 --forest-type temperate --carbon-fraction 0.45 --root-shoot-ratio 0.28
| Parameter | Default | Description |
|---|---|---|
--carbon-fraction | 0.47 | Carbon fraction of dry biomass |
--root-shoot-ratio | 0.26 | Root-to-shoot ratio |
--bef | 1.32 | Biomass expansion factor |
Uncertainty Output Structure
{
"mean": 125.3,
"std": 18.7,
"CI95_lower": 88.6,
"CI95_upper": 162.0
}
| Field | Description |
|---|---|
mean | Mean carbon stock estimate (Mg C/ha) |
std | Standard deviation from Monte Carlo |
CI95_lower | 95% confidence interval lower bound |
CI95_upper | 95% confidence interval upper bound |
Data Acquisition Guidance
Obtain forest height/AGB rasters from:
- Global Forest Watch (https://www.globalforestwatch.org/) — AGB maps
- NASA GEDI (https://gedi.umd.edu/) — Forest height from spaceborne LiDAR
- ESA Biomass Mission — P-band SAR forest height
- National forest inventory — Plot-level AGB data
Validation / Quality Assessment
- Compare with field-measured carbon stock plots
- Cross-validate with IPCC default values for the same forest type
- Check that uncertainty range (CI95) is reasonable (< 50% of mean)
- Report method, forest type, and input data source in publications
Citation
@book{ipcc2006guidelines,
title={2006 IPCC Guidelines for National Greenhouse Gas Inventories},
author={{IPCC}},
year={2006},
publisher={Institute for Global Environmental Strategies},
url={https://www.ipcc-nggip.iges.or.jp/public/2006gl/}
}
@book{ipcc2019refinement,
title={2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories},
author={{IPCC}},
year={2019},
publisher={IPCC},
url={https://www.ipcc-nggip.iges.or.jp/public/2019rf/}
}
Visualization Guidance
import rasterio
import matplotlib.pyplot as plt
import numpy as np
with rasterio.open("carbon.tif") as src:
carbon = src.read(1)
nodata = src.nodata
carbon_plot = np.where(carbon == nodata, np.nan, carbon)
fig, ax = plt.subplots(figsize=(10, 8))
im = ax.imshow(carbon_plot, cmap="Greens", vmin=0, vmax=200)
cbar = plt.colorbar(im, ax=ax, shrink=0.8)
cbar.set_label("Carbon Stock (Mg C/ha)")
ax.set_title("Forest Carbon Stock")
ax.axis("off")
plt.tight_layout()
plt.savefig("carbon_map.png", dpi=200)
Troubleshooting
| Error | Cause | Solution |
|---|---|---|
ConnectionError | Network issue | Check internet, retry |
HTTP 429 | Rate limit | Wait 60s, retry |
ValueError | Invalid input | Check parameter format |
| Empty output | No data | Try different parameters |
ModuleNotFoundError | Missing dep | Run pip install |
Advanced Usage
Batch Raster Processing
for year in 2020 2021 2022 2023; do
python scripts\forest-carbon-estimate.py estimate --input agb_${year}.tif --method allometric --output carbon_${year}.tif
done
CI/CD Integration (GitHub Actions)
# .github/workflows/carbon-update.yml
name: Forest Carbon Update
on:
schedule:
- cron: '0 0 1 1 *' # Yearly
jobs:
estimate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: pip install numpy rasterio
- run: |
python scripts\forest-carbon-estimate.py estimate \
--input data/agb_latest.tif \
--method allometric \
--output data/carbon_latest.tif
PostGIS Raster Import
raster2pgsql -s 4326 -I -C carbon_latest.tif public.forest_carbon | psql -d gis_db
Performance Tips
--method befis fastest for regional estimates;--method allometricfor species-specific- Use
--carbon-fraction 0.47to match local species (default 0.47 = IPCC default) - For large rasters, process in tiles using
--windowparameter
中文说明
基于遥感数据估算森林碳储量,支持 BEF、异速生长方程、IPCC Tier 1/2 三种方法,含蒙特卡洛不确定性分析。
安装
pip install requests>=2.28.0 tqdm numpy scipy rasterio
# 或: pip install -r scripts/requirements.txt
依赖
| 包 | 用途 |
|---|---|
numpy | 数值计算和蒙特卡洛 |
rasterio | 栅格模式 GeoTIFF 读写 |
scipy | 统计函数 |
requests | 数据下载(如适用) |
tqdm | 进度条 |
各森林类型 BEF 值
| 森林类型 | BEF 范围 |
|---|---|
| 热带 | 1.5 – 3.0 |
| 温带 | 1.2 – 1.8 |
| 寒带 | 1.0 – 1.5 |
| 红树林 | 1.2 – 1.8 |
默认 BEF = 1.32(温带混交林)。使用 --bef 参数调整。
异速生长系数
AGB = a × H^b(H = 树高,单位 m):
| 森林类型 | a | b |
|---|---|---|
| 热带 | 0.0673 | 0.976 |
| 温带 | 0.0592 | 1.030 |
| 寒带 | 0.0450 | 1.050 |
这些是基于 DBH 的默认值。树高异速生长使用 --coeff-a 和 --coeff-b 覆盖。
IPCC 默认木材密度
| 森林类型 | 木材密度 (g/cm³) |
|---|---|
| 热带 | 0.57 – 0.69 |
| 温带 | 0.41 – 0.56 |
| 寒带 | 0.38 – 0.51 |
Top skills in this category
Polymarket Agent
@andretutaResearch Polymarket markets, whale flow and smart money; optionally trade a Polygon wallet behind deterministic risk guard-rails.
Decision Trees
@evgyurDecision tree analysis for complex decision-making across all domains. Use when user needs to evaluate multiple options with uncertain outcomes, assess risk/reward scenarios, or structure choices systematically. Applicable to business, investment, personal decisions, operations, career choices, product strategy, and any situation requiring structured evaluation. Triggers include decision tree, should I, what if, evaluate options, compare alternatives, risk analysis.
eastmoney skills
@qqk000基于东方财富权威数据库的金融数据查询工具,支持行情、财务及关联关系数据。
Seedstr (Earn pasive income with your agent)
@mastersyondgyA marketplace connecting AI agents with humans who need tasks completed. Agents earn cryptocurrency (ETH or SOL) for accepted work. Supports swarm jobs where...
Agent Evaluation
@rustyorbTesting and benchmarking LLM agents including behavioral testing, capability assessment, reliability metrics, and production monitoring—where even top agents achieve less than 50% on real-world benchmarks Use when: agent testing, agent evaluation, benchmark agents, agent reliability, test agent.