.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/single/farfields.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_farfields.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 7-40 .. image-sg:: /gallery/single/images/sphx_glr_farfields_001.png :alt: farfields :srcset: /gallery/single/images/sphx_glr_farfields_001.png :class: sphx-glr-single-img .. 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 from PyMieSim.material import SellmeierMaterial material = SellmeierMaterial("BK7") 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=material, medium=1.0, ) setup = Setup( scatterer=scatterer, source=source, ) far_fields = setup.get_representation("farfields", sampling=100) figure = far_fields.plot() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 5.175 seconds) .. _sphx_glr_download_gallery_single_farfields.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: farfields.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: farfields.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: farfields.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_