holopy.scattering.scatterer package
Modules for defining different types of scatterers, including scattering primitives such as Spheres, and more complex objects such as Clusters.
Submodules
holopy.scattering.scatterer.bisphere module
Defines bisphere scatterers.
- class Bisphere(n=None, h=None, d=None, center=None, rotation=(0, 0, 0))
Bases:
CenteredScattererScattering object representing bisphere scatterers
- Parameters:
n (complex) – Index of refraction
h (distance between centers)
d (diameter)
center (3-tuple, list or numpy array) – specifies coordinates of center of the scatterer
rotation (3-tuple, list or numpy.array) – specifies the Euler angles (alpha, beta, gamma) in radians defined in a-dda manual section 8.1
holopy.scattering.scatterer.capsule module
Defines capsule scatterers.
- class Capsule(n=None, h=None, d=None, center=None, rotation=(0, 0, 0))
Bases:
CenteredScattererA cylinder with semi-spherical caps.
A particle with no rotation has its long axis pointing along +z, specify other orientations by euler angle rotations from that reference.
- Parameters:
- property indicators
holopy.scattering.scatterer.composite module
Defines Scatterers, a scatterer that consists of other scatterers, including scattering primitives (e.g. Sphere) or other Scatterers scatterers (e.g. two trimers).
- class Scatterers(scatterers=None)
Bases:
ScattererContains optical and geometrical properties of a a composite scatterer. A Scatterers can consist of multiple scattering primitives (e.g. Sphere) or other Scatterers scatterers.
- parameters[property]()
Dictionary of composite’s parameters
- add(scatterer)
Adds a new scatterer to the composite.
- from_parameters()
- translated()
- rotated()
Notes
Stores information about components in a tree. This is the most generic container for a collection of scatterers.
- add(scatterer)
- from_parameters(new_parameters)
Makes a new object similar to self with values as given in parameters. This returns a physical object, so any priors are replaced with their guesses if not included in passed-in parameters.
- get_component_list()
- in_domain(points)
Tell which domain of a scatterer points are in
- Parameters:
points (np.ndarray (Nx3)) – Point or list of points to evaluate
- Returns:
domain – The domain of each point. Domain 0 means not in the particle
- Return type:
np.ndarray (N)
- index_at(point)
- rotated(ang1, ang2=None, ang3=None)
- translated(coord1, coord2=None, coord3=None)
Make a copy of this scatterer translated to a new location
holopy.scattering.scatterer.csg module
Do Constructive Solid Geometry (CSG) with scatterers. Currently only useful with the DDA th
- class Difference(s1, s2)
Bases:
CsgScatterer- property bounds
- in_domain(points)
Tell which domain of a scatterer points are in
- Parameters:
points (np.ndarray (Nx3)) – Point or list of points to evaluate
- Returns:
domain – The domain of each point. Domain 0 means not in the particle
- Return type:
np.ndarray (N)
- class Intersection(s1, s2)
Bases:
CsgScatterer- in_domain(points)
Tell which domain of a scatterer points are in
- Parameters:
points (np.ndarray (Nx3)) – Point or list of points to evaluate
- Returns:
domain – The domain of each point. Domain 0 means not in the particle
- Return type:
np.ndarray (N)
- class Union(s1, s2)
Bases:
CsgScatterer- in_domain(points)
Tell which domain of a scatterer points are in
- Parameters:
points (np.ndarray (Nx3)) – Point or list of points to evaluate
- Returns:
domain – The domain of each point. Domain 0 means not in the particle
- Return type:
np.ndarray (N)
holopy.scattering.scatterer.cylinder module
Defines cylinder scatterers.
- class Cylinder(n=None, h=None, d=None, center=None, rotation=(0, 0, 0))
Bases:
CenteredScattererScattering object representing cylinder scatterers
- Parameters:
holopy.scattering.scatterer.ellipsoid module
Defines ellipsoidal scatterers.
- class Ellipsoid(n=None, r=None, center=None, rotation=(0, 0, 0))
Bases:
CenteredScattererScattering object representing ellipsoidal scatterers
- Parameters:
n (complex) – Index of refraction
r (float or (float, float, float)) – x, y, z semi-axes of the ellipsoid
center (3-tuple, list or numpy array) – specifies coordinates of center of the scatterer
rotation (3-tuple, list or numpy.array) – specifies the Euler angles (alpha, beta, gamma) in radians defined in a-dda manual section 8.1
- property indicators
Ellipsoid indicators does not currently apply rotations
- Type:
NOTE
holopy.scattering.scatterer.janus module
Defines two types of Janus (two faced) Spheres as scattering primitives.
- class JanusSphere_Tapered(n=None, r=None, rotation=(0, 0), center=None)
Bases:
CenteredScatterer- property indicators
- class JanusSphere_Uniform(n=None, r=None, rotation=(0, 0, 0), center=None)
Bases:
CenteredScatterer- property indicators
holopy.scattering.scatterer.scatterer module
The abstract base class for all scattering objects
- class Indicators(functions, bound=None)
Bases:
HoloPyObjectClass holding functions describing a scatterer
One or more functions (one per domain) that take Nx3 arrays of points and return a boolean array of membership in each domain. More than one indicator is allowed to return true for a given point, in that case the point is considered a member of the first domain with a true value.
- class Scatterer(indicators, n, center)
Bases:
HoloPyObjectBase class for scatterers
- property bounds
- contains(points)
- from_parameters(parameters)
Create a Scatterer from a dictionary of parameters
- Parameters:
parameters (dict) – Parameters for a scatterer. This should be of the form returned by Scatterer.parameters.
- Returns:
scatterer – A scatterer with the given parameter values
- Return type:
Scatterer class
- in_domain(points)
Tell which domain of a scatterer points are in
- Parameters:
points (np.ndarray (Nx3)) – Point or list of points to evaluate
- Returns:
domain – The domain of each point. Domain 0 means not in the particle
- Return type:
np.ndarray (N)
- index_at(points, background=0)
- property num_domains
- property parameters
Get a dictionary of this scatterer’s parameters
- Parameters:
None
- Returns:
parameters – A dictionary of this scatterer’s parameters. This dict can be passed to Scatterer.from_parameters to make a copy of this scatterer
- Return type:
- translated(coord1, coord2=None, coord3=None)
Make a copy of this scatterer translated to a new location
- voxelate(spacing, medium_index=0)
Represent a scatterer by discretizing into voxels
- voxelate_domains(spacing)
- property x
- property y
- property z
- bound_union(d1, d2)
- find_bounds(indicator)
Finds the bounds needed to contain an indicator function
Notes
Will probably determine incorrect bounds for functions which are not convex
holopy.scattering.scatterer.sphere module
Defines Sphere, a scattering primitive
- class LayeredSphere(n=None, t=None, center=None)
Bases:
SphereAlternative description of a sphere where you specify layer thicknesses instead of radii
- center
specifies coordinates of center of sphere
- Type:
length 3 listlike
- property r
- class Sphere(n=None, r=0.5, center=None)
Bases:
CenteredScattererContains optical and geometrical properties of a sphere, a scattering primitive.
This can be a multiple layered sphere by making r and n lists.
- center
specifies coordinates of center of sphere
- Type:
length 3 listlike
- property indicators
- property num_domains
- rotated(alpha, beta, gamma)
holopy.scattering.scatterer.spherecluster module
Defines Spheres, a Scatterers scatterer consisting of Spheres
- class RigidCluster(spheres, translation=(0, 0, 0), rotation=(0, 0, 0))
Bases:
Spheres- from_parameters(parameters)
Makes a new object similar to self with values as given in parameters. This returns a physical object, so any priors are replaced with their guesses if not included in passed-in parameters.
- property scatterers
- class Spheres(scatterers, warn=True)
Bases:
ScatterersContains optical and geometrical properties of a cluster of spheres.
Notes
- add(scatterer)
- property center
- property centers
- largest_overlap()
- property n
- property n_imag
- property n_real
- property overlaps
- property r
- property x
- property y
- property z
holopy.scattering.scatterer.spheroid module
Defines spheroidal scatterers.
- class Spheroid(n=None, r=None, rotation=(0, 0, 0), center=None)
Bases:
CenteredScattererScattering object representing spheroidal scatterers
- rotation
specifies the Euler angles (alpha, beta, gamma) in radians
- Type:
3-tuple, list or numpy array
- property indicators