Transfer Matrix Method implementation & RefractiveIndex.info database (2015-05-24) browser
https://github.com/toftul/refractiveindex
Extended documentation can be found at kitchenknif.github.io/PyTMM
By default the RefractiveIndex module thinks that the RefractiveIndex.info database is installed in your home folder. If this is okay, the database can be used as follows:
catalog = RefractiveIndex()
mat = catalog.getMaterial('main', 'Si', 'Aspnes')
# wavelength in nanometers
n = mat.getRefractiveIndex(500))
n = mat.getExtinctionCoefficient(500))
If you want to have the database in a different folder, you just need to specify the path to the RefractiveIndex database:
catalog = RefractiveIndex("./path/to/folder/with/RefractiveIndex/database")
mat = catalog.getMaterial('main', 'Si', 'Aspnes')
n = mat.getRefractiveIndex(500)) # wavelength in nanometers
By default, the database is downloaded automatically on first use. If you do not want that, use RefractiveIndex(auto_download=False)
.
Examples of using the transferMatrix module can be found in
pytmm's People
Forkers
msqli kanhua woutdenolf ovidiopr eminsight grishaspektor f-liszt xiaod123 fieldplay richardpflaum shunsunsun dalerxli leberwurscht simbilod attolight-ntappy peterxiaoguopytmm's Issues
Incorrect handling of lossy materials
@MK8J
Let's move this over to the relevant project :)
BTW - The files did not get attached for some reason.
Pavel
Hey Mikhail,
Everything looks great. Thanks for the efforts!
On the scripts you have attached to the github, I think,
https://github.com/kitchenknif/PyTMM, might not properly take into account
the extinction coefficient. There is an implementation that does here
https://pypi.python.org/pypi/tmm.Mattias
Hi Mattias,
Hmm.
I wasn't sure if the way I had implemented complex refractive indices in PyTMM was correct, but couldn't think of any quick way of checking... If you have an example that definitely shows incorrect behaviour, I would really appreciate it.That being said,
https://github.com/kitchenknif/PyATMM
Should handle complex refractive indices correctly, and can also work with anisotropic (uniaxial) materials, but is a bit more complex.
Hey Pavel,
I wouldn't rule at user error yet . See below is my attempt at comparing 3
TMM implementations.I compared a stack of a-Si [272 nm] and Si [infinite], optical constants
shown below. So layers without k, I got good agreement between all
models.
Zip below containing everything required.i did simulations at 0 deg, so polarization doesn't matter.
pyTMM seems to do some where stuff, giving over 100% transmission.
Yeah I has a look at pyATMM, and put it in the to hard basket for now. I'm
only dealing with isotropic materials.Mattias
Mutation of input numpy array.
Hi @kitchenknif,
thank you for the very useful project!
I just wanted to point out a behaviour that I think is problematic or at least counterintuitive. When inputing a numpy array in the getRefractiveIndex functions, the array is changed during function execution. See below
import PyTMM.refractiveIndex as RI
import numpy as np
cat = RI.RefractiveIndex()
Wmat = cat.getMaterial('main','W','Werner')
lamspace = np.linspace(200,850)
lamspace
#array([200. , 213.26530612, 226.53061224, 239.79591837, ... ])
n = Wmat.getRefractiveIndex(lamspace)
lamspace
#array([0.2 , 0.21326531, 0.22653061, 0.23979592, ... ])
This is due to this
PyTMM/PyTMM/refractiveIndex.py
Line 256 in 712d14c
if your replace it with wavelength2 = wavelength/1000
and proceed with the new variable, or re-multiply wavelength before returning the function it should be fixed. There are also other lines of code where this is an issue (for interpolated refractive indices and the two extinction coefficient).
Just letting you know, I gladly help if needed
Make refractiveindex data parser as a different module?
Hi Pasha!
This refractiveindex data base parser is very nice in PyTMM. But it is not very intuitive to find -- you have to install something about transfer matrix in order to get refractive index interface.
Based on this code, I created a separate simple module which does only one thing and does it well:
https://github.com/toftul/refractiveindex
Thoughts?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.