holopy.scattering.theory package¶
Subpackages¶
Module contents¶
Theories to compute scattering from objects.
All theories have a common interface defined by
holopy.scattering.theory.scatteringtheory.ScatteringTheory
.
holopy.scattering.theory.dda module¶
Compute holograms using the discrete dipole approximation (DDA). Currently uses ADDA (http://code.google.com/p/adda/) to do DDA calculations. .. moduleauthor:: Thomas G. Dimiduk <tdimiduk@physics.harvard.edu>

class
DDA
(n_cpu=1, max_dpl_size=None, use_indicators=False, keep_raw_calculations=False, addacmd=[])¶ Bases:
holopy.scattering.theory.scatteringtheory.ScatteringTheory
Computes scattering using the the Discrete Dipole Approximation (DDA). It can (in principle) calculate scattering from any arbitrary scatterer. The DDA uses a numerical method that represents arbitrary scatterers as an array of point dipoles and then selfconsistently solves Maxwell’s equations to determine the scattered field. In practice, this model can be extremely computationally intensive, particularly if the size of the scatterer is larger than the wavelength of light. This model requires an external scattering code: adda .. attribute:: n_cpu
int (optional) – Number of threads to use for the DDA calculation
max_dpl_size
¶ float (optional) – Force a maximum dipole size. This is useful for forcing extra dipoles if necessary to resolve features in an object. This may make dda calculations take much longer.

use_indicators
¶ bool – If true, a scatterer’s indicators method will be used instead of its builtin adda definition

keep_raw_calculations
¶ bool – If true, do not delete the temporary file we run ADDA in, instead print its path so you can inspect its raw results
Notes
Does not handle near fields. This introduces ~5% error at 10 microns. This can in principle handle any scatterer, but in practice it will need excessive memory or computation time for particularly large scatterers.

required_spacing
(medium_wavelen, medium_index, n)¶

holopy.scattering.theory.mie module¶
Calculates holograms of spheres using Fortran implementation of Mie theory. Uses superposition to calculate scattering from multiple spheres. Uses full radial dependence of spherical Hankel functions for scattered field.

class
Mie
(compute_escat_radial=True, full_radial_dependence=True, eps1=0.01, eps2=1e16)¶ Bases:
holopy.scattering.theory.scatteringtheory.ScatteringTheory
Compute scattering using the LorenzMie solution.
This theory calculates exact scattering for single spheres and approximate results for groups of spheres. It does not account for multiple scattering, hence the approximation in the case of multiple spheres. Neglecting multiple scattering is a good approximation if the particles are sufficiently separated.
This model can also calculate the exact scattered field from a spherically symmetric particle with an arbitrary number of layers with differing refractive indices, using Yang’s recursive algorithm ([Yang2003]).
By default, calculates radial component of scattered electric fields, which is nonradiative.
Currently, in calculating the LorenzMie scattering coefficients, the maximum size parameter x = ka is limited to 1000.
holopy.scattering.theory.multisphere module¶
Defines Multisphere theory class, which calculates scattering for multiple spheres using the (exact) superposition method implemented in modified version of Daniel Mackowski’s SCSMFO1B.FOR. Uses full radial dependence of spherical Hankel functions for the scattered field.

class
Multisphere
(niter=200, eps=1e06, meth=1, qeps1=1e05, qeps2=1e08, compute_escat_radial=False, suppress_fortran_output=True)¶ Bases:
holopy.scattering.theory.scatteringtheory.ScatteringTheory
Exact scattering from a cluster of spheres.
Calculate the scattered field of a collection of spheres through a numerical method that accounts for multiple scattering and nearfield effects (see [Fung2011], [Mackowski1996]). This approach is much more accurate than Mie superposition, but it is also more computationally intensive. The Multisphere code can handle any number of spheres; see notes below for details.

niter
¶ integer (optional) – maximum number of iterations to use in solving the interaction equations

meth
¶ integer (optional) – method to use to solve interaction equations. Set to 0 for biconjugate gradient; 1 for orderofscattering

eps
¶ float (optional) – relative error tolerance in solution for interaction equations

qeps1
¶ float (optional) – error tolerance used to determine at what order the singlesphere spherical harmonic expansion should be truncated

qeps2
¶ float (optional) – error tolerance used to determine at what order the cluster spherical harmonic expansion should be truncated
Notes
According to Mackowski’s manual for SCSMFO1B.FOR [1] and later papers [2], the biconjugate gradient is generally the most efficient method for solving the interaction equations, especially for dense arrays of identical spheres. Orderofscattering may converge better for nonidentical spheres.
Multisphere does not check for overlaps becaue overlapping spheres can be useful for getting fits to converge. The results to be sensible for small overlaps even though mathemtically speaking they are not xstrictly valid.
Currently, Multisphere does not calculate the radial component of scattered electric fields. This is a good approximation for large kr, since the radial component falls off as 1/kr^2.
 scfodim.for contains three parameters, all integers:
 nod: Maximum number of spheres
 nod: Maximum order of individual sphere expansions. Will depend on
 size of largest sphere in cluster.
 notd: Maximum order of clustercentered expansion. Will depend on
 overall size of cluster.
Changing these values will require recompiling Fortran extensions.
The maximum size parameter of each individual sphere in a cluster is currently limited to 1000, indepdently of the above scfodim.for parameters.
References
[1] Daniel W. Mackowski, SCSMFO.FOR: Calculation of the Scattering Properties for a Cluster of Spheres, ftp://ftp.eng.auburn.edu/pub/dmckwski/scatcodes/scsmfo.ps [2] D.W. Mackowski, M.I. Mishchenko, A multiple sphere Tmatrix Fortran code for use on parallel computer clusters, Journal of Quantitative Spectroscopy and Radiative Transfer, In Press, Corrected Proof, Available online 11 March 2011, ISSN 00224073, DOI: 10.1016/j.jqsrt.2011.02.019. 

normalize_polarization
(illum_polarization)¶
holopy.scattering.theory.scatteringtheory module¶
Base class for scattering theories. Implements pythonbased calc_intensity and calc_holo, based on subclass’s calc_field .. moduleauthor:: Jerome Fung <jerome.fung@post.harvard.edu> .. moduleauthor:: Vinothan N. Manoharan <vnm@seas.harvard.edu> .. moduleauthor:: Thomas G. Dimiduk <tdimiduk@physics.harvard.edu>

class
ScatteringTheory
¶ Bases:
holopy.core.holopy_object.HoloPyObject
Defines common interface for all scattering theories. .. rubric:: Notes
A subclasses that do the work of computing scattering should do it by implementing _raw_fields and/or _raw_scat_matrs and (optionally) _raw_cross_sections. _raw_cross_sections is needed only for calc_cross_sections. Either of _raw_fields or _raw_scat_matrs will give you calc_holo, calc_field, and calc_intensity. Obviously calc_scat_matrix will only work if you implement _raw_cross_sections. So the simplest thing is to just implement _raw_scat_matrs. You only need to do _raw_fields there is a way to compute it more efficently and you care about that speed, or if it is easier and you don’t care about matrices.

stack_spherical
(a)¶

wavevec
(a)¶
holopy.scattering.theory.tmatrix module¶
Compute holograms using Mishchenko’s Tmatrix method for axisymmetric scatterers. Currently uses

class
Tmatrix
(delete=True)¶ Bases:
holopy.scattering.theory.scatteringtheory.ScatteringTheory
Computes scattering using the axisymmetric Tmatrix solution by Mishchenko with extended precision.
It can calculate scattering from axisymmetric scatterers such as cylinders and spheroids. Calculations for particles that are very large or have high aspect ratios may not converge.

delete
¶ bool (optional) – If true (default), delete the temporary directory where we store the input and output file for the fortran executable
Notes
Does not handle near fields. This introduces ~5% error at 10 microns.
