Skip to content

Commit

Permalink
DOC: documentation for spheroids
Browse files Browse the repository at this point in the history
  • Loading branch information
lavakyan committed Mar 5, 2021
1 parent 2749a9d commit dbec692
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
Binary file modified doc/source/scripting/mat_au1ag2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions doc/source/scripting/nonspherical.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
.. _nonspherical:


Non-spherical particle shapes
-----------------------------

T-matrix formulation allows to perform computational efficient calculations for single axially-symmtric objects.
Currently supported only spheroid shape (rotational ellipsoid) using external library ScatterPy <https://github.com/TCvanLeth/ScatterPy>. The details can be found in [Mishchenko1998]_.

Example
^^^^^^^

Calculation of extinction for oblate spheroid with aspect ratio of 1.5.
The size is specified by diamter of equivalent-volume sphere.


.. literalinclude:: spheroid_contrib.py
:lines: 2-12


.. image:: spheroid_shape.png


.. literalinclude:: spheroid_contrib.py
:lines: 14-20


.. image:: spheroid_ext.png


Class
^^^^^

.. automodule:: mstm_studio.contrib_spheroid
:members: SpheroidSP



.. [Mishchenko1998] M. Mishchenko, L. Travis, "Capabilities and limitations of a current FORTRAN implementation of the T-matrix method for randomly oriented, rotationally symmetric scatterers " (1998) 309
19 changes: 19 additions & 0 deletions doc/source/scripting/spheroid_contrib.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

from mstm_studio.alloy_AuAg import AlloyAuAg
from mstm_studio.contrib_spheroid import SpheroidSP
import numpy as np


wls = np.linspace(300, 800, 51) # range for calculation, in nm
SIZE = 20 # nm, particle diameter
ASPECT = 1.5 # a / c = horiz. axis / rot. axis

sph = SpheroidSP(wavelengths=wls) # create object
sph.set_material(AlloyAuAg(x_Au=1), 1.5) # particle and matrix refr. ind.

fig, axs = sph.plot_shape([1, SIZE, ASPECT])
fig.savefig('spheroid_shape.png', bbox_inches='tight')

ext_sph = sph.calculate([1, SIZE, ASPECT])
fig, axs = sph.plot([1, SIZE, ASPECT]) # scale, diameter, aspect
fig.savefig('spheroid_ext.png', bbox_inches='tight')

0 comments on commit dbec692

Please sign in to comment.