The HoloPy Scatterer

The HoloPy Scatterer class defines objects that are described by numerical quantities (e.g. dimension, location, refractive index) and have known light-scattering behaviour described by a ScatteringTheory.

Scatterers are generally used in two scenarios:
  • All numerical properties (e.g. dimension, location, refractive index) are fixed to simulate a specific light scattering experiment.
  • Some numerical properties are defined as Prior objects, representing unknown values to be determined in an inference calculation.

You can find examples of these use cases in the Scattering Calculations and Fitting Models to Data tutorials.

Scatterer objects in HoloPy are inherited from two base classes:

  • CenteredScatterer describes a single object, with an optional location specified
  • Scatterers describes a collection of individual scatterers

Scatterer Attributes

All HoloPy Scatterer classes have the following properties/methods:

General manipulation
  • x, y, z Components of scatterer center
  • translated() New scatterer with location coordinates shifted by a vector
Inference calculations
  • parameters Dictionary of all values needed to describe the scatterer. Values described as Prior objects will appear that way here as well.
  • from_parameters() New scatterer built from a dictionary of parameters
Discretization
  • indicators Function(s) to describe region(s) of space occupied by scatterer domain(s)
  • index_at() Scatterer’s refractive index at given coordinates
  • in_domain() Which domain of the scatterer the given coordinates are in
  • contains() Check whether a particular point is in any domains of the scatterer
  • num_domains Number of domains of the scatterer
  • bounds Extents of the scatterer in each dimension
  • voxelate() 3D voxel grid representation of the scatterer containing its refractive index at each point

Individual Scatterers

CenteredScatterer objects are not instantiated directly, but instead in one of the subclasses:

Composite Scatterers

Scatterers objects contain multiple individual scatterers,and support the following features in addition to those shared with CenteredScatterer:

Component scatterer handling
  • Support for selecting component scatterers with square brackets and python slicing syntax
  • add() Adds a new scatterer to the composite in-place
  • rotated() New scatterer rotated about its center according to HoloPy rotation conventions

There are two specific composite scatterer classes for working with collections of spheres that have additional functionality:

Spheres

A collection of spherical scatterers, with the following properties:

  • overlaps List of pairs of component spheres that overlap
  • largest_overlap Maximum overlap distance between component spheres
RigidCluster
A collection of spherical scatterers in fixed relative positions. The entire cluster can be translated and/or rotated. RigidCluster.scatterers and RigidCluster.from_parameters() both return Spheres type objects.