QuantumATK Forum
QuantumATK => General Questions and Answers => Topic started by: sayantanu on July 2, 2016, 12:02
-
Dear ATK users,
I'm using the script refractive_index.py (mentioned at the bottom of the following page: https://quantumwise.com/documents/tutorials/latest/SiliconOptical/index.html/chap.Si.Band.html) to generate the plot for refractive index and absorption coefficient. I'm getting the figure but I didn't find any option to export the data. How can I get the data of this plot?
-
You may export the data for n and alpha (as a function of wavelength, l) to file by adding the following lines to the python script given in the tutorial.
f = open('alpha.dat','w')
for i in range(len(l)):
temp = str(l[ i ]) + ' ' + str(alpha[ i ]) + ' \n'
f.write(temp)
f.close()
f = open('n.dat','w')
for i in range(len(l)):
temp = str(l[ i ]) + ' ' + str(n[ i ]) + ' \n'
f.write(temp)
f.close()
The data for refraction index (n) and absorption coefficient (alpha) are then saved to the 'n.dat' and 'alpha.dat' file, respectively. Note that the data are given in xy-format (x->wavelength l value and y->n or alpha value), and the files are just text files.
-
Thanks a lot