.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/extras/properties_sphere.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_sphere.py: Samples Properties ================== .. GENERATED FROM PYTHON SOURCE LINES 5-25 .. code-block:: Python from TypedUnit import ureg from PyMieSim.single.scatterer import Sphere from PyMieSim.single.source import Gaussian source = Gaussian( wavelength=1000 * ureg.nanometer, polarization=0 * ureg.degree, optical_power=1 * ureg.watt, NA=0.3 * ureg.AU, ) scatterer = Sphere( diameter=800 * ureg.nanometer, source=source, property=1.4 * ureg.RIU, medium_property=1.0 * ureg.RIU, ) .. GENERATED FROM PYTHON SOURCE LINES 26-27 Plotting the farfield pattern .. GENERATED FROM PYTHON SOURCE LINES 27-30 .. code-block:: Python farfield = scatterer.get_farfield(sampling=300) farfield.plot() .. image-sg:: /gallery/extras/images/sphx_glr_properties_sphere_001.png :alt: properties sphere :srcset: /gallery/extras/images/sphx_glr_properties_sphere_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 31-32 Printing the scatterer properties .. GENERATED FROM PYTHON SOURCE LINES 32-33 .. code-block:: Python scatterer.print_properties() .. rst-class:: sphx-glr-script-out .. code-block:: none Property Value -------------- --------------------------------- size_parameter 2.513274122871834 dimensionless radius 400.0 nanometer volume 2.6808257310632903e-19 meter ** 3 cross_section 502654.8245743669 nanometer ** 2 g 0.6960064419371798 dimensionless Qsca 1.7376473038362097 dimensionless Qext 1.7376473038362097 dimensionless Qabs 0.0 dimensionless Qback 0.35502029214192654 dimensionless Qratio 0.2043109043809679 dimensionless Qpr 0.5282335865514358 dimensionless Csca 873436.8006819116 nanometer ** 2 Cext 873436.8006819116 nanometer ** 2 Cabs 0.0 meter ** 2 Cback 178452.66266694057 nanometer ** 2 Cratio 102697.86180024568 nanometer ** 2 Cpr 265519.16078230063 nanometer ** 2 .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.018 seconds) .. _sphx_glr_download_gallery_extras_properties_sphere.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: properties_sphere.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: properties_sphere.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: properties_sphere.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_