Skip to content

Update dispersion docs #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 25 additions & 20 deletions docs/dispersions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,15 @@ more than two dispersions together you may have a look at the `DispersionSum`_ c
PyElli also provides tabulated dispersions from the Refractiveindex.info database.
They can be accessed with the :class:`RII<elli.database.RII>` class.

Refractive Index Dispersions
============================

Constant Refractive Index
=========================
-------------------------
.. autoclass:: elli.dispersions.ConstantRefractiveIndex

Epsilon Infinity
================
.. autoclass:: elli.dispersions.EpsilonInf

Cauchy
======
------
.. autoclass:: elli.dispersions.Cauchy

.. plotly::
Expand All @@ -80,8 +78,15 @@ Cauchy

.. autoclass:: elli.dispersions.CauchyCustomExponent

Dielectric Function Dispersions
===============================

Epsilon Infinity
----------------
.. autoclass:: elli.dispersions.EpsilonInf

Sellmeier
=========
---------
.. autoclass:: elli.dispersions.Sellmeier

.. plotly::
Expand All @@ -95,10 +100,10 @@ Sellmeier
.. autoclass:: elli.dispersions.SellmeierCustomExponent

Drude
=====
-----

Energy parameters
-----------------
~~~~~~~~~~~~~~~~~
.. autoclass:: elli.dispersions.DrudeEnergy

.. plotly::
Expand All @@ -109,7 +114,7 @@ Energy parameters
fig.update_layout(title="Drude dispersion with A=10 and gamma=0.1")

Resistivity parameters
----------------------
~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: elli.dispersions.DrudeResistivity

.. plotly::
Expand All @@ -120,10 +125,10 @@ Resistivity parameters
fig.update_layout(title="Drude dispersion with rho_opt=tau=1e-8")

Lorentz
=======
-------

Wavelength parameters
---------------------
~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: elli.dispersions.LorentzLambda

.. plotly::
Expand All @@ -135,7 +140,7 @@ Wavelength parameters


Energy parameters
-----------------
~~~~~~~~~~~~~~~~~
.. autoclass:: elli.dispersions.LorentzEnergy

.. plotly::
Expand All @@ -146,7 +151,7 @@ Energy parameters
fig.update_layout(title="Lorentz dispersion with A=1, E=2 and gamma=0.2")

Tauc-Lorentz
============
------------
.. autoclass:: elli.dispersions.TaucLorentz

.. plotly::
Expand All @@ -157,7 +162,7 @@ Tauc-Lorentz
fig.update_layout(title="Tauc-Lorentz dispersion with Eg=2 and A=20, E=2.2 and C=1")

Cody-Lorentz
============
------------
.. autoclass:: elli.dispersions.CodyLorentz

.. plotly::
Expand All @@ -169,7 +174,7 @@ Cody-Lorentz


Gaussian
========
--------
.. autoclass:: elli.dispersions.Gaussian

.. plotly::
Expand All @@ -180,7 +185,7 @@ Gaussian
fig.update_layout(title="Gaussian dispersion with A=1, E=2 and sigma=0.2")

Tanguy
======
------
.. autoclass:: elli.dispersions.Tanguy

.. plotly::
Expand All @@ -191,7 +196,7 @@ Tanguy
fig.update_layout(title="Tanguy dispersion with Eg=2.5 and default values")

Poles
=====
-----
.. autoclass:: elli.dispersions.Poles

.. plotly::
Expand All @@ -203,7 +208,7 @@ Poles
fig.update_layout(title="Poles dispersion with A_ir=10, A_uv=100, E_uv=8")

Polynomial
==========
----------
.. autoclass:: elli.dispersions.Polynomial

.. plotly::
Expand All @@ -215,7 +220,7 @@ Polynomial
fig.update_layout(title="Polynomial dispersion with e0=2.5, f_1=500, e_1=-2")

Tabulated values
=================
================

Refractive index values
-----------------------
Expand Down
155 changes: 155 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
@ECHO OFF

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set BUILDDIR=_build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
if NOT "%PAPER%" == "" (
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
)

if "%1" == "" goto help

if "%1" == "help" (
:help
echo.Please use `make ^<target^>` where ^<target^> is one of
echo. html to make standalone HTML files
echo. dirhtml to make HTML files named index.html in directories
echo. singlehtml to make a single large HTML file
echo. pickle to make pickle files
echo. json to make JSON files
echo. htmlhelp to make HTML files and a HTML help project
echo. qthelp to make HTML files and a qthelp project
echo. devhelp to make HTML files and a Devhelp project
echo. epub to make an epub
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
echo. text to make text files
echo. man to make manual pages
echo. changes to make an overview over all changed/added/deprecated items
echo. linkcheck to check all external links for integrity
echo. doctest to run all doctests embedded in the documentation if enabled
goto end
)

if "%1" == "clean" (
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
del /q /s %BUILDDIR%\*
goto end
)

if "%1" == "html" (
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
goto end
)

if "%1" == "dirhtml" (
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
goto end
)

if "%1" == "singlehtml" (
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
goto end
)

if "%1" == "pickle" (
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
echo.
echo.Build finished; now you can process the pickle files.
goto end
)

if "%1" == "json" (
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
echo.
echo.Build finished; now you can process the JSON files.
goto end
)

if "%1" == "htmlhelp" (
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
echo.
echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
goto end
)

if "%1" == "qthelp" (
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
echo.
echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Mapnik.qhcp
echo.To view the help file:
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Mapnik.ghc
goto end
)

if "%1" == "devhelp" (
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
echo.
echo.Build finished.
goto end
)

if "%1" == "epub" (
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
echo.
echo.Build finished. The epub file is in %BUILDDIR%/epub.
goto end
)

if "%1" == "latex" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
echo.
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
goto end
)

if "%1" == "text" (
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
echo.
echo.Build finished. The text files are in %BUILDDIR%/text.
goto end
)

if "%1" == "man" (
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
echo.
echo.Build finished. The manual pages are in %BUILDDIR%/man.
goto end
)

if "%1" == "changes" (
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
echo.
echo.The overview file is in %BUILDDIR%/changes.
goto end
)

if "%1" == "linkcheck" (
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
echo.
echo.Link check complete; look for any errors in the above output ^
or in %BUILDDIR%/linkcheck/output.txt.
goto end
)

if "%1" == "doctest" (
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
echo.
echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
goto end
)

:end
5 changes: 2 additions & 3 deletions src/elli/dispersions/cauchy.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ class Cauchy(IndexDispersion):

Output:
.. math::
\varepsilon^{1/2}(\lambda) =
\boldsymbol{n_0} + 100 \boldsymbol{n_1}/\lambda^2 +
10^7 \boldsymbol{n_2}/\lambda^4
\varepsilon^{1/2}(\lambda) = n(\lambda) =
\boldsymbol{n_0} + 100 \boldsymbol{n_1}/\lambda^2 + 10^7 \boldsymbol{n_2}/\lambda^4
+ i (\boldsymbol{k_0} + 100 \boldsymbol{k_1}/\lambda^2
+ 10^7 \boldsymbol{k_2}/\lambda^4)
"""
Expand Down
2 changes: 1 addition & 1 deletion src/elli/dispersions/cauchy_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CauchyCustomExponent(IndexDispersion):

Output:
.. math::
\varepsilon^{1/2}(\lambda) =
n(\lambda) =
\boldsymbol{n_0} + \sum_j \boldsymbol{f}_j \cdot \lambda^{\boldsymbol{e}_j}
"""

Expand Down
2 changes: 1 addition & 1 deletion src/elli/dispersions/constant_refractive_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ConstantRefractiveIndex(IndexDispersion):

Output:
.. math::
\varepsilon(\lambda) = \boldsymbol{n}^2
\boldsymbol{n}
"""
single_params_template = {"n": 1}
rep_params_template = {}
Expand Down