I'm trying to calculate the blackbody spectral radiance using planck function:
import numpy as np
import matplotlib.pyplot as plt
from scipy import interpolate, integrate
# Physical constants:
h = 6.6260693e-34
c = 299792485.0
k = 1.380658e-23
T = 6500
wl_min = 0.1
wl_max = 8.0
wl = np.linspace(wl_min, wl_max, 1000)
f = ((((2.0*h*c**2)/(wl*1e-6)**5)*(1.0/(np.exp(((h*c)/(k*T*wl*1e-6)))-1)))*1e-6)
plt.figure()
plt.plot(wl, f)
plt.show()
Then I integrated the wavelength range (from 0.1 to 8.0) and I got a power of 3.22e7 [W]
Power = integrate.trapz(f,wl)
Now, my problem!
I would like to do the opposite: knowing the power value, find the temperature value. I can do it in Matlab but I don't know how to do it in python:
Could you help me?