| Badge | Status |
|---|---|
| Python versions | |
| Documentation | |
| Tests | |
| PyPI | |
| Conda |
Guided-mode analysis and design for circular optical fibers.
Find the modes supported by a circular optical fiber at a given wavelength. Compare effective indices, inspect field profiles, and follow modes as the wavelength or fiber geometry changes.
See the usage guide for further examples and implementation details.
Requires Python >=3.11.
$ python -m pip install PyFiberModesInstall from the martinpdes Conda channel:
$ conda install -c martinpdes pyfibermodesFor an editable source installation:
$ git clone https://github.com/MartinPdeS/PyFiberModes.git
$ cd PyFiberModes
$ python -m pip install -e ."""
Guided-mode discovery
=====================
Discover the supported linearly polarized modes and compare their effective
indices at one wavelength.
"""
from PyFiberModes.units import ureg
import matplotlib.pyplot as plt
from PyFiberModes.analysis import find_modes
from PyFiberModes.fiber import load_fiber
fiber = load_fiber("SMF28", wavelength=1310e-9 * ureg.meter)
modes = find_modes(fiber, families=("LP",), max_nu=3, max_m=3)
effective_indices = [fiber.get_effective_index(mode) for mode in modes]
figure, axis = plt.subplots()
axis.bar([str(mode) for mode in modes], effective_indices)
axis.set(xlabel="Guided mode", ylabel="Effective index", title="SMF-28 at 1310 nm")
axis.ticklabel_format(axis="y", useOffset=False)
plt.show()Use the PyFiberModes documentation to work through examples and look up the inputs and return values of individual functions.
Cite the version used in your calculations with the software citation metadata.
Bug reports, worked examples, and documentation corrections are welcome. To set up a development checkout and run the tests, follow the contributing guide.
For questions, contact Martin Poinsinet de Sivry-Houle.
See the PyFiberModes license for terms of use.
