Author Topic: Refractive Index Script  (Read 3792 times)

0 Members and 1 Guest are viewing this topic.

Offline sayantanu

  • Heavy QuantumATK user
  • ***
  • Posts: 48
  • Country: in
  • Reputation: 0
    • View Profile
Refractive Index Script
« 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?

Offline Petr Khomyakov

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 1290
  • Country: dk
  • Reputation: 25
    • View Profile
Re: Refractive Index Script
« Reply #1 on: July 3, 2016, 13:51 »
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.

Offline sayantanu

  • Heavy QuantumATK user
  • ***
  • Posts: 48
  • Country: in
  • Reputation: 0
    • View Profile
Re: Refractive Index Script
« Reply #2 on: July 4, 2016, 12:56 »
Thanks a lot