Skip to content
Transfer Matrix Method implementation
Python Makefile
Branch: master
Clone or download
Pull request Compare This branch is 7 commits ahead, 5 commits behind kitchenknif:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
debian
examples Updated field calculation example. Apr 15, 2019
.gitattributes initial commit Jul 16, 2015
.gitignore Removed unwanted functionality and converted the code to a Cython ext… Mar 15, 2018
COPYING.txt Removed unwanted functionality and converted the code to a Cython ext… Mar 15, 2018
LICENSE.txt
MANIFEST.in Removed unwanted functionality and converted the code to a Cython ext… Mar 15, 2018
Makefile Removed unwanted functionality and converted the code to a Cython ext… Mar 15, 2018
README.md Corrected the README file. Mar 22, 2018
setup.py Removed unwanted functionality and converted the code to a Cython ext… Mar 15, 2018
tmmnlay.pyx Corrected some bugs and added examples. Mar 22, 2018

README.md

tmmnlay

Cython implementation of the Transfer Matrix Method

This extension implements the Transfer Matrix Method, which is used in optics and acoustics to analyze the propagation of electromagnetic or acoustic waves through a multilayer medium. For details of the implementation, check the algorithm.

Credits

tmmnlay has been forked from PyTMM. However, I have rewritten all the code from scratch in order to (i) increase the calculation speed and (ii) make it more 'Pythonic' (e.g., with the new code you can run the calculation for all wavelengths in a single step). In the process of rewriting it I have also implemented functionality that was missing in PyTMM, like the calculation of the electric field in the multilayer.

Using tmmnlay

Compiling the Code:

To compile the Cython extension you need Cython, a C compiler, NumPy:

  • cython (>=0.23.4)
  • python-numpy (>= 1.0.3)
  • python-all-dev (any version)
  • python-numpy-dev (any version)

And to compile the Debian package you need some additional tools:

  • debhelper (>=7.0.0)
  • dh-python (any version)
  • cdbs (>= 0.4.49)

Compilation options

  • make source - Create source package for Cython extension
  • make install - Install Cython extension on local system
  • make ext - Create Cython extension in place
  • make deb - Generate a deb package for Cython extension
  • make rpm - Generate a rpm package for Cython extension
  • make clean - Delete temporal files

Using tmmnlay

from tmmnlay import MultiLayer
...
b = MultiLayer(n=(1.0, n2, n1), d=(0.0, d, 0.0), wvl=wavelength)
r, t = b.rt_TE
...

License

GPL v3+

You can’t perform that action at this time.