Scatterers#

class Sphere(*, source, medium_property, diameter, property)[source]#

Bases: BaseScatterer

Class representing a homogeneous spherical scatterer.

Parameters:
  • diameter (Quantity) – Diameter of the cylindrical scatterer, given in meters.

  • property (Quantity or BaseMaterial) – Defines either the refractive index (Quantity) or material (BaseMaterial) of the scatterer. Only one can be provided.

  • source (BaseSource)

  • medium_property (Quantity | BaseMaterial)

property Cabs: Quantity#

Returns the absorption cross-section.

property Cback: Quantity#

Returns the backscattering cross-section.

property Cext: Quantity#

Returns the extinction cross-section.

property Cforward: Quantity#

Returns the forward-scattering cross-section.

property Cpr: Quantity#

Returns the radiation pressure cross-section.

property Cratio: Quantity#

Returns the ratio of backscattering cross-section over total scattering.

property Csca: Quantity#

Returns the scattering cross-section.

property Qabs: Quantity#

Returns the absorption efficiency.

property Qback: Quantity#

Returns the backscattering efficiency.

property Qext: Quantity#

Returns the extinction efficiency.

property Qforward: Quantity#

Returns the forward-scattering efficiency.

property Qpr: Quantity#

Returns the radiation pressure efficiency.

property Qratio: Quantity#

Returns the efficiency ratio of backscattering over total scattering.

property Qsca: Quantity#

Returns the scattering efficiency.

an(max_order=0)[source]#

Compute \(a_n\) coefficient as defined in Eq:III.88 of B&B:

\[a_n = \frac{ \mu_{sp} \Psi_n(\alpha) \Psi_n^\prime(\beta) - \mu M \Psi_n^\prime(\alpha) \Psi_n(\beta)} {\mu_{sp} \xi_n(\alpha) \Psi_n^\prime(\beta)- \mu M \xi_n^\prime (\alpha) \Psi_n(\beta)}\]

With \(M = \frac{k_{sp}}{k}\) (Eq:I.103)

If max_order is set to zero then the maximum order output is calculated using the Wiscombe criterion.

Parameters:

max_order (Optional[int])) – The maximum order of the coefficient. Default is 0.

Returns:

Array of \(a_n\) coefficients.

Return type:

numpy.ndarray

property area: Quantity#

Returns the area of the scatterer.

bn(max_order=0)[source]#

Compute \(b_n\) coefficient as defined in Eq:III.89 of B&B:

\[b_n = \frac{ \mu M \Psi_n(\alpha) \Psi_n^\prime(\beta) - \mu_{sp} \Psi_n^\prime(\alpha) \Psi_n(\beta)} {\mu M \xi_n(\alpha) \Psi_n^\prime(\beta)- \mu_{sp} \xi_n^\prime (\alpha) \Psi_n(\beta)}\]

With \(M = \frac{k_{sp}}{k}\) (Eq:I.103)

If max_order is set to zero then the maximum order output is calculated using the Wiscombe criterion.

Parameters:

max_order (Optional[int])) – The maximum order of the coefficient. Default is 0.

Returns:

Array of \(b_n\) coefficients.

Return type:

numpy.ndarray

cn(max_order=0)[source]#

For future purpose only! Compute \(c_n\) coefficient as defined in Eq:III.90 of B&B:

\[c_n = \frac{ \mu_{sp} M \big[ \xi_n(\alpha) \Psi_n^\prime(\alpha) - \xi_n^\prime(\alpha) \Psi_n(\alpha) \big]} {\mu_{sp} \xi_n(\alpha) \Psi_n^\prime(\beta)- \mu M \xi_n^\prime (\alpha) \Psi_n(\beta)}\]

With \(M = \frac{k_{sp}}{k}\) (Eq:I.103)

If max_order is set to zero then the maximum order output is calculated using the Wiscombe criterion.

Parameters:

max_order (Optional[int])) – The maximum order of the coefficient. Default is 0.

Returns:

Array of \(c_n\) coefficients.

Return type:

numpy.ndarray

diameter: Quantity#
dn(max_order=0)[source]#

For future purpose only! Compute \(d_n\) coefficient as defined in Eq:III.91 of B&B:

\[d_n = \frac{ \mu M^2 \big[ \xi_n(\alpha) \Psi_n^\prime(\alpha) - \xi_n^\prime(\alpha) \Psi_n(\alpha) \big]} {\mu M \xi_n(\alpha) \Psi_n^\prime(\beta)- \mu_{sp} M \xi_n^\prime (\alpha) \Psi_n(\beta)}\]

With \(M = \frac{k_{sp}}{k}\) (Eq:I.103)

If max_order is set to zero then the maximum order output is calculated using the Wiscombe criterion.

Parameters:

max_order (Optional[int])) – The maximum order of the coefficient. Default is 0.

Returns:

Array of \(d_n\) coefficients.

Return type:

numpy.ndarray

property g: Quantity#

Returns the anisotropy factor.

get_far_field(sampling=200, distance=<Quantity(1, 'meter')>)#

Compute the far-field scattering pattern for the scatterer.

The far fields describe the behavior of the scattered electromagnetic waves at a large distance from the scatterer, where the waves can be approximated as planar. The computed far fields represent the scattered electric field components in the directions parallel and perpendicular to the plane of incidence.

The far fields are computed as:

\[\text{Fields} = E_{||}(\phi, \theta)^2, \, E_{\perp}(\phi, \theta)^2\]

These components represent the intensities of the scattered electric field in the parallel (( E_{||} )) and perpendicular (( E_{perp} )) directions as functions of the spherical angles ( phi ) (azimuthal) and ( theta ) (polar).

The fields are expressed up to a constant phase factor:

\[\exp{\left(-i k r \right)}\]

Where:

  • ( k ): The wave number, related to the wavelength of the incident light.

  • ( r ): The distance from the scatterer (assumed to be large in the far-field approximation).

Parameters:
  • sampling (int) – The number of angular points used to sample the far-field pattern. A higher sampling value increases the angular resolution of the computed far-field intensities.

  • distance (Quantity, optional) – The distance from the scatterer at which the far fields are evaluated. By default, this is set to 1 meter, but it can be adjusted to suit the specific experimental configuration.

Returns:

An object containing the computed far-field components (parallel and perpendicular intensities), which represent the angular distribution of the scattered light in the far field.

Return type:

FarField

Notes

  • The far-field approximation assumes that the distance from the scatterer is large enough that the curvature of the wavefronts can be neglected, and the fields can be treated as planar.

  • This method is useful for determining the angular distribution of the scattered light, which is critical in applications such as radar cross-section analysis, optical scattering experiments, and remote sensing.

Example

You can use this method to compute the far-field scattering pattern of a spherical scatterer, which is essential in understanding how the scatterer redirects light in the far field.

Example usage:

>>> far_field = scatterer.get_far_field(sampling=500)
>>> print(far_field.E_phi, far_field.E_theta)
get_farfields_array(phi, theta, r)#

Computes the scattering far field for unstructured coordinates.

The method computes the fields up to a constant phase value.

Parameters:
  • phi (numpy.ndarray) – The phi angles in radians.

  • theta (numpy.ndarray) – The theta angles in radians.

  • r (numpy.ndarray) – The radial distances.

  • Returns – Tuple[numpy.ndarray, numpy.ndarray]: The computed far fields.

Return type:

Tuple[ndarray, ndarray]

get_footprint(detector)#

Compute the footprint of the scattered light coupling with the detector.

The footprint represents the spatial distribution of the scattered light as it couples with the detector. This is important for understanding how the scattered light interacts with the detector’s field of view and is influenced by both the scatterer’s properties and the detector configuration.

The footprint is computed using an inverse Fourier transform:

\[\big| \mathscr{F}^{-1} \big\{ \tilde{ \psi } (\xi, \nu),\ \tilde{ \phi}_{l,m}(\xi, \nu) \big\} (\delta_x, \delta_y) \big|^2\]

Where:

  • ( tilde{ psi } (xi, nu) ): The Fourier transform of the scattered field.

  • ( tilde{ phi}_{l,m} (xi, nu) ): The Fourier transform of the detector’s capturing field.

  • ( mathscr{F}^{-1} ): The inverse Fourier transform operator.

  • ( (delta_x, delta_y) ): Spatial coordinates describing the footprint in the detector plane.

The inverse Fourier transform yields the spatial pattern of the scattered light’s interaction with the detector, which is then squared to compute the intensity of the footprint.

Parameters:

detector (GenericDetector) – The detector object that defines the capturing field and geometry. This object provides information about the detector’s configuration, including its numerical aperture, position, and sensitivity.

Returns:

An object containing the computed scatterer footprint, representing the spatial distribution of the scattered light on the detector plane.

Return type:

Footprint

Notes

  • The footprint provides valuable information about the coupling efficiency between the scattered light and the detector. This is useful in designing experiments where precise control of light detection is important, such as in microscopy, remote sensing, or optical measurements.

  • The interaction between the scattered field and the detector is influenced by factors such as the size, shape, and refractive index of the scatterer, as well as the detector’s aperture and positioning.

Example

You can use this method to compute the footprint of the scattered light on a detector, helping to visualize how light from the scatterer is spatially distributed on the detector.

Example usage:

>>> footprint = scatterer.get_footprint(detector=my_detector)
>>> print(footprint)
get_s1s2(sampling=200, distance=<Quantity(1, 'meter')>)#

Compute the S1 and S2 scattering amplitude functions for a spherical scatterer.

The S1 and S2 parameters represent the scattering amplitudes for perpendicular and parallel polarizations of light, respectively. These parameters are fundamental in Mie theory, which describes the scattering of electromagnetic waves by spherical particles.

The formulas for ( S_1 ) and ( S_2 ) are:

\[\begin{split}S_1 = \sum\limits_{n=1}^{n_{\text{max}}} \frac{2n+1}{n(n+1)} \left( a_n \pi_n + b_n \tau_n \right) \\ S_2 = \sum\limits_{n=1}^{n_{\text{max}}} \frac{2n+1}{n(n+1)} \left( a_n \tau_n + b_n \pi_n \right)\end{split}\]

Where:

  • ( a_n ) and ( b_n ): Mie coefficients, which depend on the size, shape, and refractive index of the scatterer.

  • ( pi_n ) and ( tau_n ): Angular functions related to the angular components of the incident and scattered fields.

  • ( n_{text{max}} ): Maximum number of terms in the series, determined by the size parameter of the scatterer.

These scattering amplitude functions are essential for calculating properties such as scattering phase functions, efficiencies, and angular distribution of scattered light.

Parameters:
  • sampling (int) – The number of angular points used to sample the S1 and S2 functions. Higher sampling improves the resolution of the scattering pattern but increases computation time.

  • distance (Quantity, optional) – The distance from the scatterer at which the S1 and S2 parameters are evaluated. This is typically set to 1 meter by default, but can be adjusted for specific setups.

Returns:

An object containing the computed S1 and S2 parameters, representing the scattering amplitudes for the two polarization components.

Return type:

S1S2

Notes

  • The S1 and S2 parameters are central to Mie scattering theory and are used to derive many important scattering properties, such as intensity distributions and polarization effects.

  • The sampling parameter controls how finely the angular distribution is resolved. A higher value of sampling provides more detailed scattering information, which can be critical for accurately modeling the far-field pattern.

Example

You can use this method to compute the scattering properties of spherical particles, particularly in experiments where the polarization and scattering pattern of the light are important.

Example usage:

>>> s1s2 = scatterer.get_s1s2(sampling=500)
>>> print(s1s2.S1, s1s2.S2)
get_spf(sampling=200, distance=<Quantity(1, 'meter')>)#

Compute the scattering phase function (SPF) for the scatterer.

The scattering phase function describes how the intensity of scattered light varies as a function of the scattering angles ( theta ) (polar) and ( phi ) (azimuthal). It is a key quantity in light scattering, as it characterizes the angular distribution of scattered light.

The scattering phase function is computed as:

\[\text{SPF} = \sqrt{ E_{\parallel}(\phi, \theta)^2 + E_{\perp}(\phi, \theta)^2 }\]

Where:

  • ( E_{parallel} ): The parallel component of the scattered electric field.

  • ( E_{perp} ): The perpendicular component of the scattered electric field.

  • ( phi ) and ( theta ): The azimuthal and polar angles, respectively, which describe the angular position of the scattered light.

The SPF combines the intensity contributions from both polarization components to describe the total scattered intensity in different directions.

Parameters:
  • sampling (int) – The number of angular points used to sample the scattering phase function. A higher sampling value increases the angular resolution of the computed SPF.

  • distance (Quantity, optional) – The distance from the scatterer at which the scattering phase function is evaluated. By default, this is set to 1 meter, but it can be adjusted depending on the specific experimental configuration.

Returns:

An object containing the computed scattering phase function (SPF), representing the angular distribution of scattered light intensity.

Return type:

SPF

Notes

  • The scattering phase function is a critical quantity in the study of light scattering, as it provides insight into the directionality of the scattered light. It is commonly used in fields like atmospheric optics, biomedical imaging, and remote sensing.

  • The sampling parameter controls the angular resolution of the SPF. Higher sampling values yield more detailed scattering patterns, especially important when capturing small angular features.

Example

You can use this method to compute the scattering phase function of a spherical scatterer, helping to understand the angular distribution of light scattered by the particle.

Example usage:

>>> spf = scatterer.get_spf(sampling=500)
>>> print(spf)
get_stokes(sampling=200, distance=<Quantity(1, 'meter')>)#

Compute the four Stokes parameters: I, Q, U, and V, which describe the polarization state of scattered light.

The Stokes parameters provide a complete description of the polarization state of electromagnetic radiation, and are defined as follows:

\[\begin{split}I &= \big| E_x \big|^2 + \big| E_y \big|^2 \quad &\text{(total intensity)} \\ Q &= \big| E_x \big|^2 - \big| E_y \big|^2 \quad &\text{(linear polarization along x and y)} \\ U &= 2 \mathcal{Re} \big\{ E_x E_y^* \big\} \quad &\text{(linear polarization at +45° and -45°)} \\ V &= 2 \mathcal{Im} \big\{ E_x E_y^* \big\} \quad &\text{(circular polarization)}\end{split}\]

Where:

  • ( I ): Total intensity of the scattered light.

  • ( Q ): The degree of linear polarization along the x and y axes.

  • ( U ): The degree of linear polarization at +45° and -45° to the axes.

  • ( V ): The degree of circular polarization.

These parameters provide a powerful way to represent the full polarization state of the scattered light.

Parameters:
  • sampling (int) – The number of angular points used to sample the Stokes parameters. A higher sampling value increases the resolution of the computed polarization pattern.

  • distance (Quantity, optional) – The distance from the scatterer at which the Stokes parameters are evaluated. The default is 1 meter, but this can be adjusted based on the experimental setup.

Returns:

An object containing the computed Stokes parameters (I, Q, U, V), which describe the polarization state of the scattered light.

Return type:

Stokes

Notes

  • The Stokes parameters are essential for understanding and characterizing the polarization of scattered light. They are used in a wide variety of applications, including atmospheric optics, remote sensing, and optical communication.

  • The sampling parameter controls the angular resolution of the calculated Stokes parameters. Higher values provide finer detail, which can be important in accurately modeling polarization effects in scattering experiments.

Example

You can use this method to compute the Stokes parameters for a spherical scatterer, helping you analyze how the scatterer affects the polarization state of light.

Example usage:

>>> stokes_params = scatterer.get_stokes(sampling=500)
>>> print(stokes_params.I, stokes_params.Q, stokes_params.U, stokes_params.V)
medium_property: Quantity | BaseMaterial#
print_properties()#

Prints a table of the scatterer’s properties and their values.

Return type:

None

property: Quantity | BaseMaterial#
property_names = ['size_parameter', 'area', 'g', 'Qsca', 'Qext', 'Qabs', 'Qback', 'Qratio', 'Qpr', 'Csca', 'Cext', 'Cabs', 'Cback', 'Cratio', 'Cpr']#
set_binding()[source]#

Binds the Python representation of the sphere to its C++ counterpart using provided properties.

Return type:

None

property size_parameter: Quantity#

Returns the size parameter of the scatterer.

source: BaseSource#
class Cylinder(*, source, medium_property, diameter, property)[source]#

Bases: BaseScatterer

Represents a cylindrical scatterer used for scattering simulations in optical systems.

Parameters:
  • diameter (Quantity) – Diameter of the cylindrical scatterer, given in meters.

  • property (Quantity | BaseMaterial) – Defines either the refractive index (Quantity) or material (BaseMaterial) of the scatterer. Only one of these should be provided at a time to specify the core characteristic.

  • source (BaseSource)

  • medium_property (Quantity | BaseMaterial)

property Cabs: Quantity#

Returns the absorption cross-section.

property Cback: None#

Returns the backscattering cross-section.

property Cext: Quantity#

Returns the extinction cross-section.

property Cforward: Quantity#

Returns the forward-scattering cross-section.

property Cpr: Quantity#

Returns the radiation pressure cross-section.

property Cratio: None#

Returns the ratio of backscattering cross-section over total scattering.

property Csca: Quantity#

Returns the scattering cross-section.

property Qabs: Quantity#

Returns the absorption efficiency.

property Qback: None#

Returns the backscattering efficiency.

property Qext: Quantity#

Returns the extinction efficiency.

property Qforward: Quantity#

Returns the forward-scattering efficiency.

property Qpr: Quantity#

Returns the radiation pressure efficiency.

property Qratio: None#

Returns the efficiency ratio of backscattering over total scattering.

property Qsca: Quantity#

Returns the scattering efficiency.

a1n(max_order=0)[source]#

Compute \(a_{1n}\) coefficient as defined in ref[5]:

\[a_{1n} = \frac{ m_t J_n(m_t x) J_n^\prime (m x) - m J_n^\prime (m_t x) J_n(m x) } { m_t J_n(m_t x) H_n^\prime (m x) - m J_n^\prime (m_t x) H_n(m x) }\]

With \(m\) being the refractive index of the medium and \(m_t\) being the refractive index of the scatterer.

If max_order is set to zero then the maximum order output is calculated using the Wiscombe criterion.

Parameters:

max_order (Optional[int])) – The maximum order of the coefficient. Default is 0.

Returns:

Array of \(a_{1n}\) coefficients.

Return type:

numpy.ndarray

a2n(max_order=0)[source]#

Compute \(a_{2n}\) coefficient as defined in ref[5]:

\[a_{2n} = \frac{ m_t J_n(m_t x) J_n^\prime (m x) - m J_n^\prime (m_t x) J_n(m x) } { m_t J_n(m_t x) H_n^\prime (m x) - m J_n^\prime (m_t x) H_n(m x) }\]

With \(m\) being the refractive index of the medium and \(m_t\) being the refractive index of the scatterer.

If max_order is set to zero then the maximum order output is calculated using the Wiscombe criterion.

Parameters:

max_order (Optional[int])) – The maximum order of the coefficient. Default is 0.

Returns:

Array of \(a_{2n}\) coefficients.

Return type:

numpy.ndarray

property area: Quantity#

Returns the area of the scatterer.

b1n(max_order=0)[source]#

Compute \(b_{1n}\) coefficient as defined in ref[5]:

\[b_{1n} = \frac{ m J_n(m_t x) J_n^\prime (m x) - m_t J_n^\prime (m_t x) J_n(m x) } { m J_n(m_t x) H_n^\prime (m x) - m_t J_n^\prime (m_t x) H_n(m x) }\]

With \(m\) being the refractive index of the medium and \(m_t\) being the refractive index of the scatterer.

If max_order is set to zero then the maximum order output is calculated using the Wiscombe criterion.

Parameters:

max_order (Optional[int])) – The maximum order of the coefficient. Default is 0.

Returns:

Array of \(b_{1n}\) coefficients.

Return type:

numpy.ndarray

b2n(max_order=0)[source]#

Compute \(b_{2n}\) coefficient as defined in ref[5]:

\[b_{2n} = \frac{ m J_n(m_t x) J_n^\prime (m x) - m_t J_n^\prime (m_t x) J_n(m x) } { m J_n(m_t x) H_n^\prime (m x) - m_t J_n^\prime (m_t x) H_n(m x) }\]

With \(m\) being the refractive index of the medium and \(m_t\) being the refractive index of the scatterer.

If max_order is set to zero then the maximum order output is calculated using the Wiscombe criterion.

Parameters:

max_order (Optional[int])) – The maximum order of the coefficient. Default is 0.

Returns:

Array of \(b_{2n}\) coefficients.

Return type:

numpy.ndarray

diameter: Quantity#
property g: Quantity#

Returns the anisotropy factor.

get_far_field(sampling=200, distance=<Quantity(1, 'meter')>)#

Compute the far-field scattering pattern for the scatterer.

The far fields describe the behavior of the scattered electromagnetic waves at a large distance from the scatterer, where the waves can be approximated as planar. The computed far fields represent the scattered electric field components in the directions parallel and perpendicular to the plane of incidence.

The far fields are computed as:

\[\text{Fields} = E_{||}(\phi, \theta)^2, \, E_{\perp}(\phi, \theta)^2\]

These components represent the intensities of the scattered electric field in the parallel (( E_{||} )) and perpendicular (( E_{perp} )) directions as functions of the spherical angles ( phi ) (azimuthal) and ( theta ) (polar).

The fields are expressed up to a constant phase factor:

\[\exp{\left(-i k r \right)}\]

Where:

  • ( k ): The wave number, related to the wavelength of the incident light.

  • ( r ): The distance from the scatterer (assumed to be large in the far-field approximation).

Parameters:
  • sampling (int) – The number of angular points used to sample the far-field pattern. A higher sampling value increases the angular resolution of the computed far-field intensities.

  • distance (Quantity, optional) – The distance from the scatterer at which the far fields are evaluated. By default, this is set to 1 meter, but it can be adjusted to suit the specific experimental configuration.

Returns:

An object containing the computed far-field components (parallel and perpendicular intensities), which represent the angular distribution of the scattered light in the far field.

Return type:

FarField

Notes

  • The far-field approximation assumes that the distance from the scatterer is large enough that the curvature of the wavefronts can be neglected, and the fields can be treated as planar.

  • This method is useful for determining the angular distribution of the scattered light, which is critical in applications such as radar cross-section analysis, optical scattering experiments, and remote sensing.

Example

You can use this method to compute the far-field scattering pattern of a spherical scatterer, which is essential in understanding how the scatterer redirects light in the far field.

Example usage:

>>> far_field = scatterer.get_far_field(sampling=500)
>>> print(far_field.E_phi, far_field.E_theta)
get_farfields_array(phi, theta, r)#

Computes the scattering far field for unstructured coordinates.

The method computes the fields up to a constant phase value.

Parameters:
  • phi (numpy.ndarray) – The phi angles in radians.

  • theta (numpy.ndarray) – The theta angles in radians.

  • r (numpy.ndarray) – The radial distances.

  • Returns – Tuple[numpy.ndarray, numpy.ndarray]: The computed far fields.

Return type:

Tuple[ndarray, ndarray]

get_footprint(detector)#

Compute the footprint of the scattered light coupling with the detector.

The footprint represents the spatial distribution of the scattered light as it couples with the detector. This is important for understanding how the scattered light interacts with the detector’s field of view and is influenced by both the scatterer’s properties and the detector configuration.

The footprint is computed using an inverse Fourier transform:

\[\big| \mathscr{F}^{-1} \big\{ \tilde{ \psi } (\xi, \nu),\ \tilde{ \phi}_{l,m}(\xi, \nu) \big\} (\delta_x, \delta_y) \big|^2\]

Where:

  • ( tilde{ psi } (xi, nu) ): The Fourier transform of the scattered field.

  • ( tilde{ phi}_{l,m} (xi, nu) ): The Fourier transform of the detector’s capturing field.

  • ( mathscr{F}^{-1} ): The inverse Fourier transform operator.

  • ( (delta_x, delta_y) ): Spatial coordinates describing the footprint in the detector plane.

The inverse Fourier transform yields the spatial pattern of the scattered light’s interaction with the detector, which is then squared to compute the intensity of the footprint.

Parameters:

detector (GenericDetector) – The detector object that defines the capturing field and geometry. This object provides information about the detector’s configuration, including its numerical aperture, position, and sensitivity.

Returns:

An object containing the computed scatterer footprint, representing the spatial distribution of the scattered light on the detector plane.

Return type:

Footprint

Notes

  • The footprint provides valuable information about the coupling efficiency between the scattered light and the detector. This is useful in designing experiments where precise control of light detection is important, such as in microscopy, remote sensing, or optical measurements.

  • The interaction between the scattered field and the detector is influenced by factors such as the size, shape, and refractive index of the scatterer, as well as the detector’s aperture and positioning.

Example

You can use this method to compute the footprint of the scattered light on a detector, helping to visualize how light from the scatterer is spatially distributed on the detector.

Example usage:

>>> footprint = scatterer.get_footprint(detector=my_detector)
>>> print(footprint)
get_s1s2(sampling=200, distance=<Quantity(1, 'meter')>)#

Compute the S1 and S2 scattering amplitude functions for a spherical scatterer.

The S1 and S2 parameters represent the scattering amplitudes for perpendicular and parallel polarizations of light, respectively. These parameters are fundamental in Mie theory, which describes the scattering of electromagnetic waves by spherical particles.

The formulas for ( S_1 ) and ( S_2 ) are:

\[\begin{split}S_1 = \sum\limits_{n=1}^{n_{\text{max}}} \frac{2n+1}{n(n+1)} \left( a_n \pi_n + b_n \tau_n \right) \\ S_2 = \sum\limits_{n=1}^{n_{\text{max}}} \frac{2n+1}{n(n+1)} \left( a_n \tau_n + b_n \pi_n \right)\end{split}\]

Where:

  • ( a_n ) and ( b_n ): Mie coefficients, which depend on the size, shape, and refractive index of the scatterer.

  • ( pi_n ) and ( tau_n ): Angular functions related to the angular components of the incident and scattered fields.

  • ( n_{text{max}} ): Maximum number of terms in the series, determined by the size parameter of the scatterer.

These scattering amplitude functions are essential for calculating properties such as scattering phase functions, efficiencies, and angular distribution of scattered light.

Parameters:
  • sampling (int) – The number of angular points used to sample the S1 and S2 functions. Higher sampling improves the resolution of the scattering pattern but increases computation time.

  • distance (Quantity, optional) – The distance from the scatterer at which the S1 and S2 parameters are evaluated. This is typically set to 1 meter by default, but can be adjusted for specific setups.

Returns:

An object containing the computed S1 and S2 parameters, representing the scattering amplitudes for the two polarization components.

Return type:

S1S2

Notes

  • The S1 and S2 parameters are central to Mie scattering theory and are used to derive many important scattering properties, such as intensity distributions and polarization effects.

  • The sampling parameter controls how finely the angular distribution is resolved. A higher value of sampling provides more detailed scattering information, which can be critical for accurately modeling the far-field pattern.

Example

You can use this method to compute the scattering properties of spherical particles, particularly in experiments where the polarization and scattering pattern of the light are important.

Example usage:

>>> s1s2 = scatterer.get_s1s2(sampling=500)
>>> print(s1s2.S1, s1s2.S2)
get_spf(sampling=200, distance=<Quantity(1, 'meter')>)#

Compute the scattering phase function (SPF) for the scatterer.

The scattering phase function describes how the intensity of scattered light varies as a function of the scattering angles ( theta ) (polar) and ( phi ) (azimuthal). It is a key quantity in light scattering, as it characterizes the angular distribution of scattered light.

The scattering phase function is computed as:

\[\text{SPF} = \sqrt{ E_{\parallel}(\phi, \theta)^2 + E_{\perp}(\phi, \theta)^2 }\]

Where:

  • ( E_{parallel} ): The parallel component of the scattered electric field.

  • ( E_{perp} ): The perpendicular component of the scattered electric field.

  • ( phi ) and ( theta ): The azimuthal and polar angles, respectively, which describe the angular position of the scattered light.

The SPF combines the intensity contributions from both polarization components to describe the total scattered intensity in different directions.

Parameters:
  • sampling (int) – The number of angular points used to sample the scattering phase function. A higher sampling value increases the angular resolution of the computed SPF.

  • distance (Quantity, optional) – The distance from the scatterer at which the scattering phase function is evaluated. By default, this is set to 1 meter, but it can be adjusted depending on the specific experimental configuration.

Returns:

An object containing the computed scattering phase function (SPF), representing the angular distribution of scattered light intensity.

Return type:

SPF

Notes

  • The scattering phase function is a critical quantity in the study of light scattering, as it provides insight into the directionality of the scattered light. It is commonly used in fields like atmospheric optics, biomedical imaging, and remote sensing.

  • The sampling parameter controls the angular resolution of the SPF. Higher sampling values yield more detailed scattering patterns, especially important when capturing small angular features.

Example

You can use this method to compute the scattering phase function of a spherical scatterer, helping to understand the angular distribution of light scattered by the particle.

Example usage:

>>> spf = scatterer.get_spf(sampling=500)
>>> print(spf)
get_stokes(sampling=200, distance=<Quantity(1, 'meter')>)#

Compute the four Stokes parameters: I, Q, U, and V, which describe the polarization state of scattered light.

The Stokes parameters provide a complete description of the polarization state of electromagnetic radiation, and are defined as follows:

\[\begin{split}I &= \big| E_x \big|^2 + \big| E_y \big|^2 \quad &\text{(total intensity)} \\ Q &= \big| E_x \big|^2 - \big| E_y \big|^2 \quad &\text{(linear polarization along x and y)} \\ U &= 2 \mathcal{Re} \big\{ E_x E_y^* \big\} \quad &\text{(linear polarization at +45° and -45°)} \\ V &= 2 \mathcal{Im} \big\{ E_x E_y^* \big\} \quad &\text{(circular polarization)}\end{split}\]

Where:

  • ( I ): Total intensity of the scattered light.

  • ( Q ): The degree of linear polarization along the x and y axes.

  • ( U ): The degree of linear polarization at +45° and -45° to the axes.

  • ( V ): The degree of circular polarization.

These parameters provide a powerful way to represent the full polarization state of the scattered light.

Parameters:
  • sampling (int) – The number of angular points used to sample the Stokes parameters. A higher sampling value increases the resolution of the computed polarization pattern.

  • distance (Quantity, optional) – The distance from the scatterer at which the Stokes parameters are evaluated. The default is 1 meter, but this can be adjusted based on the experimental setup.

Returns:

An object containing the computed Stokes parameters (I, Q, U, V), which describe the polarization state of the scattered light.

Return type:

Stokes

Notes

  • The Stokes parameters are essential for understanding and characterizing the polarization of scattered light. They are used in a wide variety of applications, including atmospheric optics, remote sensing, and optical communication.

  • The sampling parameter controls the angular resolution of the calculated Stokes parameters. Higher values provide finer detail, which can be important in accurately modeling polarization effects in scattering experiments.

Example

You can use this method to compute the Stokes parameters for a spherical scatterer, helping you analyze how the scatterer affects the polarization state of light.

Example usage:

>>> stokes_params = scatterer.get_stokes(sampling=500)
>>> print(stokes_params.I, stokes_params.Q, stokes_params.U, stokes_params.V)
medium_property: Quantity | BaseMaterial#
print_properties()#

Prints a table of the scatterer’s properties and their values.

Return type:

None

property: Quantity | BaseMaterial#
property_names = ['size_parameter', 'area', 'g', 'Qsca', 'Qext', 'Qabs', 'Csca', 'Cext', 'Cabs']#
set_binding()[source]#

Binds the Python representation of the cylinder to its C++ counterpart using provided properties.

Return type:

None

property size_parameter: Quantity#

Returns the size parameter of the scatterer.

source: BaseSource#
class CoreShell(*, source, medium_property, core_diameter, shell_thickness, core_property, shell_property)[source]#

Bases: BaseScatterer

Class representing a core/shell spherical scatterer.

Parameters:
  • core_diameter (Quantity) – Diameter of the core of the scatterer.

  • shell_thickness (Quantity) – Thickness of the shell surrounding the core.

  • core_property (Quantity | BaseMaterial) – Defines either the refractive index (Quantity) or material (BaseMaterial) of the scatterer’s core. Only one can be provided.

  • shell_property (Quantity | BaseMaterial) – Defines either the refractive index (Quantity) or material (BaseMaterial) of the scatterer’s shell. Only one can be provided.

  • source (BaseSource)

  • medium_property (Quantity | BaseMaterial)

property Cabs: Quantity#

Returns the absorption cross-section.

property Cback: Quantity#

Returns the backscattering cross-section.

property Cext: Quantity#

Returns the extinction cross-section.

property Cforward: Quantity#

Returns the forward-scattering cross-section.

property Cpr: Quantity#

Returns the radiation pressure cross-section.

property Cratio: Quantity#

Returns the ratio of backscattering cross-section over total scattering.

property Csca: Quantity#

Returns the scattering cross-section.

property Qabs: Quantity#

Returns the absorption efficiency.

property Qback: Quantity#

Returns the backscattering efficiency.

property Qext: Quantity#

Returns the extinction efficiency.

property Qforward: Quantity#

Returns the forward-scattering efficiency.

property Qpr: Quantity#

Returns the radiation pressure efficiency.

property Qratio: Quantity#

Returns the efficiency ratio of backscattering over total scattering.

property Qsca: Quantity#

Returns the scattering efficiency.

an(max_order=0)[source]#

Compute \(a_n\) coefficient.

If max_order is set to zero, the maximum order output is calculated using the Wiscombe criterion.

Parameters:

max_order (Optional[int])) – The maximum order of the coefficient. Default is 0.

Returns:

Array of \(a_n\) coefficients.

Return type:

numpy.ndarray

property area: Quantity#

Returns the area of the scatterer.

bn(max_order=0)[source]#

Compute \(b_n\) coefficient.

If max_order is set to zero, the maximum order output is calculated using the Wiscombe criterion.

Parameters:

max_order (Optional[int])) – The maximum order of the coefficient. Default is 0.

Returns:

Array of \(b_n\) coefficients.

Return type:

numpy.ndarray

core_diameter: Quantity#
core_property: Quantity | BaseMaterial#
property g: Quantity#

Returns the anisotropy factor.

get_far_field(sampling=200, distance=<Quantity(1, 'meter')>)#

Compute the far-field scattering pattern for the scatterer.

The far fields describe the behavior of the scattered electromagnetic waves at a large distance from the scatterer, where the waves can be approximated as planar. The computed far fields represent the scattered electric field components in the directions parallel and perpendicular to the plane of incidence.

The far fields are computed as:

\[\text{Fields} = E_{||}(\phi, \theta)^2, \, E_{\perp}(\phi, \theta)^2\]

These components represent the intensities of the scattered electric field in the parallel (( E_{||} )) and perpendicular (( E_{perp} )) directions as functions of the spherical angles ( phi ) (azimuthal) and ( theta ) (polar).

The fields are expressed up to a constant phase factor:

\[\exp{\left(-i k r \right)}\]

Where:

  • ( k ): The wave number, related to the wavelength of the incident light.

  • ( r ): The distance from the scatterer (assumed to be large in the far-field approximation).

Parameters:
  • sampling (int) – The number of angular points used to sample the far-field pattern. A higher sampling value increases the angular resolution of the computed far-field intensities.

  • distance (Quantity, optional) – The distance from the scatterer at which the far fields are evaluated. By default, this is set to 1 meter, but it can be adjusted to suit the specific experimental configuration.

Returns:

An object containing the computed far-field components (parallel and perpendicular intensities), which represent the angular distribution of the scattered light in the far field.

Return type:

FarField

Notes

  • The far-field approximation assumes that the distance from the scatterer is large enough that the curvature of the wavefronts can be neglected, and the fields can be treated as planar.

  • This method is useful for determining the angular distribution of the scattered light, which is critical in applications such as radar cross-section analysis, optical scattering experiments, and remote sensing.

Example

You can use this method to compute the far-field scattering pattern of a spherical scatterer, which is essential in understanding how the scatterer redirects light in the far field.

Example usage:

>>> far_field = scatterer.get_far_field(sampling=500)
>>> print(far_field.E_phi, far_field.E_theta)
get_farfields_array(phi, theta, r)#

Computes the scattering far field for unstructured coordinates.

The method computes the fields up to a constant phase value.

Parameters:
  • phi (numpy.ndarray) – The phi angles in radians.

  • theta (numpy.ndarray) – The theta angles in radians.

  • r (numpy.ndarray) – The radial distances.

  • Returns – Tuple[numpy.ndarray, numpy.ndarray]: The computed far fields.

Return type:

Tuple[ndarray, ndarray]

get_footprint(detector)#

Compute the footprint of the scattered light coupling with the detector.

The footprint represents the spatial distribution of the scattered light as it couples with the detector. This is important for understanding how the scattered light interacts with the detector’s field of view and is influenced by both the scatterer’s properties and the detector configuration.

The footprint is computed using an inverse Fourier transform:

\[\big| \mathscr{F}^{-1} \big\{ \tilde{ \psi } (\xi, \nu),\ \tilde{ \phi}_{l,m}(\xi, \nu) \big\} (\delta_x, \delta_y) \big|^2\]

Where:

  • ( tilde{ psi } (xi, nu) ): The Fourier transform of the scattered field.

  • ( tilde{ phi}_{l,m} (xi, nu) ): The Fourier transform of the detector’s capturing field.

  • ( mathscr{F}^{-1} ): The inverse Fourier transform operator.

  • ( (delta_x, delta_y) ): Spatial coordinates describing the footprint in the detector plane.

The inverse Fourier transform yields the spatial pattern of the scattered light’s interaction with the detector, which is then squared to compute the intensity of the footprint.

Parameters:

detector (GenericDetector) – The detector object that defines the capturing field and geometry. This object provides information about the detector’s configuration, including its numerical aperture, position, and sensitivity.

Returns:

An object containing the computed scatterer footprint, representing the spatial distribution of the scattered light on the detector plane.

Return type:

Footprint

Notes

  • The footprint provides valuable information about the coupling efficiency between the scattered light and the detector. This is useful in designing experiments where precise control of light detection is important, such as in microscopy, remote sensing, or optical measurements.

  • The interaction between the scattered field and the detector is influenced by factors such as the size, shape, and refractive index of the scatterer, as well as the detector’s aperture and positioning.

Example

You can use this method to compute the footprint of the scattered light on a detector, helping to visualize how light from the scatterer is spatially distributed on the detector.

Example usage:

>>> footprint = scatterer.get_footprint(detector=my_detector)
>>> print(footprint)
get_s1s2(sampling=200, distance=<Quantity(1, 'meter')>)#

Compute the S1 and S2 scattering amplitude functions for a spherical scatterer.

The S1 and S2 parameters represent the scattering amplitudes for perpendicular and parallel polarizations of light, respectively. These parameters are fundamental in Mie theory, which describes the scattering of electromagnetic waves by spherical particles.

The formulas for ( S_1 ) and ( S_2 ) are:

\[\begin{split}S_1 = \sum\limits_{n=1}^{n_{\text{max}}} \frac{2n+1}{n(n+1)} \left( a_n \pi_n + b_n \tau_n \right) \\ S_2 = \sum\limits_{n=1}^{n_{\text{max}}} \frac{2n+1}{n(n+1)} \left( a_n \tau_n + b_n \pi_n \right)\end{split}\]

Where:

  • ( a_n ) and ( b_n ): Mie coefficients, which depend on the size, shape, and refractive index of the scatterer.

  • ( pi_n ) and ( tau_n ): Angular functions related to the angular components of the incident and scattered fields.

  • ( n_{text{max}} ): Maximum number of terms in the series, determined by the size parameter of the scatterer.

These scattering amplitude functions are essential for calculating properties such as scattering phase functions, efficiencies, and angular distribution of scattered light.

Parameters:
  • sampling (int) – The number of angular points used to sample the S1 and S2 functions. Higher sampling improves the resolution of the scattering pattern but increases computation time.

  • distance (Quantity, optional) – The distance from the scatterer at which the S1 and S2 parameters are evaluated. This is typically set to 1 meter by default, but can be adjusted for specific setups.

Returns:

An object containing the computed S1 and S2 parameters, representing the scattering amplitudes for the two polarization components.

Return type:

S1S2

Notes

  • The S1 and S2 parameters are central to Mie scattering theory and are used to derive many important scattering properties, such as intensity distributions and polarization effects.

  • The sampling parameter controls how finely the angular distribution is resolved. A higher value of sampling provides more detailed scattering information, which can be critical for accurately modeling the far-field pattern.

Example

You can use this method to compute the scattering properties of spherical particles, particularly in experiments where the polarization and scattering pattern of the light are important.

Example usage:

>>> s1s2 = scatterer.get_s1s2(sampling=500)
>>> print(s1s2.S1, s1s2.S2)
get_spf(sampling=200, distance=<Quantity(1, 'meter')>)#

Compute the scattering phase function (SPF) for the scatterer.

The scattering phase function describes how the intensity of scattered light varies as a function of the scattering angles ( theta ) (polar) and ( phi ) (azimuthal). It is a key quantity in light scattering, as it characterizes the angular distribution of scattered light.

The scattering phase function is computed as:

\[\text{SPF} = \sqrt{ E_{\parallel}(\phi, \theta)^2 + E_{\perp}(\phi, \theta)^2 }\]

Where:

  • ( E_{parallel} ): The parallel component of the scattered electric field.

  • ( E_{perp} ): The perpendicular component of the scattered electric field.

  • ( phi ) and ( theta ): The azimuthal and polar angles, respectively, which describe the angular position of the scattered light.

The SPF combines the intensity contributions from both polarization components to describe the total scattered intensity in different directions.

Parameters:
  • sampling (int) – The number of angular points used to sample the scattering phase function. A higher sampling value increases the angular resolution of the computed SPF.

  • distance (Quantity, optional) – The distance from the scatterer at which the scattering phase function is evaluated. By default, this is set to 1 meter, but it can be adjusted depending on the specific experimental configuration.

Returns:

An object containing the computed scattering phase function (SPF), representing the angular distribution of scattered light intensity.

Return type:

SPF

Notes

  • The scattering phase function is a critical quantity in the study of light scattering, as it provides insight into the directionality of the scattered light. It is commonly used in fields like atmospheric optics, biomedical imaging, and remote sensing.

  • The sampling parameter controls the angular resolution of the SPF. Higher sampling values yield more detailed scattering patterns, especially important when capturing small angular features.

Example

You can use this method to compute the scattering phase function of a spherical scatterer, helping to understand the angular distribution of light scattered by the particle.

Example usage:

>>> spf = scatterer.get_spf(sampling=500)
>>> print(spf)
get_stokes(sampling=200, distance=<Quantity(1, 'meter')>)#

Compute the four Stokes parameters: I, Q, U, and V, which describe the polarization state of scattered light.

The Stokes parameters provide a complete description of the polarization state of electromagnetic radiation, and are defined as follows:

\[\begin{split}I &= \big| E_x \big|^2 + \big| E_y \big|^2 \quad &\text{(total intensity)} \\ Q &= \big| E_x \big|^2 - \big| E_y \big|^2 \quad &\text{(linear polarization along x and y)} \\ U &= 2 \mathcal{Re} \big\{ E_x E_y^* \big\} \quad &\text{(linear polarization at +45° and -45°)} \\ V &= 2 \mathcal{Im} \big\{ E_x E_y^* \big\} \quad &\text{(circular polarization)}\end{split}\]

Where:

  • ( I ): Total intensity of the scattered light.

  • ( Q ): The degree of linear polarization along the x and y axes.

  • ( U ): The degree of linear polarization at +45° and -45° to the axes.

  • ( V ): The degree of circular polarization.

These parameters provide a powerful way to represent the full polarization state of the scattered light.

Parameters:
  • sampling (int) – The number of angular points used to sample the Stokes parameters. A higher sampling value increases the resolution of the computed polarization pattern.

  • distance (Quantity, optional) – The distance from the scatterer at which the Stokes parameters are evaluated. The default is 1 meter, but this can be adjusted based on the experimental setup.

Returns:

An object containing the computed Stokes parameters (I, Q, U, V), which describe the polarization state of the scattered light.

Return type:

Stokes

Notes

  • The Stokes parameters are essential for understanding and characterizing the polarization of scattered light. They are used in a wide variety of applications, including atmospheric optics, remote sensing, and optical communication.

  • The sampling parameter controls the angular resolution of the calculated Stokes parameters. Higher values provide finer detail, which can be important in accurately modeling polarization effects in scattering experiments.

Example

You can use this method to compute the Stokes parameters for a spherical scatterer, helping you analyze how the scatterer affects the polarization state of light.

Example usage:

>>> stokes_params = scatterer.get_stokes(sampling=500)
>>> print(stokes_params.I, stokes_params.Q, stokes_params.U, stokes_params.V)
medium_property: Quantity | BaseMaterial#
print_properties()#

Prints a table of the scatterer’s properties and their values.

Return type:

None

property_names = ['size_parameter', 'area', 'g', 'Qsca', 'Qext', 'Qabs', 'Qback', 'Qratio', 'Qpr', 'Csca', 'Cext', 'Cabs', 'Cback', 'Cratio', 'Cpr']#
set_binding()[source]#

Bind the C++ scatterer class.

Return type:

None

shell_property: Quantity | BaseMaterial#
shell_thickness: Quantity#
property size_parameter: Quantity#

Returns the size parameter of the scatterer.

source: BaseSource#