.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/extras/properties_cylinder.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_extras_properties_cylinder.py: Print properties ================ This example demonstrates the computation of scattering properties using PyMieSim. .. GENERATED FROM PYTHON SOURCE LINES 9-10 Importing the package: PyMieSim .. GENERATED FROM PYTHON SOURCE LINES 10-16 .. code-block:: Python from TypedUnit import ureg from PyMieSim.single.scatterer import Cylinder from PyMieSim.single.source import Gaussian from PyOptik import Material .. GENERATED FROM PYTHON SOURCE LINES 17-18 Defining the source .. GENERATED FROM PYTHON SOURCE LINES 18-25 .. code-block:: Python source = Gaussian( wavelength=750 * ureg.nanometer, # 750 nm polarization=30 * ureg.degree, # Right circular polarization optical_power=1 * ureg.watt, # Power in watt NA=0.3 * ureg.AU, # Numerical Aperture ) .. GENERATED FROM PYTHON SOURCE LINES 26-27 Defining the scatterer .. GENERATED FROM PYTHON SOURCE LINES 27-35 .. code-block:: Python scatterer = Cylinder( diameter=300 * ureg.nanometer, # 300 nm source=source, property=(1.4 + 0.1j) * ureg.RIU, medium_property=Material.water, ) scatterer.print_properties() .. rst-class:: sphx-glr-script-out .. code-block:: none Property Value -------------- ---------------------------------- size_parameter 1.2566370614359172 dimensionless radius 150.0 nanometer cross_section 300000.00000000006 micrometer ** 2 g 0.3755740879948228 dimensionless Qsca 0.023186330283701 dimensionless Qext 0.25098397196276695 dimensionless Qabs 0.22779764167906594 dimensionless Csca 6955.899085110302 micrometer ** 2 Cext 75295.1915888301 micrometer ** 2 Cabs 68339.2925037198 micrometer ** 2 .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.056 seconds) .. _sphx_glr_download_gallery_extras_properties_cylinder.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: properties_cylinder.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: properties_cylinder.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: properties_cylinder.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_