Install
openclaw skills install @ruiduobao/fire-hotspot-downloadDownload MODIS and VIIRS active fire hotspot data from NASA FIRMS. Supports filtering by date range, bounding box, and instrument. Outputs CSV and GeoJSON formats with near-real-time and standard products.
openclaw skills install @ruiduobao/fire-hotspot-downloadDownload active fire hotspot data from NASA FIRMS (Fire Information for Resource Management System).
NASA FIRMS distributes active fire data from MODIS and VIIRS instruments in near-real-time. This data is essential for fire monitoring, air quality studies, and land management.
| Instrument | Product | Satellite | Resolution |
|---|---|---|---|
| MODIS | MCD14DL | Terra+Aqua | 1km |
| VIIRS (NRT) | VNP14IMGTDL_NRT | Suomi-NPP | 375m |
| VIIRS (Standard) | VNP14IMGT | Suomi-NPP | 375m |
| VIIRS (NOAA-20) | VJ114IMGML | NOAA-20 (JPSS-1) | 375m |
A free API key is required. Get one at: https://firms.modaps.eosdis.nasa.gov/api/map_key/
# Set your API key
python scripts\fire_hotspot_download.py set-key YOUR_API_KEY
# Or set via environment variable
export FIRMS_API_KEY="your_api_key"
# Download fire hotspots for China (last 7 days)
python scripts\fire_hotspot_download.py download \
--instrument VIIRS --product NRT \
--bbox 73 18 135 54 \
--start 2024-01-01 --end 2024-01-07 \
--output china_fires.csv
# Download MODIS fires as GeoJSON
python scripts\fire_hotspot_download.py download \
--instrument MODIS --product STANDARD \
--bbox 116.0 39.5 116.8 40.2 \
--start 2024-03-01 --end 2024-03-31 \
--output beijing_fires.geojson --format geojson
# Download both instruments
python scripts\fire_hotspot_download.py download \
--instrument BOTH --product NRT \
--bbox -125 25 -66 50 \
--start 2024-06-01 --end 2024-06-07 \
--output us_fires.csv
# List available instruments
python scripts\fire_hotspot_download.py list-instruments
--instrument: MODIS, VIIRS, or BOTH--product: NRT (near-real-time) or STANDARD--bbox: Bounding box as west south east north--start/--end: Date range (YYYY-MM-DD, max 7 days for NRT)--output: Output file path--format: csv or geojson--confidence: Minimum confidence threshold (0-100)| Field | Description |
|---|---|
| latitude | Latitude of fire pixel |
| longitude | Longitude of fire pixel |
| brightness | Brightness temperature (K) |
| scan | Scan pixel size |
| track | Track pixel size |
| acq_date | Acquisition date |
| acq_time | Acquisition time (HHMM) |
| satellite | Satellite name |
| confidence | Detection confidence (0-100) |
| version | Product version |
| bright_t31 | Channel 31 brightness (K) |
| frp | Fire Radiative Power (MW) |
| daynight | Day or Night |
# Install dependencies
pip install requests>=2.28.0 tqdm
# Or install from requirements.txt
pip install -r scripts/requirements.txt
@article{davies2009firms,
title={Fire Information for Resource Management System (FIRS): archiving and distributing MODIS active fire data},
author={Davies, D.K. and others},
journal={IEEE Transactions on Geoscience and Remote Sensing},
year={2009},
doi={10.1109/TGRS.2009.2014067}
}
| Product | Latency | Accuracy | Use Case |
|---|---|---|---|
| NRT (Near-Real-Time) | ~3 hours | Lower (automated QA) | Active fire monitoring, rapid response |
| Standard | ~2 weeks | Higher (manual QA) | Research, long-term analysis |
The confidence field ranges from 0–100%:
| Satellite | Instrument ID | Product |
|---|---|---|
| Suomi-NPP | VNP14IMGTDL_NRT / VNP14IMGT | 375m resolution |
| NOAA-20 (JPSS-1) | VJ114IMGML | 375m resolution |
Both provide similar spatial resolution; NOAA-20 offers improved nighttime detection.
The API supports max 7 days per NRT request. For longer periods:
# Loop over weeks
for week in {0..3}; do
start=$(date -d "2024-01-01 +${week} weeks" +%Y-%m-%d)
end=$(date -d "2024-01-01 +${week} weeks + 6 days" +%Y-%m-%d)
python scripts\fire_hotspot_download.py download \
--instrument VIIRS --product NRT \
--bbox 73 18 135 54 \
--start $start --end $end \
--output "fires_week${week}.csv"
done
For global-scale analysis, split into regional tiles and download separately to avoid timeout:
set-key are stored in the local config file.FIRMS_API_KEY overrides stored key.confidence (red = high, yellow = medium).datashader in Python.| Error | Cause | Solution |
|---|---|---|
ConnectionError | Network issue or API down | Check internet connection, retry in 1 minute |
HTTP 429 | Rate limit exceeded | Wait 60 seconds before retrying |
HTTP 404 | Invalid parameters or date range | Check parameter names and date format |
ValueError: bbox | Invalid bounding box | Ensure format is west,south,east,north |
| Empty output | No data for query region/time | Try different date range or check coordinates |
ModuleNotFoundError | Missing dependency | Run pip install requests tqdm |
403 Forbidden | Invalid API key | Re-run set-key with valid key |
# Download last 7 days of fire data for China
python scripts\fire_hotspot_download.py download --bbox 73 18 135 54 --instrument BOTH --start $(date -d '7 days ago' +%Y-%m-%d) --end $(date +%Y-%m-%d) --output fires_weekly.csv
# .github/workflows/update-fires.yml
name: Fire Hotspot Monitor
on:
schedule:
- cron: '0 8 * * *' # Daily at 08:00 UTC
jobs:
download:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: pip install requests
- env:
FIRMS_API_KEY: ${{ secrets.FIRMS_API_KEY }}
run: |
python scripts\fire_hotspot_download.py download \
--bbox 73 18 135 54 --instrument BOTH \
--start $(date -d '3 days ago' +%Y-%m-%d) \
--end $(date +%Y-%m-%d) \
--output data/fires_latest.csv
python scripts\fire_hotspot_download.py download --bbox 73 18 135 54 --start 2024-01-01 --end 2024-01-31 --output fires.csv
psql -d gis_db -c "\COPY fire_hotspots(lat, lon, confidence, acq_date, instrument) FROM 'fires.csv' CSV HEADER"
--instrument VIIRS for higher resolution (375m vs 1km)sleep 1 between weekly requests for multi-week batches从 NASA FIRMS(资源管理火灾信息系统)下载 MODIS 和 VIIRS 活跃火点数据。
| 传感器 | 产品 | 卫星 | 分辨率 |
|---|---|---|---|
| MODIS | MCD14DL | Terra+Aqua | 1km |
| VIIRS (近实时) | VNP14IMGTDL_NRT | Suomi-NPP | 375m |
| VIIRS (标准) | VNP14IMGT | Suomi-NPP | 375m |
| VIIRS (NOAA-20) | VJ114IMGML | NOAA-20 (JPSS-1) | 375m |
需要免费 API 密钥。获取地址:https://firms.modaps.eosdis.nasa.gov/api/map_key/
# 设置 API 密钥
python scripts\fire_hotspot_download.py set-key YOUR_API_KEY
# 或通过环境变量
set FIRMS_API_KEY=your_api_key
# 下载中国区域火点(最近7天)
python scripts\fire_hotspot_download.py download \
--instrument VIIRS --product NRT \
--bbox 73 18 135 54 \
--start 2024-01-01 --end 2024-01-07 \
--output china_fires.csv
# 下载 MODIS 火点为 GeoJSON
python scripts\fire_hotspot_download.py download \
--instrument MODIS --product STANDARD \
--bbox 116.0 39.5 116.8 40.2 \
--start 2024-03-01 --end 2024-03-31 \
--output beijing_fires.geojson --format geojson
# 下载两种传感器数据
python scripts\fire_hotspot_download.py download \
--instrument BOTH --product NRT \
--bbox -125 25 -66 50 \
--start 2024-06-01 --end 2024-06-07 \
--output us_fires.csv
# 列出可用传感器
python scripts\fire_hotspot_download.py list-instruments
| 字段 | 描述 |
|---|---|
| latitude | 火点纬度 |
| longitude | 火点经度 |
| brightness | 亮温 (K) |
| scan | 扫描像元大小 |
| track | 轨道像元大小 |
| acq_date | 获取日期 |
| acq_time | 获取时间 (HHMM) |
| satellite | 卫星名称 |
| confidence | 检测置信度 (0-100) |
| version | 产品版本 |
| bright_t31 | 31通道亮温 (K) |
| frp | 火辐射功率 (MW) |
| daynight | 白天或夜间 |