Detectors#

class Photodiode(NA, gamma_offset, phi_offset, cache_NA=<Quantity([0.], 'dimensionless')>, sampling=<Quantity([200], 'dimensionless')>, polarization_filter=<Quantity([nan], 'degree')>)[source]#

Bases: BaseDetector

Photodiode detector tailored for Mie scattering simulations, extending BaseDetector with specific features.

Parameters:
  • NA (Union[List[float], float]) – Numerical aperture(s) of the detector.

  • gamma_offset (Quantity) – Gamma angular offset (in degrees).

  • phi_offset (Quantity) – Phi angular offset (in degrees).

  • polarization_filter (Optional[Quantity]) – Polarization filter angle (in degrees).

  • sampling (Union[List[int], int]) – Sampling rate(s) for the detector.

  • mean_coupling (bool) – Whether mean coupling is used. Defaults to True.

  • rotation (Quantity) – Rotation angle of the detector. Defaults to 0 degrees.

  • coherent (bool) – Indicates if the detection is coherent. Defaults to False.

  • mode_number (str) – Mode number of the detector. Defaults to ‘NC00’.

  • cache_NA (Quantity)

NA: Quantity#
cache_NA: Quantity = <Quantity([0.], 'dimensionless')>#
coherent: bool = False#
gamma_offset: Quantity#
mean_coupling: bool = False#
mode_number: Tuple[str]#
phi_offset: Quantity#
polarization_filter: Quantity | None | None = <Quantity([nan], 'degree')>#
rotation: Quantity = <Quantity([0], 'degree')>#
sampling: Quantity | None = <Quantity([200], 'dimensionless')>#
classmethod validate_angle_quantity(value)#

Ensures that angular quantities (gamma_offset, phi_offset, rotation) are correctly formatted as Quantities with angle units.

Parameters:

value (Any) – The input value for the angle.

Returns:

A NumPy array containing the validated and converted angle value.

Return type:

np.ndarray

classmethod validate_au_quantity(value)#

Ensures that numerical values such as numerical aperture (NA) and sampling rate are correctly cast into NumPy arrays.

Parameters:

value (Any) – The input value to be validated.

Returns:

A NumPy array representing the validated input value.

Return type:

np.ndarray

classmethod validate_polarization(value)#

Validates the polarization filter. If not provided, defaults to NaN degrees. Ensures the value has angular units (degree or radian).

Parameters:

value (Any) – The input value for polarization filter.

Returns:

A NumPy array containing the validated and converted polarization filter value.

Return type:

np.ndarray

class CoherentMode(mode_number, NA, gamma_offset, phi_offset, rotation=<Quantity(900, 'degree')>, mean_coupling=False, cache_NA=<Quantity([0.], 'dimensionless')>, sampling=<Quantity([200], 'dimensionless')>, polarization_filter=<Quantity([nan], 'degree')>)[source]#

Bases: BaseDetector

Coherent mode detector for Mie scattering simulations, handling coherent detection modes.

This detector is designed specifically for coherent modes, such as LP, HG, LG, and NC modes, which require specific handling in Mie scattering experiments.

Parameters:
  • mode_number (Union[List[str], str]) – Mode number(s) involved in the detection.

  • NA (Union[List[float], float]) – Numerical aperture(s) of the detector.

  • gamma_offset (Quantity) – Gamma angular offset (in degrees).

  • phi_offset (Quantity) – Phi angular offset (in degrees).

  • rotation (Quantity) – Rotation angle of the detector.

  • sampling (Union[List[int], int]) – Sampling rate(s) for the detector.

  • polarization_filter (Optional[Quantity]) – Polarization filter angle (in degrees).

  • mean_coupling (Optional[bool]) – Whether mean coupling is used. Defaults to False.

  • coherent (bool) – Specifies if the detection is coherent. Defaults to True.

  • cache_NA (Quantity)

NA: Quantity#
cache_NA: Quantity = <Quantity([0.], 'dimensionless')>#
coherent: bool = True#
gamma_offset: Quantity#
mean_coupling: bool | None = False#
mode_number: List[str] | str#
phi_offset: Quantity#
polarization_filter: Quantity | None = <Quantity([nan], 'degree')>#
rotation: Quantity = <Quantity(900, 'degree')>#
sampling: Quantity | None = <Quantity([200], 'dimensionless')>#
classmethod validate_angle_quantity(value)#

Ensures that angular quantities (gamma_offset, phi_offset, rotation) are correctly formatted as Quantities with angle units.

Parameters:

value (Any) – The input value for the angle.

Returns:

A NumPy array containing the validated and converted angle value.

Return type:

np.ndarray

classmethod validate_au_quantity(value)#

Ensures that numerical values such as numerical aperture (NA) and sampling rate are correctly cast into NumPy arrays.

Parameters:

value (Any) – The input value to be validated.

Returns:

A NumPy array representing the validated input value.

Return type:

np.ndarray

classmethod validate_polarization(value)#

Validates the polarization filter. If not provided, defaults to NaN degrees. Ensures the value has angular units (degree or radian).

Parameters:

value (Any) – The input value for polarization filter.

Returns:

A NumPy array containing the validated and converted polarization filter value.

Return type:

np.ndarray