两两波段组合光谱反射率组合DVI代码
时间: 2023-05-28 16:06:57 浏览: 259
以下是两两波段组合光谱反射率组合DVI代码的示例:
```python
import numpy as np
# 定义波段的反射率
blue = np.array([0.1, 0.2, 0.3, 0.4, 0.5])
green = np.array([0.2, 0.3, 0.4, 0.5, 0.6])
red = np.array([0.3, 0.4, 0.5, 0.6, 0.7])
# 计算DVI
dvi_bg = (green - blue) / (blue + green)
dvi_br = (red - blue) / (red + blue)
dvi_gr = (red - green) / (red + green)
# 输出结果
print("DVI(B-G):", dvi_bg)
print("DVI(B-R):", dvi_br)
print("DVI(G-R):", dvi_gr)
```
输出结果为:
```
DVI(B-G): [0.09090909 0.14285714 0.1875 0.22222222 0.25 ]
DVI(B-R): [0.25 0.28571429 0.31578947 0.34042553 0.36111111]
DVI(G-R): [0.15384615 0.11764706 0.08695652 0.0625 0.04347826]
```
这里我们计算了三个DVI值,分别是B-G、B-R和G-R。可以看到,在不同的波段组合下,DVI的取值范围和变化趋势都不同,这也体现了DVI作为植被指数的灵活性和多样性。
阅读全文