.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/single/scatterer/source.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_scatterer_source.py: Source Plottings ================ This example demonstrates how to visualize the properties of a light source using PyMieSim. .. GENERATED FROM PYTHON SOURCE LINES 9-10 Importing the package: PyMieSim .. GENERATED FROM PYTHON SOURCE LINES 10-13 .. code-block:: Python from PyMieSim.single.source import Gaussian from PyMieSim.units import nanometer, degree, watt, AU .. GENERATED FROM PYTHON SOURCE LINES 14-15 Defining the source .. GENERATED FROM PYTHON SOURCE LINES 15-22 .. code-block:: Python source = Gaussian( wavelength=1 * nanometer, # 1000 nm polarization=0 * degree, # Linear polarization angle in radians optical_power=1 * watt, # Arbitrary units NA=0.3 * AU # Numerical Aperture ) .. GENERATED FROM PYTHON SOURCE LINES 23-24 Plotting the source .. GENERATED FROM PYTHON SOURCE LINES 24-25 .. code-block:: Python source.plot() .. image-sg:: /gallery/single/scatterer/images/sphx_glr_source_001.png :alt: source :srcset: /gallery/single/scatterer/images/sphx_glr_source_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.356 seconds) .. _sphx_glr_download_gallery_single_scatterer_source.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: source.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: source.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: source.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_