Skip to content

Python wrapper for multiple sphere T-matrix (MSTM) code and Mie theory to calculate surface plasmon resonance (SPR) spectrum and fit it to experiment

License

Notifications You must be signed in to change notification settings

lavakyan/mstm-spectrum

Repository files navigation

mstm-spectrum

About

Python wrapper for multiple sphere T-matrix (MSTM) code to calculate surface plasmon resonance (SPR) spectrum and fit it to experiment.

Based and inspired by MSMT GUI code https://git.stim.ee.uh.edu/optics/mstm-gui.git by David Mayerich.

Multi-Sphere T-Matrix code is proposed by Dr. Daniel Mackowski and Dr. Michael Mishchenko in: Mackowski and Mishchenko, "A multiple sphere T-matrix Fortran code for use on parallel computer clusters," Journal of Quantitative Spectroscopy and Radiative Transfer, 112: 2182-2192, 2011. https://dx.doi.org/10.1016/j.jqsrt.2011.02.019

Please cite the above reference if using MSTM code.

Usage

  1. Place files in the same directory:
    1. experiment file,

    2. dielectric constants files (i.e. etaGold.txt, etaSilver.txt)

    3. binaries named as:

      • for Windows: mstm.exe
      • for Linux: run_mstm.sh (to support parralel run via mpi) and mstm.x

      Source code and binaries can be obtained on MSTM website or using direct download link.

  2. Edit start_fit.py file to suit your needs. This will probably include:
    1. set to the directory with the scripts (remove this lines if they are stored in current directory):

      import sys
      # set the path to mstm_spectrum scripts. Binary mstm files should be in current folder.
      sys.path.append('/home/leon/ltg_projects/fit-T-matrix/mstm-spectrum')
    2. set the experiment file name:

      data = read_ascii('optic_sample22.dat', True, 0) # read and sort by 0th column
    3. set fitting interval and data sampling:

      wavelengths, exp = rebin(300, 800, 51, data[0,:], data[1,:])  # min 300 nm, max 800 nm, 51 bins
    4. set matrix material ('glass', 'water' and 'air' keywords are recognized) or refraction index value (1.0, 1.66, ..)

      fit_spheres_optic.MATRIX_MATERIAL = 'Glass'  # 1.66
    5. The values initialied before while-loop

      A = 60   # 'box' size
      a = 10   # sphere radius
      d = 10   # 'gap' between spheres

      are used to build initial configuration.

    6. at run time the script will show the number of spheres and prompt for continue, as shown below:

      Screenshot image

      In this example the first ~20 steps are preparational. They followed by production step, where chi-square is reported and plot is updated.

Citation

L. Avakyan, M. Heinz, A. Skidanenko, K. Yablunovskiy, J. Ihlemann, J. Meinertz, C. Patzig, M. Dubiel, L. Bugaev J. Phys.: Condens. Matter, 2017

About

Python wrapper for multiple sphere T-matrix (MSTM) code and Mie theory to calculate surface plasmon resonance (SPR) spectrum and fit it to experiment

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages