PROSAIL模型python版简单说明

PROSAIL模型是prospect 和sail模型的融合,其本来是用fortran语言,现在也有python版的,可以直接pip导入PROSAIL库。
其参数,下面的参数应该是很久没更新了,跟函数源代码标示略有不同。

ParameterDescription of parameterUnitsTypical minTypical max
NLeaf structure parameterN/A0.82.5
cabChlorophyll a+b concentrationug/cm2080
cawEquivalent water thickinesscm0200
carCarotenoid concentrationug/cm2020
cbrownBrown pigmentNA01
cmDry matter contentg/cm20200
laiLeaf Area IndexN/A010
lidfaLeaf angle distributionN/A--
lidfbLeaf angle distributionN/A--
psoilDry/Wet soil factorN/A01
rsoilSoil brigthness factorN/A--
hspotHotspot parameterN/A--
ttsSolar zenith angledeg090
ttoObserver zenith angledeg090
phiRelative azimuth angledeg0360
typelidfLeaf angle distribution typeInteger--
  • typelidf = 1: use the two parameter LAD parameterisation, where a and b control the average leaf slope and the distribution bimodality, respectively. Typical distributions
    are given by the following parameter choices:
LIDF typeLIDFaLIDFb
Planophile10
Erectophile-10
Plagiophile0-1
Extremophile01
Spherical-0.35-0.15
Uniform00
  • typelidf = 2 Ellipsoidal distribution, where LIDFa parameter stands for mean leaf angle (0 degrees is planophile, 90 degrees is erectophile). LIDFb parameter is ignored.

The soil model

The soil model is a fairly simple linear mixture model, where two spectra are mixed and then a brightness term added:

rho_soil = rsoil*(psoil*soil_spectrum1+(1-psoil)*soil_spectrum2)

可以参考PROSAIL官网http://teledetection.ipgp.jussieu.fr/prosail/
模型原函数介绍,里面有模型的输入参数以及各个参数的含义
这仅仅是PROSAIL的主函数。

def run_prosail(n, cab, car,  cbrown, cw, cm, lai, lidfa, hspot,
                tts, tto, psi, ant=0.0, alpha=40., prospect_version="5", 
                typelidf=2, lidfb=0., factor="SDR",
                rsoil0=None, rsoil=None, psoil=None,
                soil_spectrum1=None, soil_spectrum2=None):
    """Run the PROSPECT_5B and SAILh radiative transfer models. The soil
    model is a linear mixture model, where two spectra are combined together as

         rho_soil = rsoil*(psoil*soil_spectrum1+(1-psoil)*soil_spectrum2)
    By default, ``soil_spectrum1`` is a dry soil, and ``soil_spectrum2`` is a
    wet soil, so in that case, ``psoil`` is a surface soil moisture parameter.
    ``rsoil`` is a  soil brightness term. You can provide one or the two
    soil spectra if you want.  The soil spectra must be defined
    between 400 and 2500 nm with 1nm spacing.

    Parameters
    ----------
    n: float
        Leaf layers
    cab: float
        leaf chlorophyll concentration
    car: float
        leaf carotenoid concentration
    cbrown: float
        senescent pigment
    cw: float
        equivalent leaf water
    cm: float
        leaf dry matter
    lai: float
        leaf area index
    lidfa: float
        a parameter for leaf angle distribution. If ``typliedf``=2, average
        leaf inclination angle.
    tts: float
        Solar zenith angle
    tto: float
        Sensor zenith angle
    psi: float
        Relative sensor-solar azimuth angle ( saa - vaa )
    ant: float
        leaf anthocyanin concentration (default set to 0)
    alpha: float
        The alpha angle (in degrees) used in the surface scattering
        calculations. By default it's set to 40 degrees.
    prospect_version: str
        Which PROSPECT version to use. We have "5" and "D"
    typelidf: int, optional
        The type of leaf angle distribution function to use. By default, is set
        to 2.
    lidfb: float, optional
        b parameter for leaf angle distribution. If ``typelidf``=2, ignored
    factor: str, optional
        What reflectance factor to return:
        * "SDR": directional reflectance factor (default)
        * "BHR": bi-hemispherical r. f.
        * "DHR": Directional-Hemispherical r. f. (directional illumination)
        * "HDR": Hemispherical-Directional r. f. (directional view)
        * "ALL": All of them
    rsoil0: float, optional
        The soil reflectance spectrum
    rsoil: float, optional
        Soil scalar 1 (brightness)
    psoil: float, optional
        Soil scalar 2 (moisture)
    soil_spectrum1: 2101-element array
        First component of the soil spectrum
    soil_spectrum2: 2101-element array
        Second component of the soil spectrum
    Returns
    --------
    A reflectance factor between 400 and 2500 nm


    """

    factor = factor.upper()
    if factor not in ["SDR", "BHR", "DHR", "HDR", "ALL"]:
        raise ValueError, "'factor' must be one of SDR, BHR, DHR, HDR or ALL"

    if soil_spectrum1 is not None:
        assert (len(soil_spectrum1) == 2101)
    else:
        soil_spectrum1 = spectral_lib.soil.rsoil1

    if soil_spectrum2 is not None:
        assert (len(soil_spectrum1) == 2101)
    else:
        soil_spectrum2 = spectral_lib.soil.rsoil2

    if rsoil0 is None:
        if (rsoil is None) or (psoil is None):
            raise ValueError, "If rsoil0 isn't define, then rsoil and psoil" + \
                              " need to be defined!"
        rsoil0 = rsoil * (
        psoil * soil_spectrum1 + (1. - psoil) * soil_spectrum2)

    wv, refl, trans = run_prospect (n, cab, car,  cbrown, cw, cm, ant=ant, 
                 prospect_version=prospect_version, alpha=alpha)
    
    [tss, too, tsstoo, rdd, tdd, rsd, tsd, rdo, tdo,
         rso, rsos, rsod, rddt, rsdt, rdot, rsodt, rsost, rsot,
         gammasdf, gammasdb, gammaso] = foursail (refl, trans,  
                                                  lidfa, lidfb, typelidf, 
                                                  lai, hspot, 
                                                  tts, tto, psi, rsoil0)

    if factor == "SDR":
        return rsot
    elif factor == "BHR":
        return rddt
    elif factor == "DHR":
        return rsdt
    elif factor == "HDR":
        return rdot
    elif factor == "ALL":
        return [rsot, rddt, rsdt, rdot]

一般我们都默认‘SDR’返回反射率,函数能够返回一个数组,波长从400-2500,例如

import prosail
import numpy as np
import matplotlib.pyplot as plt
rr = prosail.run_prosail(1.5, 40., 8., 0.0, 0.01, 0.009, 3., -0.35, 0.01,
                        30., 10., 0., typelidf=1, lidfb=-0.15, 
                        rsoil = 1., psoil=1., factor="SDR")
plt.plot(np.arange(400,2501),rr,'r-')
plt.show()                        

在这里插入图片描述
当然此库中还内置了prospect和sail模型,

import prosail
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

rr = prosail.run_prospect(1.5, 30, 10, 1.0, .015, .0090, ant=0.0,
                          prospect_version="D",
                          nr=None, kab=None, kcar=None, kbrown=None, kw=None,
                          km=None, kant=None, alpha=40.)

plt.plot(rr[0], rr[1], 'r-')
plt.plot(rr[0],  [1 - x for x in rr[2]], 'r-')
plt.show()

在这里插入图片描述

  • 31
    点赞
  • 79
    收藏
    觉得还不错? 一键收藏
  • 47
    评论
PROSAIL (PROSPECT + SAIL) 是一种用于估算植被光谱的模型,它综合了 PROSPECT 和 SAIL 模型。在这里,我将为您提供一些 PROSAIL 模型的教程: 1. 安装 PROSAIL 模型 PROSAIL 模型是用 Python 编写的,您可以使用 pip 安装它: ``` pip install prosail ``` 2. 运行 PROSAIL 模型 PROSAIL 模型提供了一个函数,可以使用该函数生成植被光谱。以下是使用 PROSAIL 模型的基本步骤: ```python from prosail import run_prosail # 设置 PROSAIL 模型参数 params = { 'N': 2.0, 'Cab': 30.0, 'Car': 10.0, 'Cdm': 0.0, 'Cw': 0.02, 'Cbp': 0.0, 'LAI': 2.0, 'ALA': 40.0, 'SSA': 0.005, 'Psoil': 0.7, 'PLeaf': 0.015, 'hot_spot': 0, 'sza': 30.0, 'vza': 10.0, 'raa': 0.0, 'month': 6, 'day': 21, 'year': 2000, 'verbose': False } # 运行 PROSAIL 模型 spectra = run_prosail(params) # 输出生成的植被光谱 print(spectra) ``` 在这个例子中,我们设置了一个包含 PROSAIL 模型参数的字典,然后调用 `run_prosail()` 函数来生成植被光谱。 3. 调整 PROSAIL 模型参数 PROSAIL 模型有许多参数,可以通过更改这些参数来生成不同的植被光谱。您可以通过尝试不同的参数值来了解每个参数对植被光谱的影响。 以下是一些常用的 PROSAIL 模型参数及其含义: - `N`:叶片氮浓度 (g/m²)。 - `Cab`:叶绿素 a + b 浓度 (μg/cm²)。 - `Car`:类胡萝卜素浓度 (μg/cm²)。 - `Cdm`:干物质浓度 (g/m²)。 - `Cw`:水分浓度 (g/m²)。 - `Cbp`:背景颜色浓度 (μg/cm²)。 - `LAI`:叶面积指数。 - `ALA`:叶片倾斜角 (°)。 - `SSA`:叶片散射系数。 - `Psoil`:土壤反射率。 - `PLeaf`:叶片反射率。 - `hot_spot`:热点效应。 - `sza`:太阳天顶角 (°)。 - `vza`:视角天顶角 (°)。 - `raa`:相对方位角 (°)。 - `month`:月份。 - `day`:日。 - `year`:年份。 4. 可视化 PROSAIL 模型生成的光谱 使用 Python 的 Matplotlib 库可以轻松可视化 PROSAIL 模型生成的植被光谱数据。以下是一个简单的例子: ```python import matplotlib.pyplot as plt # 运行 PROSAIL 模型 spectra = run_prosail(params) # 可视化植被光谱 plt.plot(spectra) plt.title('PROSAIL spectra') plt.xlabel('Wavelength (nm)') plt.ylabel('Reflectance') plt.show() ``` 这将生成一个包含 PROSAIL 模型生成的植被光谱的简单图表。您可以使用 Matplotlib 库的其他功能来创建更复杂的图表。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 47
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值