Hello Sir,
I have calculated the refractive index FTO by using the optical spectrum and i want to find the refractive index, reflectivity and adsorption coefficient so i run the code which is shown below # Load the optical spectrum
spectrum = nlread('FTO.nc',OpticalSpectrum)[-1]
# Get the energies range
energies = spectrum.energies()
# get the real and imaginary part of the e_xx component of the dielectric tensor
d_r = spectrum.evaluateDielectricConstant()[0,0,:]
d_i = spectrum.evaluateImaginaryDielectricConstant()[0,0,:]
# Calculate the wavelength
l = (speed_of_light*planck_constant/energies).inUnitsOf(nanoMeter)
# Calculate real and complex part of the refractive index
n = numpy.sqrt(0.5*(numpy.sqrt(d_r**2+d_i**2)+d_r))
k = numpy.sqrt(0.5*(numpy.sqrt(d_r**2+d_i**2)-d_r))
# Calculate the adsorption coefficient
alpha = (2*energies/hbar/speed_of_light*k).inUnitsOf(nanoMeter**-1)
# Plot the data
import pylab
pylab.figure()
pylab.subplots_adjust(hspace=0.0)
ax = pylab.subplot(211)
ax.plot(l,n,'b', label='refractive index')
ax.axis([180,1000,2.2,6.4])
ax.set_ylabel(r"$n$", size=16)
ax.tick_params(axis='x', labelbottom=False, labeltop=True)
ax = pylab.subplot(212)
ax.plot(l,alpha,'r')
ax.axis([180,1000,0,0.24])
ax.set_xlabel(r"$\lambda$ (nm)", size=16)
ax.set_ylabel(r"$\alpha$ (1/nm)",size=16)
pylab.show()
after running it shows the error which is
C:\Program Files\QuantumWise\VNL-ATK-2014.0\bin\python27.zip\NL\CommonConcepts\PhysicalQuantity.py:474: RuntimeWarning: divide by zero encountered in divide
Please help me as soon as possible