from numpy import *
import matplotlib.pyplot as plt

f = np.genfromtxt("oled-flux.dat", delimiter=",")
lambdas = f[:,0]
glass = f[:,1]
waveguide = f[:,2]
aluminum = f[:,3]

plt.plot(lambdas,glass,'b-',label='glass')
plt.plot(lambdas,waveguide,'r-',label='organic + ITO')
plt.plot(lambdas,aluminum,'g-',label='aluminum')
plt.xlabel("wavelength (um)"); plt.ylabel("fraction of total power")
plt.axis([0.4, 0.8, 0, 1])
plt.xticks([t for t in arange(0.4,0.9,0.1)])
plt.legend(loc='upper right')
plt.show()

print("glass: {} (mean), {} (std. dev.)".format(np.mean(glass),np.std(glass)))
print("waveguide: {} (mean), {} (std. dev.)".format(np.mean(waveguide),np.std(waveguide)))
print("aluminum: {} (mean), {} (std. dev.)".format(np.mean(aluminum),np.std(aluminum)))
