.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/experiment/cylinder/cylinder_Qsca_vs_wavelength.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_experiment_cylinder_cylinder_Qsca_vs_wavelength.py: InfiniteCylinder: Qsca vs Wavelength ==================================== This example demonstrates how to compute and visualize the scattering efficiency (Qsca) as a function of wavelength for cylindrical scatterers using PyMieSim, considering cylinders with different diameters and refractive indices. .. GENERATED FROM PYTHON SOURCE LINES 7-38 .. image-sg:: /gallery/experiment/cylinder/images/sphx_glr_cylinder_Qsca_vs_wavelength_001.png :alt: cylinder Qsca vs wavelength :srcset: /gallery/experiment/cylinder/images/sphx_glr_cylinder_Qsca_vs_wavelength_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none
| .. code-block:: Python import numpy as np from PyMieSim.units import ureg from PyMieSim.experiment.scatterer_set import InfiniteCylinderSet from PyMieSim.experiment.source_set import GaussianSet from PyMieSim.experiment.polarization_set import PolarizationSet from PyMieSim.experiment import Setup polarization_state = PolarizationSet( angles=0 * ureg.degree, ) source = GaussianSet( wavelength=np.linspace(400, 1000, 150) * ureg.nanometer, polarization=polarization_state, optical_power=[1e-3] * ureg.watt, numerical_aperture=[0.2], ) scatterer = InfiniteCylinderSet( diameter=[200, 150] * ureg.nanometer, material=[2, 3, 4], medium=[1], ) experiment = Setup(scatterer_set=scatterer, source_set=source) dataframe = experiment.get("Qsca") dataframe.plot(x="source:wavelength", std="scatterer:material") .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.288 seconds) .. _sphx_glr_download_gallery_experiment_cylinder_cylinder_Qsca_vs_wavelength.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: cylinder_Qsca_vs_wavelength.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: cylinder_Qsca_vs_wavelength.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: cylinder_Qsca_vs_wavelength.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_