I am searching for a python script that create/produce a figure of spectral signature of vegetation (x=Wavelength , y= Reflectance ). Could you help me?
I tried this script but, I should define very precisely the point of convergence and divergence to ended up with same curve i want to produce :
import matplotlib.pyplot as plt
import numpy as np
from scipy.interpolate import splev, splrep
wavelengths = [0.5, 0.6, 0.7, 0.85, 1.0, 1.5, 1.6, 1.7, 2.0]
reflectance = [0.02, 0.04, 0.5, 0.54, 0.5, 0.05,0.23, 0.14,0.02]
tck = splrep(wavelengths, reflectance, s=0)
new_wavelengths = np.linspace(min(wavelengths), max(wavelengths), 100)
smooth_reflectance = splev(new_wavelengths, tck)
plt.plot(new_wavelengths, smooth_reflectance, linewidth=2)
plt.xlabel('Wavelength (microns)')
plt.ylabel('Apparent Reflectance')
plt.title('The Vegetation Spectrum in Detail')
plt.grid(True)
plt.show()