Skip to content

Commit

Permalink
bump version, add refractiveindex.info example
Browse files Browse the repository at this point in the history
  • Loading branch information
kitchenknif committed Nov 21, 2017
1 parent 169f6b4 commit 320a406
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion PyTMM/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"""

__author__ = "Pavel Dmitriev"
__version__ = "1.0.1b"
__version__ = "1.0.1c"
__license__ = "GPLv3"
25 changes: 25 additions & 0 deletions PyTMM/examples/refractiveindex.info.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import numpy
import matplotlib.pyplot as plt

from PyTMM.transferMatrix import *
from PyTMM.refractiveIndex import *

database = os.path.join(os.path.dirname(os.path.realpath(__file__)),
os.path.normpath("../../../refractiveindex.info-database/database/"))
catalog = RefractiveIndex(database)

sio2 = catalog.getMaterial('main', 'SiO2', 'Malitson')

ran = range(400, 800, 1)
reflectance = []

for i in ran:
a = TransferMatrix.boundingLayer(1, sio2.getRefractiveIndex(i))
R, T = solvePropagation(a)
reflectance.append(numpy.abs(R ** 2))

plt.plot(ran, reflectance)
plt.xlabel("wavelength, nm")
plt.ylabel("reflectance")
plt.title("Reflectance of single SiO2 Boundary")
plt.show(block=True)

0 comments on commit 320a406

Please sign in to comment.