:orphan: .. _experiment_index: Experiment Module ================= The Experiment module in PyMieSim provides the foundational tools to simulate complex optical scattering experiments. It enables users to define custom setups by specifying sources, detectors, and scatterers. This modular approach allows for the simulation of diverse configurations ranging from single scatterers to complex, multi-source systems. Key Components -------------- 1. **Sources**: The experiment requires a light source, and PyMieSim supports various source types including plane waves, Gaussian beams. Each source can be configured with parameters such as wavelength, polarization, amplitude, providing flexibility for different simulation needs. - `planewave`: Simulates a uniform plane wave, commonly used in scattering experiments. - `gaussian`: Simulates a Gaussian beam source, useful for focused beam studies. 2. **Scatterers**: This component defines the particle or object that interacts with the light. The module supports different shapes and material configurations such as spheres, core-shell particles, and cylinders, allowing for customizable scattering scenarios. - `sphere`: Defines a spherical scatterer, the most common shape in Mie scattering theory. - `cylinder`: Allows for the study of cylindrical scatterers, which are useful for simulating fibers or other elongated structures. - `core_shell`: Supports core-shell structures, enabling the study of particles with layered materials. 3. **Detectors**: PyMieSim allows the placement of detectors around the scatterer to capture scattered light at various angles. These detectors can measure properties like intensity, polarization, and coherence. - `photodiode`: Simulates a basic detector to measure intensity. - `coherent_mode`: Captures information related to the coherence properties of the scattered field. - `integrating_sphere`: Simulates an integrating sphere detector, commonly used to measure total scattered light in all directions. 4. **Experiment Setup**: The module allows you to combine the source, scatterer, and detector into a complete experimental setup. You can simulate the interaction of light with the scatterer and capture the resulting scattered light using the specified detector. Example Usage ------------- Below is an example of how to set up a basic experiment using the `experiment` module: .. code-block:: python from PyMieSim.experiment.scatterer import Sphere from PyMieSim.experiment.source import Gaussian from PyMieSim.experiment import Setup from PyMieSim.units import nanometer, degree, watt, AU, RIU source = Gaussian( wavelength=[500., 1000., 1500.] * nanometer, polarization=30. * degree, optical_power=1e-3 * watt, NA=0.2 * AU ) scatterer = Sphere( diameter=800. * nanometer, property=np.linspace(1.3, 1.9, 150) * RIU, medium_property=1. * RIU, source=source ) experiment = Setup(scatterer=scatterer, source=source) dataframe = experiment.get('Qsca') dataframe.plot_data(x="scatterer:property") The `Experiment` module simplifies the process of creating and running scattering simulations, providing a streamlined workflow for exploring complex optical interactions. .. raw:: html
.. thumbnail-parent-div-open .. thumbnail-parent-div-close .. raw:: html
Core-Shell ~~~~~~~~~~ .. raw:: html
.. thumbnail-parent-div-open .. raw:: html
.. only:: html .. image:: /gallery/experiment/coreshell/images/thumb/sphx_glr_coreshell_Qback_vs_corediameter_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_coreshell_coreshell_Qback_vs_corediameter.py` .. raw:: html
CoreShell: Qback vs Core Diameter
.. raw:: html
.. only:: html .. image:: /gallery/experiment/coreshell/images/thumb/sphx_glr_coreshell_a1_vs_corediameter_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_coreshell_coreshell_a1_vs_corediameter.py` .. raw:: html
CoreShell: An vs Core Diameter
.. raw:: html
.. only:: html .. image:: /gallery/experiment/coreshell/images/thumb/sphx_glr_coreshell_b1_vs_corediameter_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_coreshell_coreshell_b1_vs_corediameter.py` .. raw:: html
CoreShell: B1 vs Core Diameter
.. raw:: html
.. only:: html .. image:: /gallery/experiment/coreshell/images/thumb/sphx_glr_coreshell_coupling_vs_corediameter_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_coreshell_coreshell_coupling_vs_corediameter.py` .. raw:: html
CoreShell: Coupling vs Diameter
.. raw:: html
.. only:: html .. image:: /gallery/experiment/coreshell/images/thumb/sphx_glr_coreshell_coupling_vs_na_cache_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_coreshell_coreshell_coupling_vs_na_cache.py` .. raw:: html
CoreShell: Coupling vs Diameter
.. thumbnail-parent-div-close .. raw:: html
Cylinder ~~~~~~~~ .. raw:: html
.. thumbnail-parent-div-open .. raw:: html
.. only:: html .. image:: /gallery/experiment/cylinder/images/thumb/sphx_glr_cylinder_Qabs_vs_diameter_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_cylinder_cylinder_Qabs_vs_diameter.py` .. raw:: html
Cylinder: Qabs vs Diameter
.. raw:: html
.. only:: html .. image:: /gallery/experiment/cylinder/images/thumb/sphx_glr_cylinder_Qsca_vs_diameter_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_cylinder_cylinder_Qsca_vs_diameter.py` .. raw:: html
Cylinder: Qsca vs Diameter
.. raw:: html
.. only:: html .. image:: /gallery/experiment/cylinder/images/thumb/sphx_glr_cylinder_Qsca_vs_index_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_cylinder_cylinder_Qsca_vs_index.py` .. raw:: html
Cylinder: Qsca vs Index
.. raw:: html
.. only:: html .. image:: /gallery/experiment/cylinder/images/thumb/sphx_glr_cylinder_Qsca_vs_wavelength_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_cylinder_cylinder_Qsca_vs_wavelength.py` .. raw:: html
Cylinder: Qsca vs Wavelength
.. raw:: html
.. only:: html .. image:: /gallery/experiment/cylinder/images/thumb/sphx_glr_cylinder_Qsca_vs_wavelength_std_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_cylinder_cylinder_Qsca_vs_wavelength_std.py` .. raw:: html
Cylinder: Qsca vs wavelength std
.. raw:: html
.. only:: html .. image:: /gallery/experiment/cylinder/images/thumb/sphx_glr_cylinder_a11_vs_diameter_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_cylinder_cylinder_a11_vs_diameter.py` .. raw:: html
Cylinder: A1 Scattering Coefficient
.. raw:: html
.. only:: html .. image:: /gallery/experiment/cylinder/images/thumb/sphx_glr_cylinder_b11_vs_diameter_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_cylinder_cylinder_b11_vs_diameter.py` .. raw:: html
Cylinder: B1 Scattering Coefficient
.. raw:: html
.. only:: html .. image:: /gallery/experiment/cylinder/images/thumb/sphx_glr_cylinder_coupling_vs_diameter_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_cylinder_cylinder_coupling_vs_diameter.py` .. raw:: html
Cylinder: Coupling vs Diameter
.. raw:: html
.. only:: html .. image:: /gallery/experiment/cylinder/images/thumb/sphx_glr_cylinder_coupling_vs_phioffset_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_cylinder_cylinder_coupling_vs_phioffset.py` .. raw:: html
Cylinder: Goniometer
.. raw:: html
.. only:: html .. image:: /gallery/experiment/cylinder/images/thumb/sphx_glr_cylinder_coupling_vs_wavelength_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_cylinder_cylinder_coupling_vs_wavelength.py` .. raw:: html
Cylinder: Coupling vs Wavelength
.. thumbnail-parent-div-close .. raw:: html
Sphere ~~~~~~ .. raw:: html
.. thumbnail-parent-div-open .. raw:: html
.. only:: html .. image:: /gallery/experiment/sphere/images/thumb/sphx_glr_sphere_Qabs_vs_diameter_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_sphere_sphere_Qabs_vs_diameter.py` .. raw:: html
Sphere: Qabs vs diameter
.. raw:: html
.. only:: html .. image:: /gallery/experiment/sphere/images/thumb/sphx_glr_sphere_Qsca_vs_diameter_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_sphere_sphere_Qsca_vs_diameter.py` .. raw:: html
Sphere: Qsca vs diameter
.. raw:: html
.. only:: html .. image:: /gallery/experiment/sphere/images/thumb/sphx_glr_sphere_Qsca_vs_index_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_sphere_sphere_Qsca_vs_index.py` .. raw:: html
Sphere: Qsca vs index
.. raw:: html
.. only:: html .. image:: /gallery/experiment/sphere/images/thumb/sphx_glr_sphere_Qsca_vs_wavelength_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_sphere_sphere_Qsca_vs_wavelength.py` .. raw:: html
Sphere: Qsca vs wavelength
.. raw:: html
.. only:: html .. image:: /gallery/experiment/sphere/images/thumb/sphx_glr_sphere_Qsca_vs_wavelength_std_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_sphere_sphere_Qsca_vs_wavelength_std.py` .. raw:: html
Sphere: Qsca vs wavelength STD
.. raw:: html
.. only:: html .. image:: /gallery/experiment/sphere/images/thumb/sphx_glr_sphere_a1_vs_diameter_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_sphere_sphere_a1_vs_diameter.py` .. raw:: html
Sphere: A1 scattering coefficient
.. raw:: html
.. only:: html .. image:: /gallery/experiment/sphere/images/thumb/sphx_glr_sphere_b1_vs_diameter_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_sphere_sphere_b1_vs_diameter.py` .. raw:: html
Sphere: B1 scattering coefficient
.. raw:: html
.. only:: html .. image:: /gallery/experiment/sphere/images/thumb/sphx_glr_sphere_coherent_coupling_vs_phioffset_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_sphere_sphere_coherent_coupling_vs_phioffset.py` .. raw:: html
Sphere: Coherent Goniometer
.. raw:: html
.. only:: html .. image:: /gallery/experiment/sphere/images/thumb/sphx_glr_sphere_coherent_coupling_vs_rotation_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_sphere_sphere_coherent_coupling_vs_rotation.py` .. raw:: html
Sphere: Coherent mode field rotation
.. raw:: html
.. only:: html .. image:: /gallery/experiment/sphere/images/thumb/sphx_glr_sphere_coherent_coupling_vs_sampling_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_sphere_sphere_coherent_coupling_vs_sampling.py` .. raw:: html
Sphere: coherent coupling vs sampling
.. raw:: html
.. only:: html .. image:: /gallery/experiment/sphere/images/thumb/sphx_glr_sphere_coupling_vs_diameter_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_sphere_sphere_coupling_vs_diameter.py` .. raw:: html
Sphere: Coupling vs diameter
.. raw:: html
.. only:: html .. image:: /gallery/experiment/sphere/images/thumb/sphx_glr_sphere_coupling_vs_filter_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_sphere_sphere_coupling_vs_filter.py` .. raw:: html
Sphere: Coupling vs polarization filter
.. raw:: html
.. only:: html .. image:: /gallery/experiment/sphere/images/thumb/sphx_glr_sphere_coupling_vs_phioffset_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_sphere_sphere_coupling_vs_phioffset.py` .. raw:: html
Sphere: Goniometer
.. raw:: html
.. only:: html .. image:: /gallery/experiment/sphere/images/thumb/sphx_glr_sphere_coupling_vs_sampling_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_sphere_sphere_coupling_vs_sampling.py` .. raw:: html
Sphere: Coupling vs sampling
.. raw:: html
.. only:: html .. image:: /gallery/experiment/sphere/images/thumb/sphx_glr_sphere_coupling_vs_wavelength_thumb.png :alt: :ref:`sphx_glr_gallery_experiment_sphere_sphere_coupling_vs_wavelength.py` .. raw:: html
Sphere: Coupling vs wavelength
.. thumbnail-parent-div-close .. raw:: html
.. toctree:: :hidden: :includehidden: /gallery/experiment/coreshell/index.rst /gallery/experiment/cylinder/index.rst /gallery/experiment/sphere/index.rst .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_