Experiment module#
Sources#
- class GaussianSet#
Bases:
BaseSourceSet- property attributes#
- static build_sequential(target_size: SupportsInt | SupportsIndex, wavelength: object, polarization: object, numerical_aperture: object, optical_power: object) PyMieSim.experiment.source_set.GaussianSet#
Construct a sequential GaussianSourceSet by broadcasting scalar or single element inputs.
- Parameters:
target_size (int or None) – Target size for broadcasting. If None, uses the maximum size among wavelength, numerical_aperture, optical_power.
wavelength (Quantity or array-like Quantity) – Wavelength(s). Scalars or length 1 arrays broadcast to total_size.
polarization (PolarizationSet) – Must have number_of_states equal to 1 or total_size.
numerical_aperture (Quantity or array-like Quantity) – Numerical aperture(s). Scalars or length 1 arrays broadcast to total_size.
optical_power (Quantity or array-like Quantity) – Optical power(s). Scalars or length 1 arrays broadcast to total_size.
- Returns:
Instance with is_sequential = True.
- Return type:
GaussianSourceSet
- get_mapping(self: PyMieSim.experiment.source_set.GaussianSet) dict#
Generates a mapping of source attributes to their corresponding values for the GaussianSourceSet instance. The mapping includes keys such as ‘source:wavelength’, ‘source:polarization’, ‘source:numerical_aperture’, and ‘source:optical_power’.
- property numerical_aperture#
Returns the numerical apertures of the Gaussian source set as a NumPy array with appropriate units.
- property optical_power#
Returns the optical powers of the Gaussian source set as a NumPy array with appropriate units.
- property wavelength#
Returns the wavelengths of the Gaussian source set as a NumPy array with appropriate units.
- class PlaneWaveSet#
Bases:
BaseSourceSetSet of plane-wave source definitions.
A
PlaneWaveSetstores one or more plane-wave configurations defined by wavelength, polarization, and field amplitude.- property amplitude#
Returns the amplitudes of the plane wave source set as a NumPy array with appropriate units.
- property attributes#
- static build_sequential(target_size: SupportsInt | SupportsIndex, wavelength: object, polarization: object, amplitude: object) PyMieSim.experiment.source_set.PlaneWaveSet#
Construct a sequential PlaneWaveSourceSet by broadcasting scalar or single element inputs.
- Parameters:
target_size (int) – Target size for broadcasting.
wavelength (Quantity or array-like Quantity) – Wavelength(s). Scalars or length 1 arrays broadcast to target_size.
polarization (PolarizationSet) – Must have number_of_states equal to 1 or target_size.
amplitude (Quantity or array-like Quantity) – Amplitude(s). Scalars or length 1 arrays broadcast to total_size.
- Returns:
Instance with is_sequential = True.
- Return type:
PlaneWaveSourceSet
- get_mapping(self: PyMieSim.experiment.source_set.PlaneWaveSet) dict#
Generates a mapping of source attributes to their corresponding values for the PlaneWaveSourceSet instance. The mapping includes keys such as ‘source:wavelength’, ‘source:polarization’, and ‘source:amplitude’.
- property wavelength#
Returns the wavelengths of the plane wave source set as a NumPy array with appropriate units.
Scatterers#
- class CoreShellSet#
Bases:
BaseScattererSet- attributes = ['core_diameter', 'shell_thickness', 'core_material', 'shell_material', 'medium']#
- available_measure_list = ['Qsca', 'Qext', 'Qabs', 'Qratio', 'Qforward', 'Qback', 'Qpr', 'Csca', 'Cext', 'Cabs', 'Cratio', 'Cforward', 'Cback', 'Cpr', 'a1', 'a2', 'a3', 'b1', 'b2', 'b3', 'g', 'coupling']#
- static build_sequential(target_size: SupportsInt | SupportsIndex, core_diameter: object, shell_thickness: object, core_material: object, shell_material: object, medium: object) PyMieSim.experiment.scatterer_set.CoreShellSet#
Construct a sequential CoreShellSet by broadcasting scalar or single element inputs.
- Parameters:
target_size (int or None) – Target size for broadcasting. If None, uses the size of the core_diameter vector after conversion.
core_diameter (Quantity or array-like Quantity) – Diameter(s) of the core. Scalars or length 1 arrays broadcast to target_size.
shell_thickness (Quantity or array-like Quantity) – Thickness(es) of the shell. Scalars or length 1 arrays broadcast to target_size.
core_material (List[BaseMaterial] | List[RefractiveIndex]) – Refractive index or indices of the core.
shell_material (List[BaseMaterial] | List[RefractiveIndex]) – Refractive index or indices of the shell.
medium (List, optional) – BaseMaterial(s) defining the medium, used if medium_index is not provided.
- Returns:
Instance with is_sequential = True.
- Return type:
- property core_diameter#
- property core_material#
- get_mapping(self: PyMieSim.experiment.scatterer_set.CoreShellSet) dict#
Generates a mapping of scatterer attributes to their corresponding values for the CoreShellSet instance. The mapping includes keys such as ‘scatterer:core_diameter’, ‘scatterer:shell_thickness’, ‘scatterer:core_material’, ‘scatterer:shell_material’, and ‘scatterer:medium’.
- property medium#
- property shell_material#
- property shell_thickness#
- class InfiniteCylinderSet#
Bases:
BaseScattererSet- attributes = ['diameter', 'material', 'medium']#
- available_measure_list = ['Qsca', 'Qext', 'Qabs', 'Csca', 'Cext', 'Cabs', 'a11', 'a21', 'a12', 'a22', 'a13', 'a23', 'b11', 'b21', 'b12', 'b22', 'b13', 'b23', 'coupling']#
- static build_sequential(target_size: SupportsInt | SupportsIndex, diameter: object, material: object, medium: object) PyMieSim.experiment.scatterer_set.InfiniteCylinderSet#
Construct a sequential InfiniteCylinderSet by broadcasting scalar or single element inputs.
- Parameters:
target_size (int or None) – Target size for broadcasting. If None, uses the size of the diameter vector after conversion.
diameter (Quantity or array-like Quantity) – Diameter(s) of the cylinders. Scalars or length 1 arrays broadcast to target_size.
material (List[BaseMaterial] | List[RefractiveIndex]) – Refractive index or indices of the cylindrical scatterers themselves.
medium (List, optional) – BaseMaterial(s) defining the medium, used if medium_index is not provided.
- Returns:
Instance with is_sequential = True.
- Return type:
- property diameter#
- get_mapping(self: PyMieSim.experiment.scatterer_set.InfiniteCylinderSet) dict#
Generates a mapping of scatterer attributes to their corresponding values for the InfiniteCylinderSet instance. The mapping includes keys such as ‘scatterer:diameter’, ‘scatterer:refractive_index’, and ‘scatterer:medium_refractive_index’.
- property material#
- property medium#
- class SphereSet#
Bases:
BaseScattererSet- attributes = ['diameter', 'material', 'medium']#
- available_measure_list = ['Qsca', 'Qext', 'Qabs', 'Qratio', 'Qforward', 'Qback', 'Qpr', 'Csca', 'Cext', 'Cabs', 'Cratio', 'Cforward', 'Cback', 'Cpr', 'a1', 'a2', 'a3', 'b1', 'b2', 'b3', 'g', 'coupling']#
- static build_sequential(target_size: SupportsInt | SupportsIndex, diameter: object, material: object, medium: object) PyMieSim.experiment.scatterer_set.SphereSet#
Construct a sequential SphereSet by broadcasting scalar or single element inputs.
- Parameters:
target_size (int) – Target size for broadcasting. If None, uses the size of the diameter vector after conversion.
diameter (Quantity or array-like Quantity) – Diameter(s) of the spheres. Scalars or length 1 arrays broadcast to target_size.
material (List[BaseMaterial] | List[RefractiveIndex]) – Refractive index or indices of the spherical scatterers themselves.
medium (List, optional) – BaseMaterial(s) defining the medium, used if medium_index is not provided.
- Returns:
Instance with is_sequential = True.
- Return type:
- property diameter#
- get_mapping(self: PyMieSim.experiment.scatterer_set.SphereSet) dict#
Generates a mapping of scatterer attributes to their corresponding values for the SphereSet instance. The mapping includes keys such as ‘scatterer:diameter’, ‘scatterer:material’, and ‘scatterer:medium’.
- property material#
- property medium#
Detectors#
- class CoherentModeSet#
Bases:
BaseDetectorSetSet of coherent mode detectors.
A
CoherentModeSetstores one or more detectors used for coherent mode coupling calculations. Each detector is defined by its mode label, numerical aperture, angular offsets, rotation, optional polarization filtering, and surrounding medium.- attributes = ['mode_numbers', 'sampling', 'numerical_aperture', 'cache_numerical_aperture', 'phi_offset', 'gamma_offset', 'polarization_filter', 'rotation', 'medium']#
- static build_sequential(target_size: typing.SupportsInt | typing.SupportsIndex, mode_number: object, numerical_aperture: object, phi_offset: object, gamma_offset: object, rotation: object, cache_numerical_aperture: object = 0.0, sampling: object = 200, polarization_filter: object = <PolarizationState empty=True>, medium: object = <ConstantMedium refractive_index=1>, mean_coupling: bool = False) PyMieSim.experiment.detector_set.CoherentModeSet#
Build a sequential coherent mode detector set.
Scalar inputs or length one arrays are broadcast to
target_size. Any non scalar input must already have lengthtarget_size.- Parameters:
target_size (int) – Number of detectors in the sequential set.
mode_number (str or array-like of str) – Mode label or labels defining the collected coherent mode.
numerical_aperture (float or array-like of float) – Numerical aperture of each detector.
phi_offset (Angle or array-like of Angle) – Azimuthal offset of each detector.
gamma_offset (Angle or array-like of Angle) – Polar offset of each detector.
rotation (Angle or array-like of Angle) – Rotation of the detector mode basis.
cache_numerical_aperture (float or array-like of float, optional) – Numerical aperture used for cached field evaluation. Default is
0.0.sampling (int or array-like of int, optional) – Number of angular sampling points used to evaluate each detector. Default is
200.polarization_filter (Angle or array-like of Angle, optional) – Polarization analyzer angle. If
None, the filter is disabled for all detectors.medium (BaseMedium, MediumSet, float, or array-like, optional) – Surrounding medium. This can be provided either as medium objects or as refractive index values. Default is
ConstantMedium(1.0).mean_coupling (bool, optional) – If
True, use mean coupling rather than mode resolved coupling. Default isFalse.
- Returns:
Detector set with
is_sequential = True.- Return type:
- property cache_numerical_aperture#
Cached numerical aperture associated with each detector.
- property coherent#
Flag indicating that this detector set performs coherent detection.
- property gamma_offset#
Polar offset of each detector.
- get_mapping(self: PyMieSim.experiment.detector_set.CoherentModeSet) dict#
Return detector parameters as a dictionary.
The returned mapping is formatted for PyMieSim parameter tracking and dataframe generation. Keys follow the
detector:<parameter_name>convention.
- property mean_coupling#
Whether mean coupling is used.
- property medium#
Surrounding medium associated with the detector set.
- property mode_numbers#
Mode labels associated with each detector.
- property numerical_aperture#
Numerical aperture of each detector.
- property phi_offset#
Azimuthal offset of each detector.
- property polarization_filter#
Polarization filter angle for each detector.
Returns
Nonewhen no polarization filter is defined.
- property rotation#
Rotation of the detector mode basis.
- property sampling#
Sampling point count for each detector.
- class PhotodiodeSet#
Bases:
BaseDetectorSetSet of photodiode detectors.
A
PhotodiodeSetstores one or more intensity based detectors defined by their numerical aperture, angular offsets, sampling, optional polarization filtering, and surrounding medium.- attributes = ['sampling', 'numerical_aperture', 'cache_numerical_aperture', 'phi_offset', 'gamma_offset', 'polarization_filter', 'medium']#
- static build_sequential(target_size: typing.SupportsInt | typing.SupportsIndex, numerical_aperture: object, phi_offset: object, gamma_offset: object, sampling: object = 200, cache_numerical_aperture: object = 0.0, polarization_filter: object = <PolarizationState empty=True>, medium: object = <ConstantMedium refractive_index=1>, angular_weights: object = None) PyMieSim.experiment.detector_set.PhotodiodeSet#
Build a sequential photodiode detector set.
Scalar inputs or length one arrays are broadcast to
target_size. Any non scalar input must already have lengthtarget_size.- Parameters:
target_size (int) – Number of detectors in the sequential set.
numerical_aperture (float or array-like of float) – Numerical aperture of each detector.
phi_offset (Angle or array-like of Angle) – Azimuthal offset of each detector.
gamma_offset (Angle or array-like of Angle) – Polar offset of each detector.
sampling (int or array-like of int, optional) – Number of angular sampling points used to evaluate each detector. Default is
200.cache_numerical_aperture (float or array-like of float, optional) – Numerical aperture used for cached field evaluation. Default is
0.0.polarization_filter (Angle or array-like of Angle, optional) – Polarization analyzer angle. If
None, the filter is disabled for all detectors.medium (BaseMedium, MediumSet, float, or array-like, optional) – Surrounding medium. This can be provided either as medium objects or as refractive index values. Default is
ConstantMedium(1.0).angular_weights (array-like, optional) – Explicit complex angular weight vectors for each sequential detector. This can be a single one-dimensional array shared by all detectors, a two-dimensional array of shape
(target_size, sampling), or a list of one-dimensional arrays when detector sampling varies by sequential index.
- Returns:
Detector set with
is_sequential = True.- Return type:
- property cache_numerical_aperture#
Cached numerical aperture associated with each detector.
- property gamma_offset#
Polar offset of each detector.
- get_mapping(self: PyMieSim.experiment.detector_set.PhotodiodeSet) dict#
Return detector parameters as a dictionary.
The returned mapping is formatted for PyMieSim parameter tracking and dataframe generation. Keys follow the
detector:<parameter_name>convention.
- property numerical_aperture#
Numerical aperture of each detector.
- property phi_offset#
Azimuthal offset of each detector.
- property sampling#
Sampling point count for each detector.
Polarization#
- class PolarizationSet#
Bases:
pybind11_objectOrdered collection of polarization states.
A
PolarizationSetcan be created either from polarization angles or from Jones vectors. It is used throughout the experiment API to describe one or more analyzer or source polarization states.