Install
openclaw skills install @ruiduobao/geoskill-hyperspectral-unmixingopenclaw skills install @ruiduobao/geoskill-hyperspectral-unmixingExtracts pure endmember spectra from hyperspectral imagery and inverts per-pixel abundances. Two classic endmember-extraction algorithms are supported:
Linear unmixing uses FCLSU: for each pixel, scipy.optimize.nnls solves for non-negative least-squares abundances, which are then normalized to sum to 1 (abundance sum-to-one constraint); a residual map is also output to evaluate fit quality. Suitable for mixed-pixel decomposition, mineral/vegetation abundance mapping, and sub-pixel analysis.
pip install numpy rasterio scipy
python geoskill-hyperspectral-unmixing.py --bbox 116.0 39.0 117.0 40.0 --synthetic --output-dir ./out
python geoskill-hyperspectral-unmixing.py \
--bbox 116.0 39.0 117.0 40.0 \
--synthetic --n-endmembers 3 --method vca \
--output-dir ./vca_3em
python geoskill-hyperspectral-unmixing.py \
--bbox 121.0 31.0 122.0 32.0 \
--synthetic --n-endmembers 4 --method nfindr \
--output-dir ./nfindr_4em
python geoskill-hyperspectral-unmixing.py \
--bbox 116.0 39.0 117.0 40.0 \
--synthetic --n-bands 40 --n-endmembers 3 \
--output-dir ./vca_40bands
python geoskill-hyperspectral-unmixing.py \
--input cuprite_subset.tif --n-endmembers 5 --method vca \
--output-dir ./real_vca
| File | Format | Description |
|---|---|---|
abundances.tif | GeoTIFF (float32, one band per endmember) | Normalized abundance map [0,1], EPSG:4326 |
residual.tif | GeoTIFF (float32) | Linear unmixing residual (RMSE) map |
endmembers.json | JSON | Endmember spectra, algorithm, matching diagnostics |
output-manifest.json | JSON | Run manifest (input/output/QA/software versions) |
--synthetic mode reads no external dataMIT
从高光谱影像中提取纯净端元(endmember)光谱并反演逐像元丰度 (abundance)。端元提取支持两种经典算法:
线性解混采用 FCLSU:对每个像元用 scipy.optimize.nnls 求非负最小
二乘丰度,再归一化到和为 1(丰度总和约束),并输出残差图评估拟合
质量。适用于混合像元分解、矿物/植被丰度制图、亚像元分析。
pip install numpy rasterio scipy
python geoskill-hyperspectral-unmixing.py --bbox 116.0 39.0 117.0 40.0 --synthetic --output-dir ./out
python geoskill-hyperspectral-unmixing.py \
--bbox 116.0 39.0 117.0 40.0 \
--synthetic --n-endmembers 3 --method vca \
--output-dir ./vca_3em
python geoskill-hyperspectral-unmixing.py \
--bbox 121.0 31.0 122.0 32.0 \
--synthetic --n-endmembers 4 --method nfindr \
--output-dir ./nfindr_4em
python geoskill-hyperspectral-unmixing.py \
--bbox 116.0 39.0 117.0 40.0 \
--synthetic --n-bands 40 --n-endmembers 3 \
--output-dir ./vca_40bands
python geoskill-hyperspectral-unmixing.py \
--input cuprite_subset.tif --n-endmembers 5 --method vca \
--output-dir ./real_vca
| 文件 | 格式 | 说明 |
|---|---|---|
abundances.tif | GeoTIFF (float32, 每端元一波段) | 归一化丰度图 [0,1],EPSG:4326 |
residual.tif | GeoTIFF (float32) | 线性解混残差(RMSE)图 |
endmembers.json | JSON | 端元光谱、算法、匹配诊断 |
output-manifest.json | JSON | 运行清单(输入/输出/QA/软件版本) |
--synthetic 模式不读取任何外部数据MIT