增加模块;增加主调用命令

This commit is contained in:
2026-01-07 16:36:47 +08:00
commit 2d4b170a45
109 changed files with 55763 additions and 0 deletions

View File

@ -0,0 +1,32 @@
import numpy as np
def load_coefficients(filepath):
"""
Load spectral coefficients from a full-format PROSAIL data file (e.g., dataSpec_PDB.txt).
Returns:
wl : ndarray, wavelength (nm)
nr : ndarray, refractive index of leaf material
Kab : ndarray, absorption coefficient of chlorophyll (a+b)
Kcar : ndarray, absorption coefficient of carotenoids
Kant : ndarray, absorption coefficient of anthocyanins
Kbrown : ndarray, absorption coefficient of brown pigments
Kw : ndarray, absorption coefficient of water
Km : ndarray, absorption coefficient of dry matter
Rsoil1 : ndarray, dry soil reflectance
Rsoil2 : ndarray, wet soil reflectance
"""
data = np.loadtxt(filepath, comments='%', delimiter=None)
wl = data[:, 0]
nr = data[:, 1]
Kab = data[:, 2]
Kcar = data[:, 3]
Kant = data[:, 4]
Kbrown = data[:, 5]
Kw = data[:, 6]
Km = data[:, 7]
Rsoil1 = data[:, 10]
Rsoil2 = data[:, 11]
return wl, nr, Kab, Kcar, Kant, Kbrown, Kw, Km, Rsoil1, Rsoil2