Scatterers#

class Sphere#

Bases: BASESCATTERER

property Cabs#

Absorption cross-section of the scatterer.

\[C_{\text{abs}} &= Q_{\text{abs}} \cdot \text{area}\]

where area is the physical cross-sectional area of the scatterer.

Returns:

The absorption cross-section (Cabs) value, representing the area over which the scatterer absorbs light.

Return type:

float

property Cback#

Backscattering cross-section of the scatterer.

\[C_{\text{back}} &= Q_{\text{back}} \cdot \text{area}\]

where area is the physical cross-sectional area of the scatterer.

Returns:

The backscattering cross-section (Cback) value, representing the total scattering area for backward-scattered light.

Return type:

float

property Cext#

Extinction cross-section of the scatterer.

\[C_{\text{ext}} &= Q_{\text{ext}} \cdot \text{area}\]

where area is the physical cross-sectional area of the scatterer.

Returns:

The extinction cross-section (Cext) value, representing the total extinction, including scattering and absorption.

Return type:

float

property Cforward#

Forward-scattering cross-section of the scatterer.

\[C_{\text{forward}} &= Q_{\text{forward}} \cdot \text{area}\]

where area is the physical cross-sectional area of the scatterer.

Returns:

The forward-scattering cross-section (Cforward) value, representing the total scattering area for forward-scattered light.

Return type:

float

property Cpr#

Radiation pressure cross-section of the scatterer.

\[C_{\text{pr}} &= Q_{\text{pr}} \cdot \text{area}\]

where area is the physical cross-sectional area of the scatterer.

Returns:

The radiation pressure cross-section (Cpr) value, associated with the cross-sectional area for radiation pressure exerted on the scatterer.

Return type:

float

property Cratio#

The ratio of forward to backward scattering cross-section (Cforward/Cback) of the scatterer.

\[C_{\text{ratio}} &= \frac{C_{\text{forward}}}{C_{\text{back}}}\]

where Cforward is the forward scattering cross-section and Cback is the backward scattering cross-section.

Returns:

The ratio of forward to backward scattering cross-section (Cratio), which gives an indication of scattering asymmetry.

Return type:

float

property Csca#

Scattering cross-section of the scatterer.

\[C_{\text{sca}} &= Q_{\text{sca}} \cdot \text{area}\]

where area is the physical cross-sectional area of the scatterer.

Returns:

The scattering cross-section (Csca) value, which represents the total scattering area of the scatterer.

Return type:

float

property Qabs#

Absorption efficiency of the scatterer.

\[Q_{\text{abs}} &= Q_{\text{ext}} - Q_{\text{sca}}\]
Returns:

The absorption efficiency (Qabs) value, which characterizes the absorption of incident light by the scatterer.

Return type:

float

property Qback#

Backscattering efficiency of the scatterer.

\[Q_{\text{back}} &= \frac{1}{x^2} \left| \sum_{n=1}^{n_{\text{max}}} (2n+1)(-1)^n (a_n - b_n) \right|^2\]
Returns:

The backscattering efficiency (Qback) value, which characterizes the amount of light scattered in the backward direction.

Return type:

float

property Qext#

Extinction efficiency of the scatterer.

\[Q_{\text{ext}} &= \frac{2}{x^2} \sum_{n=1}^{n_{\text{max}}} (2n+1) \operatorname{Re}(a_n + b_n)\]
Returns:

The extinction efficiency (Qext) value, representing the combined effect of scattering and absorption.

Return type:

float

property Qforward#

Forward-scattering efficiency of the scatterer.

Returns:

The forward-scattering efficiency (Qforward) value, which characterizes the amount of light scattered in the forward direction.

Return type:

float

property Qpr#

Radiation pressure efficiency of the scatterer.

\[Q_{\text{pr}} &= Q_{\text{ext}} - g \cdot Q_{\text{sca}}\]
Returns:

The radiation pressure efficiency (Qpr) value, associated with the pressure exerted by the scattered light on the scatterer.

Return type:

float

property Qratio#

The ratio of forward to backward scattering efficiency (Qforward/Qback) of the scatterer.

\[Q_{\text{ratio}} &= \frac{Q_{\text{back}}}{Q_{\text{sca}}}\]
Returns:

The ratio of forward to backward scattering efficiency (Qratio), giving insight into the asymmetry of scattering.

Return type:

float

property Qsca#

Scattering efficiency of the scatterer.

\[Q_{\text{sca}} &= \frac{2}{x^2} \sum_{n=1}^{n_{\text{max}}} (2n+1)(|a_n|^2 + |b_n|^2)\]
Returns:

The scattering efficiency (Qsca) value, which characterizes the effectiveness of the scatterer in scattering incident light.

Return type:

float

property an#

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)

Returns:

A list of ‘an’ scattering coefficients used in the spherical wave expansion.

Return type:

list

Type:

Returns \(a_n\) coefficient as defined in Eq

property bn#

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)

Returns:

A list of ‘bn’ scattering coefficients used in the spherical wave expansion.

Return type:

list

Type:

Returns \(b_n\) coefficient as defined in Eq

property cn#

For future purpose only! Returns \(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)

Returns:

A list of ‘cn’ scattering coefficients used in the spherical wave expansion.

Return type:

list

compute_an_bn(self: PyMieSim.binary.interface_single.BASESCATTERER, max_order: SupportsInt = 0) None#

Computes the coefficients an and bn for the scatterer. :param max_order: The maximum order of the coefficients to compute (default is 0, which means it will be computed based on the size parameter). :type max_order: int, optional

compute_cn_dn(self: PyMieSim.binary.interface_single.BASESCATTERER, max_order: SupportsInt = 0) None#

Computes the coefficients cn and dn for the scatterer.

Parameters:

max_order (int, optional) – The maximum order of the coefficients to compute (default is 0, which means it will be computed based on the size parameter).

compute_incident_nearfields(self: PyMieSim.binary.interface_single.BASESCATTERER, x: object, y: object, z: object, field_type: str) object#

Computes incident near-field electromagnetic fields. This method calculates the incident electromagnetic fields at specified points using the properties of the incident wave. :param x: Array of x coordinates of observation points. :type x: numpy.ndarray :param y: Array of y coordinates of observation points. :type y: numpy.ndarray :param z: Array of z coordinates of observation points. :type z: numpy.ndarray :param field_type: Field component type: “Ex”, “Ey”, “Ez”, “|E|” :type field_type: str

Returns:

Complex array of field values at specified points.

Return type:

numpy.ndarray

Notes

This method does not depend on scatterer properties and computes fields based solely on the incident wave characteristics.

compute_nearfields_structured(self: PyMieSim.binary.interface_single.BASESCATTERER, x: collections.abc.Sequence[SupportsFloat], y: collections.abc.Sequence[SupportsFloat], z: collections.abc.Sequence[SupportsFloat], field_type: str) tuple[numpy.typing.NDArray[numpy.complex128], numpy.typing.NDArray[numpy.complex128], numpy.typing.NDArray[numpy.complex128], numpy.typing.NDArray[numpy.complex128], numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]]#

Computes near-field electromagnetic fields over a structured 3D grid.

This method efficiently computes electromagnetic fields over a regular 3D grid using the multipole expansion with vector spherical harmonics. More efficient than point-by-point computation for regular grids.

Parameters:
  • x (numpy.ndarray) – Array of x coordinates defining the grid.

  • y (numpy.ndarray) – Array of y coordinates defining the grid.

  • z (numpy.ndarray) – Array of z coordinates defining the grid.

  • field_type (str) – Field component type: “Ex”, “Ey”, “Ez”, “Hx”, “Hy”, “Hz”, “|E|”, “|H|

Returns:

Tuple containing: - Requested field component values (nx . ny . nz) as numpy.ndarray - Ex field component (nx . ny . nz) as numpy.ndarray - Ey field component (nx . ny . nz) as numpy.ndarray - Ez field component (nx . ny . nz) as numpy.ndarray - x coordinates (flattened) as numpy.ndarray - y coordinates (flattened) as numpy.ndarray - z coordinates (flattened) as numpy.ndarray

Return type:

tuple

Raises:
  • RuntimeError – If cn/dn coefficients are not available.

  • ValueError – If field_type is not recognized.

Notes

This method provides all field components for comprehensive analysis and visualization of near-field effects around the scatterer.

compute_scattered_nearfields(self: PyMieSim.binary.interface_single.BASESCATTERER, x: object, y: object, z: object, field_type: str) object#

Computes scattered near-field electromagnetic fields using an and bn coefficients.

This method calculates the scattered electromagnetic fields outside the scatterer using the multipole expansion with vector spherical harmonics. It uses an and bn coefficients for the computation.

Parameters:
  • x (numpy.ndarray) – Array of x coordinates of observation points.

  • y (numpy.ndarray) – Array of y coordinates of observation points.

  • z (numpy.ndarray) – Array of z coordinates of observation points.

  • field_type (str) – Field component type: “Ex”, “Ey”, “Ez”, “|E|

Returns:

Complex array of field values at specified points.

Return type:

numpy.ndarray

Raises:
  • RuntimeError – If an/bn coefficients are not available for the scatterer type.

  • ValueError – If field_type is not recognized.

Notes

This method requires that an and bn coefficients have been computed. Currently supports spherical scatterers only. Cylinder support requires implementation of an/bn coefficients for infinite cylinders.

compute_total_nearfields(self: PyMieSim.binary.interface_single.BASESCATTERER, x: object, y: object, z: object, field_type: str) object#

Computes near-field electromagnetic fields using internal coefficients cn and dn.

This method calculates the electromagnetic fields inside and near the scatterer using the multipole expansion with vector spherical harmonics. The internal fields (r < radius) are computed using cn and dn coefficients, while external fields (r > radius) use an and bn coefficients.

Parameters:
  • x (numpy.ndarray) – Array of x coordinates of observation points.

  • y (numpy.ndarray) – Array of y coordinates of observation points.

  • z (numpy.ndarray) – Array of z coordinates of observation points.

  • field_type (str) – Field component type: “Ex”, “Ey”, “Ez”, “Hx”, “Hy”, “Hz”, “|E|”, “|H|

Returns:

Complex array of field values at specified points.

Return type:

numpy.ndarray

Raises:
  • RuntimeError – If cn/dn coefficients are not available for the scatterer type.

  • ValueError – If field_type is not recognized.

Notes

This method requires that cn and dn coefficients have been computed. Currently supports spherical scatterers only. Cylinder support requires implementation of cn/dn coefficients for infinite cylinders.

property cross_section#

Physical cross-sectional area of the scatterer.

Returns:

The physical cross-sectional area (area) used in scattering calculations.

Return type:

float

property diameter#

Diameter of the sphere.

property dn#

For future purpose only! Returns \(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)

Returns:

A list of ‘dn’ scattering coefficients used in the spherical wave expansion.

Return type:

list

property g#

Asymmetry parameter of the scatterer.

\[g &= \frac{4}{Q_{\text{sca}} x^2} \left[ \sum_{n=1}^{n_{\text{max}}} \frac{n(n+2)}{n+1} \operatorname{Re}(a_n a_{n+1}^* + b_n b_{n+1}^*) + \sum_{n=1}^{n_{\text{max}}} \frac{2n+1}{n(n+1)} \operatorname{Re}(a_n b_n^*) \right]\]
Returns:

The asymmetry parameter (g) value, where g = 0 represents isotropic scattering.

Return type:

float

get_coefficient(self: PyMieSim.binary.interface_single.BASESCATTERER, type: str, order: SupportsInt) complex#

Returns a specific scattering coefficient for a given type and order.

Parameters:
  • type (str) – The type of coefficient (‘an’, ‘bn’, ‘cn’, ‘dn’).

  • order (int) – The order of the scattering coefficient.

Returns:

The value of the specified scattering coefficient.

Return type:

float

get_farfields(self: PyMieSim.binary.interface_single.BASESCATTERER, phi: object, theta: object, distance: object) tuple[numpy.typing.NDArray[numpy.complex128], numpy.typing.NDArray[numpy.complex128]]#

Returns the unstructured electromagnetic fields around the scatterer.

Parameters:
  • phi (float) – The azimuthal angle (in radians).

  • theta (float) – The polar angle (in radians).

  • distance (float) – The radial distance from the scatterer.

Returns:

A NumPy array containing the unstructured electromagnetic fields (E and H) around the scatterer.

Return type:

numpy.ndarray

get_full_farfields(self: PyMieSim.binary.interface_single.BASESCATTERER, sampling: SupportsInt, distance: object) tuple[object, object, numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]]#

Returns the full structured electromagnetic fields around the scatterer.

Parameters:
  • sampling (float) – The sampling rate used in the field calculation.

  • distance (float) – The radial distance from the scatterer.

Returns:

A NumPy array with the full structured electromagnetic fields around the scatterer.

Return type:

numpy.ndarray

get_s1s2(self: PyMieSim.binary.interface_single.BASESCATTERER, phi: object) tuple[numpy.typing.NDArray[numpy.complex128], numpy.typing.NDArray[numpy.complex128]]#

Calculates and returns the S1 and S2 scattering parameters.

Parameters:

phi (float) – The angle (in radians) at which the scattering is calculated.

Returns:

A tuple containing the S1 and S2 scattering parameters, which represent the scattering amplitudes for the incident and scattered waves.

Return type:

tuple

get_stokes_parameters(self: PyMieSim.binary.interface_single.BASESCATTERER, phi: object, theta: object, distance: object) tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]]#

Returns the unstructured Stokes parameters around the scatterer.

Parameters:
  • phi (float) – The azimuthal angle (in radians).

  • theta (float) – The polar angle (in radians).

  • distance (float) – The radial distance from the scatterer.

Returns:

A NumPy array with the unstructured Stokes parameters (I, Q, U, V) around the scatterer.

Return type:

tuple

property medium_refractive_index#

Refractive index of the surrounding medium.

print_properties(self: PyMieSim.binary.interface_single.Sphere, arg0: SupportsInt) None#

Prints the properties of the sphere.

property property_names#

Property names of the sphere.

property radius#

Radius of the sphere.

property refractive_index#

Refractive index of the sphere.

property size_parameter#

Size parameter of the scatterer.

The size parameter is defined as the ratio of the scatterer’s physical cross-section to the wavelength of incident light, scaled by the refractive index of the medium.

Returns:

The size parameter (size_parameter), typically the ratio of the scatterer’s diameter to the wavelength of incident light.

Return type:

float

property source#

Source of the sphere.

property volume#

Volume of the sphere.

class CoreShell#

Bases: BASESCATTERER

property Cabs#

Absorption cross-section of the scatterer.

\[C_{\text{abs}} &= Q_{\text{abs}} \cdot \text{area}\]

where area is the physical cross-sectional area of the scatterer.

Returns:

The absorption cross-section (Cabs) value, representing the area over which the scatterer absorbs light.

Return type:

float

property Cback#

Backscattering cross-section of the scatterer.

\[C_{\text{back}} &= Q_{\text{back}} \cdot \text{area}\]

where area is the physical cross-sectional area of the scatterer.

Returns:

The backscattering cross-section (Cback) value, representing the total scattering area for backward-scattered light.

Return type:

float

property Cext#

Extinction cross-section of the scatterer.

\[C_{\text{ext}} &= Q_{\text{ext}} \cdot \text{area}\]

where area is the physical cross-sectional area of the scatterer.

Returns:

The extinction cross-section (Cext) value, representing the total extinction, including scattering and absorption.

Return type:

float

property Cforward#

Forward-scattering cross-section of the scatterer.

\[C_{\text{forward}} &= Q_{\text{forward}} \cdot \text{area}\]

where area is the physical cross-sectional area of the scatterer.

Returns:

The forward-scattering cross-section (Cforward) value, representing the total scattering area for forward-scattered light.

Return type:

float

property Cpr#

Radiation pressure cross-section of the scatterer.

\[C_{\text{pr}} &= Q_{\text{pr}} \cdot \text{area}\]

where area is the physical cross-sectional area of the scatterer.

Returns:

The radiation pressure cross-section (Cpr) value, associated with the cross-sectional area for radiation pressure exerted on the scatterer.

Return type:

float

property Cratio#

The ratio of forward to backward scattering cross-section (Cforward/Cback) of the scatterer.

\[C_{\text{ratio}} &= \frac{C_{\text{forward}}}{C_{\text{back}}}\]

where Cforward is the forward scattering cross-section and Cback is the backward scattering cross-section.

Returns:

The ratio of forward to backward scattering cross-section (Cratio), which gives an indication of scattering asymmetry.

Return type:

float

property Csca#

Scattering cross-section of the scatterer.

\[C_{\text{sca}} &= Q_{\text{sca}} \cdot \text{area}\]

where area is the physical cross-sectional area of the scatterer.

Returns:

The scattering cross-section (Csca) value, which represents the total scattering area of the scatterer.

Return type:

float

property Qabs#

Absorption efficiency of the scatterer.

\[Q_{\text{abs}} &= Q_{\text{ext}} - Q_{\text{sca}}\]
Returns:

The absorption efficiency (Qabs) value, which characterizes the absorption of incident light by the scatterer.

Return type:

float

property Qback#

Backscattering efficiency of the scatterer.

\[Q_{\text{back}} &= \frac{1}{x^2} \left| \sum_{n=1}^{n_{\text{max}}} (2n+1)(-1)^n (a_n - b_n) \right|^2\]
Returns:

The backscattering efficiency (Qback) value, which characterizes the amount of light scattered in the backward direction.

Return type:

float

property Qext#

Extinction efficiency of the scatterer.

\[Q_{\text{ext}} &= \frac{2}{x^2} \sum_{n=1}^{n_{\text{max}}} (2n+1) \operatorname{Re}(a_n + b_n)\]
Returns:

The extinction efficiency (Qext) value, representing the combined effect of scattering and absorption.

Return type:

float

property Qforward#

Forward-scattering efficiency of the scatterer.

Returns:

The forward-scattering efficiency (Qforward) value, which characterizes the amount of light scattered in the forward direction.

Return type:

float

property Qpr#

Radiation pressure efficiency of the scatterer.

\[Q_{\text{pr}} &= Q_{\text{ext}} - g \cdot Q_{\text{sca}}\]
Returns:

The radiation pressure efficiency (Qpr) value, associated with the pressure exerted by the scattered light on the scatterer.

Return type:

float

property Qratio#

The ratio of forward to backward scattering efficiency (Qforward/Qback) of the scatterer.

\[Q_{\text{ratio}} &= \frac{Q_{\text{back}}}{Q_{\text{sca}}}\]
Returns:

The ratio of forward to backward scattering efficiency (Qratio), giving insight into the asymmetry of scattering.

Return type:

float

property Qsca#

Scattering efficiency of the scatterer.

\[Q_{\text{sca}} &= \frac{2}{x^2} \sum_{n=1}^{n_{\text{max}}} (2n+1)(|a_n|^2 + |b_n|^2)\]
Returns:

The scattering efficiency (Qsca) value, which characterizes the effectiveness of the scatterer in scattering incident light.

Return type:

float

property an#

Returns the ‘an’ scattering coefficients.

\[a_n = \frac{ \Psi_n (y) \left[ \dot{\Psi}_n (\tilde{m}_{2} y) - A_n (x) \dot{\xi}_n (\tilde{m}_{2} y) \right] - \tilde{m}_{2} \dot{\Psi}_n (y) \left[ \Psi_n (\tilde{m}_{2} y) - A_n (x) \xi_n (\tilde{m}_{2} y) \right] }{ \xi_n (y) \left[ \dot{\Psi}_n (\tilde{m}_{2} y) - A_n (x) \dot{\xi}_n (\tilde{m}_{2} y) \right] - \tilde{m}_{2} \dot{\xi}_n (y) \left[ \Psi_n (\tilde{m}_{2} y) - A_n (x) \xi_n (\tilde{m}_{2} y) \right] }\]

with:

\[\begin{split}A_n = \frac{ \tilde{m}_{2} \Psi_n (\tilde{m}_{2} x) \dot{\Psi}_n (\tilde{m}_{1} x) - \tilde{m}_{1} \dot{\Psi}_n (\tilde{m}_{2} x) \Psi_n (\tilde{m}_{1} x) }{ \tilde{m}_{2} \xi_n (\tilde{m}_{2} x) \dot{\Psi}_n (\tilde{m}_{1} x) - \tilde{m}_{1} \dot{\xi}_n (\tilde{m}_{2} x) \Psi_n (\tilde{m}_{1} x) } \\ B_n = \frac{ \tilde{m}_{2} \psi_n (\tilde{m}_{1} x) \dot{\psi}_n (\tilde{m}_{2} x) - \tilde{m}_{1} \psi_n (\tilde{m}_{2} x) \dot{\psi}_n (\tilde{m}_{1} x) }{ \tilde{m}_{2} \psi_n (\tilde{m}_{1} x) \dot{\xi}_n (\tilde{m}_{2} x) - \tilde{m}_{1} \xi_n (\tilde{m}_{2} x) \dot{\psi}_n (\tilde{m}_{1} x) }\end{split}\]
Returns:

A list of ‘an’ scattering coefficients used in the spherical wave expansion.

Return type:

list

property bn#

Returns the ‘bn’ scattering coefficients.

\[b_n = \frac{ \tilde{m}_{2} \Psi_n (y) \left[ \dot{\Psi}_n (\tilde{m}_{2} y) - B_n (x) \dot{\xi}_n (\tilde{m}_{2} y) \right] - \dot{\Psi}_n (y) \left[ \Psi_n (\tilde{m}_{2} y) - B_n (x) \xi_n (\tilde{m}_{2} y) \right] }{ \tilde{m}_{2} \xi_n (y) \left[ \dot{\Psi}_n (\tilde{m}_{2} y) - A_n (x) \dot{\xi}_n (\tilde{m}_{2} y) \right] - \dot{\xi}_n (y) \left[ \Psi_n (\tilde{m}_{2} y) - B_n (x) \xi_n (\tilde{m}_{2} y) \right] }\]

with:

\[\begin{split}A_n = \frac{ \tilde{m}_{2} \Psi_n (\tilde{m}_{2} x) \dot{\Psi}_n (\tilde{m}_{1} x) - \tilde{m}_{1} \dot{\Psi}_n (\tilde{m}_{2} x) \Psi_n (\tilde{m}_{1} x) }{ \tilde{m}_{2} \xi_n (\tilde{m}_{2} x) \dot{\Psi}_n (\tilde{m}_{1} x) - \tilde{m}_{1} \dot{\xi}_n (\tilde{m}_{2} x) \Psi_n (\tilde{m}_{1} x) } \\ B_n = \frac{ \tilde{m}_{2} \psi_n (\tilde{m}_{1} x) \dot{\psi}_n (\tilde{m}_{2} x) - \tilde{m}_{1} \psi_n (\tilde{m}_{2} x) \dot{\psi}_n (\tilde{m}_{1} x) }{ \tilde{m}_{2} \psi_n (\tilde{m}_{1} x) \dot{\xi}_n (\tilde{m}_{2} x) - \tilde{m}_{1} \xi_n (\tilde{m}_{2} x) \dot{\psi}_n (\tilde{m}_{1} x) }\end{split}\]
Returns:

A list of ‘bn’ scattering coefficients used in the spherical wave expansion.

Return type:

list

property cn#

Returns the ‘cn’ scattering coefficients.

Returns:

A list of ‘cn’ scattering coefficients used in the spherical wave expansion.

Return type:

list

compute_an_bn(self: PyMieSim.binary.interface_single.BASESCATTERER, max_order: SupportsInt = 0) None#

Computes the coefficients an and bn for the scatterer. :param max_order: The maximum order of the coefficients to compute (default is 0, which means it will be computed based on the size parameter). :type max_order: int, optional

compute_cn_dn(self: PyMieSim.binary.interface_single.BASESCATTERER, max_order: SupportsInt = 0) None#

Computes the coefficients cn and dn for the scatterer.

Parameters:

max_order (int, optional) – The maximum order of the coefficients to compute (default is 0, which means it will be computed based on the size parameter).

compute_incident_nearfields(self: PyMieSim.binary.interface_single.BASESCATTERER, x: object, y: object, z: object, field_type: str) object#

Computes incident near-field electromagnetic fields. This method calculates the incident electromagnetic fields at specified points using the properties of the incident wave. :param x: Array of x coordinates of observation points. :type x: numpy.ndarray :param y: Array of y coordinates of observation points. :type y: numpy.ndarray :param z: Array of z coordinates of observation points. :type z: numpy.ndarray :param field_type: Field component type: “Ex”, “Ey”, “Ez”, “|E|” :type field_type: str

Returns:

Complex array of field values at specified points.

Return type:

numpy.ndarray

Notes

This method does not depend on scatterer properties and computes fields based solely on the incident wave characteristics.

compute_nearfields_structured(self: PyMieSim.binary.interface_single.BASESCATTERER, x: collections.abc.Sequence[SupportsFloat], y: collections.abc.Sequence[SupportsFloat], z: collections.abc.Sequence[SupportsFloat], field_type: str) tuple[numpy.typing.NDArray[numpy.complex128], numpy.typing.NDArray[numpy.complex128], numpy.typing.NDArray[numpy.complex128], numpy.typing.NDArray[numpy.complex128], numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]]#

Computes near-field electromagnetic fields over a structured 3D grid.

This method efficiently computes electromagnetic fields over a regular 3D grid using the multipole expansion with vector spherical harmonics. More efficient than point-by-point computation for regular grids.

Parameters:
  • x (numpy.ndarray) – Array of x coordinates defining the grid.

  • y (numpy.ndarray) – Array of y coordinates defining the grid.

  • z (numpy.ndarray) – Array of z coordinates defining the grid.

  • field_type (str) – Field component type: “Ex”, “Ey”, “Ez”, “Hx”, “Hy”, “Hz”, “|E|”, “|H|

Returns:

Tuple containing: - Requested field component values (nx . ny . nz) as numpy.ndarray - Ex field component (nx . ny . nz) as numpy.ndarray - Ey field component (nx . ny . nz) as numpy.ndarray - Ez field component (nx . ny . nz) as numpy.ndarray - x coordinates (flattened) as numpy.ndarray - y coordinates (flattened) as numpy.ndarray - z coordinates (flattened) as numpy.ndarray

Return type:

tuple

Raises:
  • RuntimeError – If cn/dn coefficients are not available.

  • ValueError – If field_type is not recognized.

Notes

This method provides all field components for comprehensive analysis and visualization of near-field effects around the scatterer.

compute_scattered_nearfields(self: PyMieSim.binary.interface_single.BASESCATTERER, x: object, y: object, z: object, field_type: str) object#

Computes scattered near-field electromagnetic fields using an and bn coefficients.

This method calculates the scattered electromagnetic fields outside the scatterer using the multipole expansion with vector spherical harmonics. It uses an and bn coefficients for the computation.

Parameters:
  • x (numpy.ndarray) – Array of x coordinates of observation points.

  • y (numpy.ndarray) – Array of y coordinates of observation points.

  • z (numpy.ndarray) – Array of z coordinates of observation points.

  • field_type (str) – Field component type: “Ex”, “Ey”, “Ez”, “|E|

Returns:

Complex array of field values at specified points.

Return type:

numpy.ndarray

Raises:
  • RuntimeError – If an/bn coefficients are not available for the scatterer type.

  • ValueError – If field_type is not recognized.

Notes

This method requires that an and bn coefficients have been computed. Currently supports spherical scatterers only. Cylinder support requires implementation of an/bn coefficients for infinite cylinders.

compute_total_nearfields(self: PyMieSim.binary.interface_single.BASESCATTERER, x: object, y: object, z: object, field_type: str) object#

Computes near-field electromagnetic fields using internal coefficients cn and dn.

This method calculates the electromagnetic fields inside and near the scatterer using the multipole expansion with vector spherical harmonics. The internal fields (r < radius) are computed using cn and dn coefficients, while external fields (r > radius) use an and bn coefficients.

Parameters:
  • x (numpy.ndarray) – Array of x coordinates of observation points.

  • y (numpy.ndarray) – Array of y coordinates of observation points.

  • z (numpy.ndarray) – Array of z coordinates of observation points.

  • field_type (str) – Field component type: “Ex”, “Ey”, “Ez”, “Hx”, “Hy”, “Hz”, “|E|”, “|H|

Returns:

Complex array of field values at specified points.

Return type:

numpy.ndarray

Raises:
  • RuntimeError – If cn/dn coefficients are not available for the scatterer type.

  • ValueError – If field_type is not recognized.

Notes

This method requires that cn and dn coefficients have been computed. Currently supports spherical scatterers only. Cylinder support requires implementation of cn/dn coefficients for infinite cylinders.

property core_diameter#

Diameter of the core shell.

property core_refractive_index#

Refractive index of the core shell.

property cross_section#

Physical cross-sectional area of the scatterer.

Returns:

The physical cross-sectional area (area) used in scattering calculations.

Return type:

float

property dn#

Returns the ‘dn’ scattering coefficients.

Returns:

A list of ‘dn’ scattering coefficients used in the spherical wave expansion.

Return type:

list

property g#

Asymmetry parameter of the scatterer.

\[g &= \frac{4}{Q_{\text{sca}} x^2} \left[ \sum_{n=1}^{n_{\text{max}}} \frac{n(n+2)}{n+1} \operatorname{Re}(a_n a_{n+1}^* + b_n b_{n+1}^*) + \sum_{n=1}^{n_{\text{max}}} \frac{2n+1}{n(n+1)} \operatorname{Re}(a_n b_n^*) \right]\]
Returns:

The asymmetry parameter (g) value, where g = 0 represents isotropic scattering.

Return type:

float

get_coefficient(self: PyMieSim.binary.interface_single.BASESCATTERER, type: str, order: SupportsInt) complex#

Returns a specific scattering coefficient for a given type and order.

Parameters:
  • type (str) – The type of coefficient (‘an’, ‘bn’, ‘cn’, ‘dn’).

  • order (int) – The order of the scattering coefficient.

Returns:

The value of the specified scattering coefficient.

Return type:

float

get_farfields(self: PyMieSim.binary.interface_single.BASESCATTERER, phi: object, theta: object, distance: object) tuple[numpy.typing.NDArray[numpy.complex128], numpy.typing.NDArray[numpy.complex128]]#

Returns the unstructured electromagnetic fields around the scatterer.

Parameters:
  • phi (float) – The azimuthal angle (in radians).

  • theta (float) – The polar angle (in radians).

  • distance (float) – The radial distance from the scatterer.

Returns:

A NumPy array containing the unstructured electromagnetic fields (E and H) around the scatterer.

Return type:

numpy.ndarray

get_full_farfields(self: PyMieSim.binary.interface_single.BASESCATTERER, sampling: SupportsInt, distance: object) tuple[object, object, numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]]#

Returns the full structured electromagnetic fields around the scatterer.

Parameters:
  • sampling (float) – The sampling rate used in the field calculation.

  • distance (float) – The radial distance from the scatterer.

Returns:

A NumPy array with the full structured electromagnetic fields around the scatterer.

Return type:

numpy.ndarray

get_s1s2(self: PyMieSim.binary.interface_single.BASESCATTERER, phi: object) tuple[numpy.typing.NDArray[numpy.complex128], numpy.typing.NDArray[numpy.complex128]]#

Calculates and returns the S1 and S2 scattering parameters.

Parameters:

phi (float) – The angle (in radians) at which the scattering is calculated.

Returns:

A tuple containing the S1 and S2 scattering parameters, which represent the scattering amplitudes for the incident and scattered waves.

Return type:

tuple

get_stokes_parameters(self: PyMieSim.binary.interface_single.BASESCATTERER, phi: object, theta: object, distance: object) tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]]#

Returns the unstructured Stokes parameters around the scatterer.

Parameters:
  • phi (float) – The azimuthal angle (in radians).

  • theta (float) – The polar angle (in radians).

  • distance (float) – The radial distance from the scatterer.

Returns:

A NumPy array with the unstructured Stokes parameters (I, Q, U, V) around the scatterer.

Return type:

tuple

print_properties(self: PyMieSim.binary.interface_single.CoreShell, arg0: SupportsInt) None#

Prints the properties of the core-shell scatterer.

property property_names#

Property names of the core-shell scatterer.

property radius#

Overall radius of the core-shell scatterer.

property shell_refractive_index#

Refractive index of the shell.

property shell_thickness#

Thickness of the shell.

property size_parameter#

Size parameter of the scatterer.

The size parameter is defined as the ratio of the scatterer’s physical cross-section to the wavelength of incident light, scaled by the refractive index of the medium.

Returns:

The size parameter (size_parameter), typically the ratio of the scatterer’s diameter to the wavelength of incident light.

Return type:

float

property source#

Source of the core-shell scatterer.

property volume#

Volume of the core-shell scatterer.