.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/specialty_fibers/plot_refractive_index_profile.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_specialty_fibers_plot_refractive_index_profile.py: Refractive-index profile ======================== Inspect the concentric refractive-index steps of a specialty fiber before solving its modes. .. GENERATED FROM PYTHON SOURCE LINES 8-28 .. image-sg:: /gallery/specialty_fibers/images/sphx_glr_plot_refractive_index_profile_001.png :alt: DCF1300S-20 radial material profile :srcset: /gallery/specialty_fibers/images/sphx_glr_plot_refractive_index_profile_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none /opt/hostedtoolcache/Python/3.11.17/x64/lib/python3.11/site-packages/matplotlib/cbook.py:1408: UnitStrippedWarning: The unit of the quantity is stripped when downcasting to ndarray. return np.asanyarray(x, float) | .. code-block:: Python from PyFiberModes.units import ureg import matplotlib.pyplot as plt import numpy as np from PyFiberModes.fiber import load_fiber fiber = load_fiber("DCF1300S_20", wavelength=1550e-9 * ureg.meter) radii = np.linspace(0, 70e-6, 600) * ureg.meter indices = fiber.get_index_profile(radii) figure, axis = plt.subplots() axis.step(radii.to("micrometer").magnitude, indices, where="post") axis.set( xlabel="Radius [µm]", ylabel="Refractive index", title="DCF1300S-20 radial material profile", ) axis.grid(alpha=0.25) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.084 seconds) .. _sphx_glr_download_gallery_specialty_fibers_plot_refractive_index_profile.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_refractive_index_profile.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_refractive_index_profile.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_refractive_index_profile.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_