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¶
Defines cylinder scatterers.
-
class
Bisphere(n=None, h=None, d=None, center=None, rotation=(0, 0, 0))¶ Bases:
holopy.scattering.scatterer.scatterer.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
Defines capsule scatterers.
-
class
Capsule(n=None, h=None, d=None, center=None, rotation=(0, 0, 0))¶ Bases:
holopy.scattering.scatterer.scatterer.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: -
indicators¶
-
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:
holopy.scattering.scatterer.scatterer.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.
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
Parameters: y, z (x,) – Value of the translation along each axis Returns: translated – A copy of this scatterer translated to a new location Return type: Scatterer
-
Do Constructive Solid Geometry (CSG) with scatterers. Currently only useful with the DDA th
-
class
CsgScatterer(s1, s2)¶ Bases:
holopy.scattering.scatterer.scatterer.Scatterer-
bounds¶
-
rotated(alpha, beta, gamma)¶
-
-
class
Difference(s1, s2)¶ Bases:
holopy.scattering.scatterer.csg.CsgScatterer-
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:
holopy.scattering.scatterer.csg.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:
holopy.scattering.scatterer.csg.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)
-
Defines cylinder scatterers.
-
class
Cylinder(n=None, h=None, d=None, center=None, rotation=(0, 0, 0))¶ Bases:
holopy.scattering.scatterer.scatterer.CenteredScattererScattering object representing cylinder scatterers
Parameters:
Defines ellipsoidal scatterers.
-
class
Ellipsoid(n=None, r=None, center=None, rotation=(0, 0, 0))¶ Bases:
holopy.scattering.scatterer.scatterer.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
-
indicators¶ Ellipsoid indicators does not currently apply rotations
Type: NOTE
Defines two types of Janus (two faced) Spheres as scattering primitives.
-
class
JanusSphere_Tapered(n=None, r=None, rotation=(0, 0), center=None)¶ Bases:
holopy.scattering.scatterer.scatterer.CenteredScatterer-
indicators¶
-
-
class
JanusSphere_Uniform(n=None, r=None, rotation=(0, 0, 0), center=None)¶ Bases:
holopy.scattering.scatterer.scatterer.CenteredScatterer-
indicators¶
-
The abstract base class for all scattering objects
-
class
CenteredScatterer(center=None)¶
-
class
Indicators(functions, bound=None)¶ Bases:
holopy.core.holopy_object.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:
holopy.core.holopy_object.HoloPyObjectBase class for scatterers
-
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)¶
-
num_domains¶
-
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: dict
-
translated(coord1, coord2=None, coord3=None)¶ Make a copy of this scatterer translated to a new location
Parameters: y, z (x,) – Value of the translation along each axis Returns: translated – A copy of this scatterer translated to a new location Return type: Scatterer
-
voxelate(spacing, medium_index=0)¶ Represent a scatterer by discretizing into voxels
Parameters: Returns: voxelation – An array with refractive index at every pixel
Return type: np.ndarray
-
voxelate_domains(spacing)¶
-
x¶
-
y¶
-
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
Defines Sphere, a scattering primitive
-
class
LayeredSphere(n=None, t=None, center=None)¶ Bases:
holopy.scattering.scatterer.sphere.SphereAlternative description of a sphere where you specify layer thicknesses instead of radii
-
n¶ Index of each each layer
Type: list of complex
-
t¶ Thickness of each layer
Type: list of float
-
center¶ specifies coordinates of center of sphere
Type: length 3 listlike
-
r¶
-
-
class
Sphere(n=None, r=0.5, center=None)¶ Bases:
holopy.scattering.scatterer.scatterer.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
-
indicators¶
-
num_domains¶
-
rotated(alpha, beta, gamma)¶
-
Defines Spheres, a Scatterers scatterer consisting of Spheres
-
class
RigidCluster(spheres, translation=(0, 0, 0), rotation=(0, 0, 0))¶ Bases:
holopy.scattering.scatterer.spherecluster.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.
Parameters:
-
scatterers¶
-
-
class
Spheres(scatterers, warn=True)¶ Bases:
holopy.scattering.scatterer.composite.ScatterersContains optical and geometrical properties of a cluster of spheres.
-
spheres¶ Spheres which will make up the cluster
Type: list of Spheres
Notes
-
add(scatterer)¶
-
center¶
-
centers¶
-
largest_overlap()¶
-
n¶
-
n_imag¶
-
n_real¶
-
overlaps¶
-
r¶
-
x¶
-
y¶
-
z¶
-
Defines spheroidal scatterers.
-
class
Spheroid(n=None, r=None, rotation=(0, 0, 0), center=None)¶ Bases:
holopy.scattering.scatterer.scatterer.CenteredScattererScattering object representing spheroidal scatterers
-
rotation¶ specifies the Euler angles (alpha, beta, gamma) in radians
Type: 3-tuple, list or numpy array
-
indicators¶
-