.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/single/properties.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_single_properties.py: Far-Fields Computation and Visualization ======================================== This example demonstrates the process of computing and visualizing the far-fields of a scatterer using PyMieSim. .. GENERATED FROM PYTHON SOURCE LINES 9-10 Importing the package: PyMieSim .. GENERATED FROM PYTHON SOURCE LINES 10-41 .. code-block:: Python from PyMieSim.units import ureg from PyMieSim.single.source import Gaussian from PyMieSim.polarization import PolarizationState from PyMieSim.single.scatterer import Sphere from PyMieSim.single.setup import Setup polarization = PolarizationState(angle=30 * ureg.degree) source = Gaussian( wavelength=1000 * ureg.nanometer, polarization=polarization, optical_power=1 * ureg.watt, numerical_aperture=0.3, ) scatterer = Sphere( diameter=1500 * ureg.nanometer, material=1.4, medium=1.0, ) setup = Setup( scatterer=scatterer, source=source, ) for property in ["Qext", "Qsca", "Qabs", "Qback", "g", "Cext", "Csca", "Cabs", "Cback"]: value = setup.get(property) print(f"{property}: {value}") .. rst-class:: sphx-glr-script-out .. code-block:: none Qext: 4.045950200439663 dimensionless Qsca: 4.045950200439663 dimensionless Qabs: 0.0 dimensionless Qback: 0.706181111517494 dimensionless g: 0.8083293621286377 dimensionless Cext: 7.149784177401411e-12 meter ** 2 Csca: 7.149784177401411e-12 meter ** 2 Cabs: 0.0 meter ** 2 Cback: 1.247925033026569e-12 meter ** 2 .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.003 seconds) .. _sphx_glr_download_gallery_single_properties.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: properties.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: properties.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: properties.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_