├── .github └── workflows │ └── ci.yml ├── .gitignore ├── .readthedocs.yaml ├── LICENSE.md ├── MANIFEST.in ├── README.md ├── docs ├── Makefile ├── build │ ├── doctrees │ │ ├── environment.pickle │ │ ├── eqtools.doctree │ │ ├── index.doctree │ │ └── modules.doctree │ ├── html │ │ ├── .buildinfo │ │ ├── _images │ │ │ └── math │ │ │ │ ├── 04954de9f032b49df7f69c1c24ae9c868eddf932.png │ │ │ │ ├── 111aa0b82d7399dde7b74fd5a125cc950eca531b.png │ │ │ │ ├── 3f388581bfa0ab33aac72eef1e933e63537edd5d.png │ │ │ │ ├── 3fea3cea57d8b7a9bc94dbe2b95fdb0531129c0d.png │ │ │ │ ├── 45351df348bec895879674437cbdf141bfc7f549.png │ │ │ │ ├── 4dbd3865ae305a2bb57976b599653d6df9a05b49.png │ │ │ │ ├── 4e65498890f7e906998889a8593a862b902ffe4b.png │ │ │ │ ├── 551bd2506a6702b97f3ce0bb6af1ab14f56490bb.png │ │ │ │ ├── 7680a16b9a6160a0772c94edabd1edeeef03c1df.png │ │ │ │ ├── 8cfc9918d98ef074d444e15f78cbe36644b86146.png │ │ │ │ ├── 9dbb7f2563fabf7aa01024a1ea4d71c43f80a806.png │ │ │ │ ├── a8b16cc61bb6e9b00d93b0b9793e3e3a4cc8d869.png │ │ │ │ ├── ab8a57a8e0ba21e0dc07e78ea3ad3094c57e2766.png │ │ │ │ ├── b54db9491b92022e6090866ffd8196d856fc7e7e.png │ │ │ │ ├── c99e8ba39f4b2f58a187fed0cfd9398bbd12f25e.png │ │ │ │ ├── d2cdf4f6cde69cfc4de2ea6a1a3bdcd3723e9d7c.png │ │ │ │ ├── d5c4a318041d3ff669b09364b2db361d10a10d9f.png │ │ │ │ ├── def0a5fde1c0fe96e791603b65ed60363924aee0.png │ │ │ │ ├── e435ccdaa04982be4c9e9dd7423c106b71059906.png │ │ │ │ ├── eefe67f2ad1252ebb9465f58685ec6342ebd3b25.png │ │ │ │ ├── f228551be7879ec108f79f2b1e0fc75133de2408.png │ │ │ │ └── f579de5a6b751365727e11681e6ded14ad12d421.png │ │ ├── _modules │ │ │ ├── eqtools │ │ │ │ ├── AUGData.html │ │ │ │ ├── CModEFIT.html │ │ │ │ ├── D3DEFIT.html │ │ │ │ ├── EFIT.html │ │ │ │ ├── FromArrays.html │ │ │ │ ├── NSTXEFIT.html │ │ │ │ ├── TCVLIUQE.html │ │ │ │ ├── afilereader.html │ │ │ │ ├── core.html │ │ │ │ ├── eqdskreader.html │ │ │ │ ├── pfilereader.html │ │ │ │ └── trispline.html │ │ │ └── index.html │ │ ├── _sources │ │ │ ├── eqtools.rst.txt │ │ │ ├── eqtools.txt │ │ │ ├── index.rst.txt │ │ │ ├── index.txt │ │ │ ├── modules.rst.txt │ │ │ └── modules.txt │ │ ├── _static │ │ │ ├── ajax-loader.gif │ │ │ ├── basic.css │ │ │ ├── classic.css │ │ │ ├── comment-bright.png │ │ │ ├── comment-close.png │ │ │ ├── comment.png │ │ │ ├── contents.png │ │ │ ├── default.css │ │ │ ├── doctools.js │ │ │ ├── documentation_options.js │ │ │ ├── down-pressed.png │ │ │ ├── down.png │ │ │ ├── file.png │ │ │ ├── jquery-3.2.1.js │ │ │ ├── jquery.js │ │ │ ├── language_data.js │ │ │ ├── minus.png │ │ │ ├── navigation.png │ │ │ ├── plus.png │ │ │ ├── pygments.css │ │ │ ├── searchtools.js │ │ │ ├── sidebar.js │ │ │ ├── sphinxdoc.css │ │ │ ├── underscore-1.3.1.js │ │ │ ├── underscore.js │ │ │ ├── up-pressed.png │ │ │ ├── up.png │ │ │ └── websupport.js │ │ ├── eqtools.html │ │ ├── genindex.html │ │ ├── index.html │ │ ├── modules.html │ │ ├── objects.inv │ │ ├── py-modindex.html │ │ ├── search.html │ │ └── searchindex.js │ └── latex │ │ ├── LICRcyr2utf8.xdy │ │ ├── LICRlatin2utf8.xdy │ │ ├── LatinRules.xdy │ │ ├── Makefile │ │ ├── eqtools.aux │ │ ├── eqtools.fdb_latexmk │ │ ├── eqtools.fls │ │ ├── eqtools.idx │ │ ├── eqtools.ilg │ │ ├── eqtools.ind │ │ ├── eqtools.log │ │ ├── eqtools.out │ │ ├── eqtools.pdf │ │ ├── eqtools.tex │ │ ├── eqtools.toc │ │ ├── fncychap.sty │ │ ├── footnotehyper-sphinx.sty │ │ ├── latexmkjarc │ │ ├── latexmkrc │ │ ├── make.bat │ │ ├── missfont.log │ │ ├── python.ist │ │ ├── sphinx.sty │ │ ├── sphinx.xdy │ │ ├── sphinxcyrillic.sty │ │ ├── sphinxhighlight.sty │ │ ├── sphinxhowto.cls │ │ ├── sphinxmanual.cls │ │ ├── sphinxmessages.sty │ │ ├── sphinxmulticell.sty │ │ └── tabulary.sty └── source │ ├── conf.py │ ├── eqtools.rst │ ├── index.rst │ ├── modules.rst │ └── readthedocs-pip-requirements.txt ├── eqtools ├── .gitignore ├── AUGData.py ├── CModEFIT.py ├── D3DEFIT.py ├── EFIT.py ├── FromArrays.py ├── NSTXEFIT.py ├── TCVLIUQE.py ├── __init__.py ├── _tricub.c ├── _tricub.h ├── _tricub.pyf ├── _tricubmodule.c ├── afilereader.py ├── core.py ├── eqdskreader.py ├── filewriter.py ├── pfilereader.py └── trispline.py ├── pyproject.toml ├── setup.py └── tests ├── SolovievEFIT.py ├── demo.py ├── test.py ├── test_data.pkl └── unittests.py /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | pull_request: 4 | branches: [ "master" ] 5 | push: 6 | branches: 7 | - master 8 | workflow_dispatch: 9 | 10 | permissions: read-all 11 | 12 | concurrency: 13 | group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref_name }}-${{ github.event.number || github.sha }} 14 | cancel-in-progress: true 15 | 16 | jobs: 17 | build-and-test: 18 | strategy: 19 | fail-fast: false 20 | matrix: 21 | os: [ 22 | { name: arm Ubuntu-24.04, label: ubuntu-24.04-arm }, 23 | { name: x86 Ubuntu-latest, label: ubuntu-latest }, 24 | { name: x86 Windows-latest, label: windows-latest }, 25 | ] 26 | 27 | name: CI-${{ matrix.os.name }} 28 | runs-on: ${{ matrix.os.label }} 29 | steps: 30 | - name: Checkout EqTools 31 | uses: actions/checkout@v4 32 | - name: Install Python 33 | uses: actions/setup-python@v5 34 | with: 35 | python-version: "3.x" 36 | - name: Install EqTools 37 | run: python -m pip install . 38 | - name: Run tests 39 | run: python tests/test.py 40 | - name: Run unittests 41 | # Windows cannot properly load the python2 test data pickle file 42 | if: runner.os != 'Windows' 43 | run: python tests/unittests.py || true 44 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *~ 3 | *.so 4 | MANIFEST 5 | build/* 6 | dist/* 7 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # Read the Docs configuration file for Sphinx projects 2 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 3 | 4 | # Required 5 | version: 2 6 | 7 | # Set the OS, Python version and other tools you might need 8 | build: 9 | os: ubuntu-22.04 10 | tools: 11 | python: "3.12" 12 | # You can also specify other tool versions: 13 | # nodejs: "20" 14 | # rust: "1.70" 15 | # golang: "1.20" 16 | 17 | # Build documentation in the "docs/" directory with Sphinx 18 | sphinx: 19 | configuration: docs/source/conf.py 20 | # You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs 21 | # builder: "dirhtml" 22 | # Fail on all warnings to avoid broken references 23 | # fail_on_warning: true 24 | 25 | # Optionally build your docs in additional formats such as PDF and ePub 26 | # formats: 27 | # - pdf 28 | # - epub 29 | 30 | # Optional but recommended, declare the Python requirements required 31 | # to build your documentation 32 | # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html 33 | python: 34 | install: 35 | - requirements: docs/source/readthedocs-pip-requirements.txt 36 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include LICENSE.md 2 | include README.md 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | eqtools 2 | ======= 3 | 4 | Introduction 5 | ------------ 6 | 7 | Python tools for magnetic equilibria in tokamak plasmas. Provides framework for portable, modular tools for manipulation of magnetic equilibria in tokamak plasmas, including mapping of flux surfaces into a variety of coordinate systems. Includes tools for handling EFIT data stored in Alcator C-Mod MDSPlus trees, as well as eqdsk files. 8 | 9 | Full documentation is available at http://eqtools.readthedocs.org/ 10 | 11 | Package Dependencies 12 | -------------------- 13 | The following packages are required or recommended: 14 | 15 | - NumPy: Required. 16 | - SciPy: Required. 17 | - setuptools: Required. 18 | - matplotlib: Optional, needed to produce plot of flux surfaces. 19 | - MDSplus: Optional, needed to use data stored in MDSplus trees. 20 | - dd: Optional, needed to use data from ASDEX-Upgrade shotfiles. 21 | 22 | All of these should be available via pip (and should be installed automatically if you run `pip install eqtools` as described in the next section). If you wish to build in place, you may first need to run: 23 | 24 | pip install numpy scipy setuptools matplotlib 25 | 26 | Installation 27 | ------------ 28 | 29 | The easiest way to install the latest release version is with pip: 30 | 31 | pip install eqtools 32 | 33 | To install from source, uncompress the source files and, from the directory containing `setup.py`, run the following command: 34 | 35 | python setup.py install 36 | 37 | Or, to build in place, run: 38 | 39 | python setup.py build_ext --inplace 40 | 41 | If you build in place, you will also need to add your eqtools folder to your PYTHONPATH shell variable: 42 | 43 | export PYTHONPATH=$PYTHONPATH:/path/to/where/you/put/eqtools/ 44 | 45 | Running Tests 46 | ------------- 47 | 48 | Two tests are included: 49 | 50 | - `test.py` uses the module `SolovievEFIT` to compare the result from `eqtools` to Soloviev's analytic solution to the Grad-Shafranov equation for circular flux surfaces. Running this script in an interactive Python session will yield a number of plots, where you can verify that the analytic and `eqtools` results agree. 51 | - `unittests.py` contains many tests of the internal consistency of the coordinate mapping routines. By default, it will try to access data from the Alcator C-Mod tree. If this is not possible, it will try to load its data from the file `test_data.pkl`. You may wish to modify the script to pull in data from your own local site to make sure the specific version you need is working properly. To run these tests, from the directory containing `unittests.py` and `test_data.pkl`, run the command: 52 | 53 | python unittests.py 54 | 55 | Summary of Files 56 | ---------------- 57 | 58 | The following files comprise the `eqtools` package: 59 | 60 | - `LICENSE.md`: The license file. `eqtools` is released under the terms of the GNU General Public License (GPL), version 3. 61 | - `README.md`: This readme file. 62 | - `setup.py`: The `setuptools` setup file. See above for installation instructions. 63 | 64 | The package contents itself are in the `eqtools` directory: 65 | 66 | - `__init__.py`: Initialization file for the Python package. 67 | - `core.py`: Contains the basic classes the package is built with. 68 | - `EFIT.py`: Contains abstract classes to access data generated by the EFIT equilibrium reconstruction code. 69 | - `CModEFIT.py`: Contains classes to access Alcator C-Mod data. 70 | - `D3DEFIT.py`: Contains classes to access DIII-D data. 71 | - `NSTXEFIT.py`: Contains classes to access NSTX data. 72 | - `TCVLIUQE.py`: Contains classes to access TCV data. 73 | - `FromArrays.py`: Contains classes to construct equilibria from arrays of data. 74 | - `trispline.py`: Contains Python wrappers for the functions defined in `_tricub.pyf`. 75 | - `_tricub.c`: C implementation of tricubic spline interpolation. 76 | - `_tricub.h`: C header for `_tricub.c` functions. 77 | - `_tricubmodule.c`: Python C-API interface to `_tricub.c`. 78 | - `afilereader.py`: Contains classes to read the data from EFIT "a" files. 79 | - `pfilereader.py`: Contains classes to read EFIT "p" files. 80 | - `eqdskreader.py`: Contains classes to read EFIT eqdsk files. 81 | - `filewriter.py`: Contains classes to write EFIT eqdsk files. 82 | 83 | Test scripts are provided in the `tests` directory: 84 | 85 | - `SolovievEFIT.py`: Contains classes to construct analytic Soloviev equilibria with circular flux surfaces. 86 | - `test.py`: Compares the analytical solution to the results from `eqtools` for Soloviev's solution to the Grad-Shafranov equation with circular flux surfaces. 87 | - `unittests.py`: Conducts extensive consistency checks on all of the coordinate mapping routines. 88 | - `demo.py`: Contains a very bare-bones demo to make sure `eqtools` is working. For a more detailed tutorial, refer to the documentation at http://eqtools.readthedocs.org/ 89 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = build 9 | 10 | # Internal variables. 11 | PAPEROPT_a4 = -D latex_paper_size=a4 12 | PAPEROPT_letter = -D latex_paper_size=letter 13 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source 14 | # the i18n builder cannot share the environment and doctrees with the others 15 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source 16 | 17 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext 18 | 19 | help: 20 | @echo "Please use \`make ' where is one of" 21 | @echo " html to make standalone HTML files" 22 | @echo " dirhtml to make HTML files named index.html in directories" 23 | @echo " singlehtml to make a single large HTML file" 24 | @echo " pickle to make pickle files" 25 | @echo " json to make JSON files" 26 | @echo " htmlhelp to make HTML files and a HTML help project" 27 | @echo " qthelp to make HTML files and a qthelp project" 28 | @echo " devhelp to make HTML files and a Devhelp project" 29 | @echo " epub to make an epub" 30 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 31 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 32 | @echo " text to make text files" 33 | @echo " man to make manual pages" 34 | @echo " texinfo to make Texinfo files" 35 | @echo " info to make Texinfo files and run them through makeinfo" 36 | @echo " gettext to make PO message catalogs" 37 | @echo " changes to make an overview of all changed/added/deprecated items" 38 | @echo " linkcheck to check all external links for integrity" 39 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 40 | 41 | clean: 42 | -rm -rf $(BUILDDIR)/* 43 | 44 | html: 45 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 46 | @echo 47 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 48 | 49 | dirhtml: 50 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 51 | @echo 52 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 53 | 54 | singlehtml: 55 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 56 | @echo 57 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 58 | 59 | pickle: 60 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 61 | @echo 62 | @echo "Build finished; now you can process the pickle files." 63 | 64 | json: 65 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 66 | @echo 67 | @echo "Build finished; now you can process the JSON files." 68 | 69 | htmlhelp: 70 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 71 | @echo 72 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 73 | ".hhp project file in $(BUILDDIR)/htmlhelp." 74 | 75 | qthelp: 76 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 77 | @echo 78 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 79 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 80 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/eqtools.qhcp" 81 | @echo "To view the help file:" 82 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/eqtools.qhc" 83 | 84 | devhelp: 85 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 86 | @echo 87 | @echo "Build finished." 88 | @echo "To view the help file:" 89 | @echo "# mkdir -p $$HOME/.local/share/devhelp/eqtools" 90 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/eqtools" 91 | @echo "# devhelp" 92 | 93 | epub: 94 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 95 | @echo 96 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 97 | 98 | latex: 99 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 100 | @echo 101 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 102 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 103 | "(use \`make latexpdf' here to do that automatically)." 104 | 105 | latexpdf: 106 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 107 | @echo "Running LaTeX files through pdflatex..." 108 | $(MAKE) -C $(BUILDDIR)/latex all-pdf 109 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 110 | 111 | text: 112 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 113 | @echo 114 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 115 | 116 | man: 117 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 118 | @echo 119 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 120 | 121 | texinfo: 122 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 123 | @echo 124 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 125 | @echo "Run \`make' in that directory to run these through makeinfo" \ 126 | "(use \`make info' here to do that automatically)." 127 | 128 | info: 129 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 130 | @echo "Running Texinfo files through makeinfo..." 131 | make -C $(BUILDDIR)/texinfo info 132 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 133 | 134 | gettext: 135 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 136 | @echo 137 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 138 | 139 | changes: 140 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 141 | @echo 142 | @echo "The overview file is in $(BUILDDIR)/changes." 143 | 144 | linkcheck: 145 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 146 | @echo 147 | @echo "Link check complete; look for any errors in the above output " \ 148 | "or in $(BUILDDIR)/linkcheck/output.txt." 149 | 150 | doctest: 151 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 152 | @echo "Testing of doctests in the sources finished, look at the " \ 153 | "results in $(BUILDDIR)/doctest/output.txt." 154 | -------------------------------------------------------------------------------- /docs/build/doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/doctrees/environment.pickle -------------------------------------------------------------------------------- /docs/build/doctrees/eqtools.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/doctrees/eqtools.doctree -------------------------------------------------------------------------------- /docs/build/doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/doctrees/index.doctree -------------------------------------------------------------------------------- /docs/build/doctrees/modules.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/doctrees/modules.doctree -------------------------------------------------------------------------------- /docs/build/html/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: fc320e93a9d95aba1becdbe4b03dfa3f 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /docs/build/html/_images/math/04954de9f032b49df7f69c1c24ae9c868eddf932.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_images/math/04954de9f032b49df7f69c1c24ae9c868eddf932.png -------------------------------------------------------------------------------- /docs/build/html/_images/math/111aa0b82d7399dde7b74fd5a125cc950eca531b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_images/math/111aa0b82d7399dde7b74fd5a125cc950eca531b.png -------------------------------------------------------------------------------- /docs/build/html/_images/math/3f388581bfa0ab33aac72eef1e933e63537edd5d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_images/math/3f388581bfa0ab33aac72eef1e933e63537edd5d.png -------------------------------------------------------------------------------- /docs/build/html/_images/math/3fea3cea57d8b7a9bc94dbe2b95fdb0531129c0d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_images/math/3fea3cea57d8b7a9bc94dbe2b95fdb0531129c0d.png -------------------------------------------------------------------------------- /docs/build/html/_images/math/45351df348bec895879674437cbdf141bfc7f549.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_images/math/45351df348bec895879674437cbdf141bfc7f549.png -------------------------------------------------------------------------------- /docs/build/html/_images/math/4dbd3865ae305a2bb57976b599653d6df9a05b49.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_images/math/4dbd3865ae305a2bb57976b599653d6df9a05b49.png -------------------------------------------------------------------------------- /docs/build/html/_images/math/4e65498890f7e906998889a8593a862b902ffe4b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_images/math/4e65498890f7e906998889a8593a862b902ffe4b.png -------------------------------------------------------------------------------- /docs/build/html/_images/math/551bd2506a6702b97f3ce0bb6af1ab14f56490bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_images/math/551bd2506a6702b97f3ce0bb6af1ab14f56490bb.png -------------------------------------------------------------------------------- /docs/build/html/_images/math/7680a16b9a6160a0772c94edabd1edeeef03c1df.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_images/math/7680a16b9a6160a0772c94edabd1edeeef03c1df.png -------------------------------------------------------------------------------- /docs/build/html/_images/math/8cfc9918d98ef074d444e15f78cbe36644b86146.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_images/math/8cfc9918d98ef074d444e15f78cbe36644b86146.png -------------------------------------------------------------------------------- /docs/build/html/_images/math/9dbb7f2563fabf7aa01024a1ea4d71c43f80a806.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_images/math/9dbb7f2563fabf7aa01024a1ea4d71c43f80a806.png -------------------------------------------------------------------------------- /docs/build/html/_images/math/a8b16cc61bb6e9b00d93b0b9793e3e3a4cc8d869.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_images/math/a8b16cc61bb6e9b00d93b0b9793e3e3a4cc8d869.png -------------------------------------------------------------------------------- /docs/build/html/_images/math/ab8a57a8e0ba21e0dc07e78ea3ad3094c57e2766.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_images/math/ab8a57a8e0ba21e0dc07e78ea3ad3094c57e2766.png -------------------------------------------------------------------------------- /docs/build/html/_images/math/b54db9491b92022e6090866ffd8196d856fc7e7e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_images/math/b54db9491b92022e6090866ffd8196d856fc7e7e.png -------------------------------------------------------------------------------- /docs/build/html/_images/math/c99e8ba39f4b2f58a187fed0cfd9398bbd12f25e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_images/math/c99e8ba39f4b2f58a187fed0cfd9398bbd12f25e.png -------------------------------------------------------------------------------- /docs/build/html/_images/math/d2cdf4f6cde69cfc4de2ea6a1a3bdcd3723e9d7c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_images/math/d2cdf4f6cde69cfc4de2ea6a1a3bdcd3723e9d7c.png -------------------------------------------------------------------------------- /docs/build/html/_images/math/d5c4a318041d3ff669b09364b2db361d10a10d9f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_images/math/d5c4a318041d3ff669b09364b2db361d10a10d9f.png -------------------------------------------------------------------------------- /docs/build/html/_images/math/def0a5fde1c0fe96e791603b65ed60363924aee0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_images/math/def0a5fde1c0fe96e791603b65ed60363924aee0.png -------------------------------------------------------------------------------- /docs/build/html/_images/math/e435ccdaa04982be4c9e9dd7423c106b71059906.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_images/math/e435ccdaa04982be4c9e9dd7423c106b71059906.png -------------------------------------------------------------------------------- /docs/build/html/_images/math/eefe67f2ad1252ebb9465f58685ec6342ebd3b25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_images/math/eefe67f2ad1252ebb9465f58685ec6342ebd3b25.png -------------------------------------------------------------------------------- /docs/build/html/_images/math/f228551be7879ec108f79f2b1e0fc75133de2408.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_images/math/f228551be7879ec108f79f2b1e0fc75133de2408.png -------------------------------------------------------------------------------- /docs/build/html/_images/math/f579de5a6b751365727e11681e6ded14ad12d421.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_images/math/f579de5a6b751365727e11681e6ded14ad12d421.png -------------------------------------------------------------------------------- /docs/build/html/_modules/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Overview: module code — eqtools 1.3.2 documentation 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 32 | 33 |
34 |
35 |
36 |
37 | 38 |

All modules for which code is available

39 | 52 | 53 |
54 |
55 |
56 | 70 |
71 |
72 | 84 | 88 | 89 | -------------------------------------------------------------------------------- /docs/build/html/_sources/eqtools.rst.txt: -------------------------------------------------------------------------------- 1 | eqtools package 2 | =============== 3 | 4 | Submodules 5 | ---------- 6 | 7 | eqtools.AUGData module 8 | ---------------------- 9 | 10 | .. automodule:: eqtools.AUGData 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | eqtools.CModEFIT module 16 | ----------------------- 17 | 18 | .. automodule:: eqtools.CModEFIT 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | eqtools.D3DEFIT module 24 | ---------------------- 25 | 26 | .. automodule:: eqtools.D3DEFIT 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | eqtools.EFIT module 32 | ------------------- 33 | 34 | .. automodule:: eqtools.EFIT 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | eqtools.FromArrays module 40 | ------------------------- 41 | 42 | .. automodule:: eqtools.FromArrays 43 | :members: 44 | :undoc-members: 45 | :show-inheritance: 46 | 47 | eqtools.NSTXEFIT module 48 | ----------------------- 49 | 50 | .. automodule:: eqtools.NSTXEFIT 51 | :members: 52 | :undoc-members: 53 | :show-inheritance: 54 | 55 | eqtools.TCVLIUQE module 56 | ----------------------- 57 | 58 | .. automodule:: eqtools.TCVLIUQE 59 | :members: 60 | :undoc-members: 61 | :show-inheritance: 62 | 63 | eqtools.afilereader module 64 | -------------------------- 65 | 66 | .. automodule:: eqtools.afilereader 67 | :members: 68 | :undoc-members: 69 | :show-inheritance: 70 | 71 | eqtools.core module 72 | ------------------- 73 | 74 | .. automodule:: eqtools.core 75 | :members: 76 | :undoc-members: 77 | :show-inheritance: 78 | 79 | eqtools.eqdskreader module 80 | -------------------------- 81 | 82 | .. automodule:: eqtools.eqdskreader 83 | :members: 84 | :undoc-members: 85 | :show-inheritance: 86 | 87 | eqtools.filewriter module 88 | ------------------------- 89 | 90 | .. automodule:: eqtools.filewriter 91 | :members: 92 | :undoc-members: 93 | :show-inheritance: 94 | 95 | eqtools.pfilereader module 96 | -------------------------- 97 | 98 | .. automodule:: eqtools.pfilereader 99 | :members: 100 | :undoc-members: 101 | :show-inheritance: 102 | 103 | eqtools.trispline module 104 | ------------------------ 105 | 106 | .. automodule:: eqtools.trispline 107 | :members: 108 | :undoc-members: 109 | :show-inheritance: 110 | 111 | 112 | Module contents 113 | --------------- 114 | 115 | .. automodule:: eqtools 116 | :members: 117 | :undoc-members: 118 | :show-inheritance: 119 | -------------------------------------------------------------------------------- /docs/build/html/_sources/eqtools.txt: -------------------------------------------------------------------------------- 1 | eqtools package 2 | =============== 3 | 4 | Submodules 5 | ---------- 6 | 7 | eqtools.CModEFIT module 8 | ----------------------- 9 | 10 | .. automodule:: eqtools.CModEFIT 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | eqtools.D3DEFIT module 16 | ---------------------- 17 | 18 | .. automodule:: eqtools.D3DEFIT 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | eqtools.EFIT module 24 | ------------------- 25 | 26 | .. automodule:: eqtools.EFIT 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | eqtools.FromArrays module 32 | ------------------------- 33 | 34 | .. automodule:: eqtools.FromArrays 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | eqtools.NSTXEFIT module 40 | ----------------------- 41 | 42 | .. automodule:: eqtools.NSTXEFIT 43 | :members: 44 | :undoc-members: 45 | :show-inheritance: 46 | 47 | eqtools.TCVLIUQE module 48 | ----------------------- 49 | 50 | .. automodule:: eqtools.TCVLIUQE 51 | :members: 52 | :undoc-members: 53 | :show-inheritance: 54 | 55 | eqtools.AUGDATA module 56 | ----------------------- 57 | 58 | .. automodule:: eqtools.AUGDATA 59 | :members: 60 | :undoc-members: 61 | :show-inheritance: 62 | 63 | eqtools.afilereader module 64 | -------------------------- 65 | 66 | .. automodule:: eqtools.afilereader 67 | :members: 68 | :undoc-members: 69 | :show-inheritance: 70 | 71 | eqtools.core module 72 | ------------------- 73 | 74 | .. automodule:: eqtools.core 75 | :members: 76 | :undoc-members: 77 | :show-inheritance: 78 | 79 | eqtools.eqdskreader module 80 | -------------------------- 81 | 82 | .. automodule:: eqtools.eqdskreader 83 | :members: 84 | :undoc-members: 85 | :show-inheritance: 86 | 87 | eqtools.filewriter module 88 | ------------------------- 89 | 90 | .. automodule:: eqtools.filewriter 91 | :members: 92 | :undoc-members: 93 | :show-inheritance: 94 | 95 | eqtools.pfilereader module 96 | -------------------------- 97 | 98 | .. automodule:: eqtools.pfilereader 99 | :members: 100 | :undoc-members: 101 | :show-inheritance: 102 | 103 | eqtools.trispline module 104 | ------------------------ 105 | 106 | .. automodule:: eqtools.trispline 107 | :members: 108 | :undoc-members: 109 | :show-inheritance: 110 | 111 | 112 | Module contents 113 | --------------- 114 | 115 | .. automodule:: eqtools 116 | :members: 117 | :undoc-members: 118 | :show-inheritance: 119 | -------------------------------------------------------------------------------- /docs/build/html/_sources/index.rst.txt: -------------------------------------------------------------------------------- 1 | .. eqtools documentation master file, created by 2 | sphinx-quickstart on Wed Sep 4 17:55:14 2013. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | eqtools: Tools for interacting with magnetic equilibria 7 | ======================================================= 8 | 9 | Homepage: https://github.com/PSFCPlasmaTools/eqtools 10 | 11 | Overview 12 | -------- 13 | 14 | :py:mod:`eqtools` is a Python package for working with magnetic equilibrium reconstructions from magnetic plasma confinement devices. At present, interfaces exist for data from the Alcator C-Mod and NSTX MDSplus trees as well as eqdsk a- and g-files. :py:mod:`eqtools` is designed to be flexible and extensible such that it can become a uniform interface to perform mapping operations and accessing equilibrium data for any magnetic confinement device, regardless of how the data are accessed. 15 | 16 | The main class of :py:mod:`eqtools` is the :py:class:`~eqtools.core.Equilibrium`, which contains all of the coordinate mapping functions as well as templates for methods to fetch data (primarily dictated to the quantities computed by EFIT). Subclasses such as :py:class:`~eqtools.EFIT.EFITTree`, :py:class:`~eqtools.CModEFIT.CModEFITTree`, :py:class:`~eqtools.NSTXEFIT.NSTXEFITTree` and :py:class:`~eqtools.eqdskreader.EqdskReader` implement specific methods to access the data and convert it to the form needed for the routines in :py:class:`~eqtools.core.Equilibrium`. These classes are smart about caching intermediate results, so you will get a performance boost by using the same instance throughout your analysis of a given shot. 17 | 18 | Installation 19 | ------------ 20 | 21 | The easiest way to install the latest release version is with `pip`:: 22 | 23 | pip install eqtools 24 | 25 | To install from source, uncompress the source files and, from the directory containing `setup.py`, run the following command:: 26 | 27 | python setup.py install 28 | 29 | Or, to build in place, run:: 30 | 31 | python setup.py build_ext --inplace 32 | 33 | Tutorial: Performing Coordinate Transforms on Alcator C-Mod Data 34 | ---------------------------------------------------------------- 35 | 36 | The basic class for manipulating EFIT results stored in the Alcator C-Mod MDSplus tree is :py:class:`~eqtools.CModEFIT.CModEFITTree`. To load the data from a specific shot, simply create the :py:class:`~eqtools.CModEFIT.CModEFITTree` object with the shot number as the argument:: 37 | 38 | e = eqtools.CModEFITTree(1140729030) 39 | 40 | The default EFIT to use is "ANALYSIS." If you want to use a different tree, such as "EFIT20," then you simply set this with the `tree` keyword:: 41 | 42 | e = eqtools.CModEFITTree(1140729030, tree='EFIT20') 43 | 44 | :py:mod:`eqtools` understands units. The default is to convert all lengths to meters (whereas quantities in the tree are inconsistent -- some are meters, some centimeters). If you want to specify a different default unit, use the `length_unit` keyword:: 45 | 46 | e = eqtools.CModEFITTree(1140729030, length_unit='cm') 47 | 48 | Once this is loaded, you can access the data you would normally have to pull from specific nodes in the tree using convenient getter methods. For instance, to get the elongation as a function of time, you can run:: 49 | 50 | kappa = e.getElongation() 51 | 52 | The timebase used for quantities like this is accessed with:: 53 | 54 | t = e.getTimeBase() 55 | 56 | For length/area/volume quantities, :py:mod:`eqtools` understands units. The default is to return in whatever units you specified when creating the :py:class:`~eqtools.CModEFIT.CModEFITTree`, but you can override this with the `length_unit` keyword. For instance, to get the vertical position of the magnetic axis in mm, you can run:: 57 | 58 | Z_mag = e.getMagZ(length_unit='mm') 59 | 60 | :py:mod:`eqtools` can map from almost any coordinate to any common flux surface label. For instance, say you want to know what the square root of normalized toroidal flux corresponding to a normalized flux surface volume of 0.5 is at t=1.0s. You can simply call:: 61 | 62 | rho = e.volnorm2phinorm(0.5, 1.0, sqrt=True) 63 | 64 | If a list of times is provided, the default behavior is to evaluate all of the points to be converted at each of the times. So, to follow the mapping of normalized poloidal flux values [0.1, 0.5, 1.0] to outboard midplane major radius at time points [1.0, 1.25, 1.5, 1.75], you could call:: 65 | 66 | psinorm = e.psinorm2rmid([0.1, 0.5, 1.0], [1.0, 1.25, 1.5, 1.75]) 67 | 68 | This will return a 4-by-3 array: one row for each time, one column for each location. If you want to override this behavior and instead consider a sequence of (psi, t) points, set the `each_t` keyword to False:: 69 | 70 | psinorm = e.psinorm2rmid([0.3, 0.35], [1.0, 1.1], each_t=False) 71 | 72 | This will return a two-element array with the Rmid values for (psinorm=0.3, t=1.0) and (psinorm=0.35, t=1.1). 73 | 74 | For programmatically mapping between coordinates, the :py:meth:`~eqtools.core.Equilibrium.rho2rho` method is quite useful. To map from outboard midplane major radius to normalized flux surface volume, you can simply call:: 75 | 76 | e.rho2rho('Rmid', 'volnorm', 0.75, 1.0) 77 | 78 | Finally, to get a look at the flux surfaces, simply run:: 79 | 80 | e.plotFlux() 81 | 82 | Package Reference 83 | ----------------- 84 | 85 | .. toctree:: 86 | :maxdepth: 4 87 | 88 | eqtools 89 | 90 | 91 | Indices and tables 92 | ================== 93 | 94 | * :ref:`genindex` 95 | * :ref:`modindex` 96 | * :ref:`search` 97 | 98 | -------------------------------------------------------------------------------- /docs/build/html/_sources/index.txt: -------------------------------------------------------------------------------- 1 | .. eqtools documentation master file, created by 2 | sphinx-quickstart on Wed Sep 4 17:55:14 2013. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | eqtools: Tools for interacting with magnetic equilibria 7 | ======================================================= 8 | 9 | Homepage: https://github.com/PSFCPlasmaTools/eqtools 10 | 11 | Overview 12 | -------- 13 | 14 | :py:mod:`eqtools` is a Python package for working with magnetic equilibrium reconstructions from magnetic plasma confinement devices. At present, interfaces exist for data from the Alcator C-Mod and NSTX MDSplus trees as well as eqdsk a- and g-files. :py:mod:`eqtools` is designed to be flexible and extensible such that it can become a uniform interface to perform mapping operations and accessing equilibrium data for any magnetic confinement device, regardless of how the data are accessed. 15 | 16 | The main class of :py:mod:`eqtools` is the :py:class:`~eqtools.core.Equilibrium`, which contains all of the coordinate mapping functions as well as templates for methods to fetch data (primarily dictated to the quantities computed by EFIT). Subclasses such as :py:class:`~eqtools.EFIT.EFITTree`, :py:class:`~eqtools.CModEFIT.CModEFITTree`, :py:class:`~eqtools.NSTXEFIT.NSTXEFITTree` and :py:class:`~eqtools.eqdskreader.EqdskReader` implement specific methods to access the data and convert it to the form needed for the routines in :py:class:`~eqtools.core.Equilibrium`. These classes are smart about caching intermediate results, so you will get a performance boost by using the same instance throughout your analysis of a given shot. 17 | 18 | Installation 19 | ------------ 20 | 21 | The easiest way to install the latest release version is with `pip`:: 22 | 23 | pip install eqtools 24 | 25 | To install from source, uncompress the source files and, from the directory containing `setup.py`, run the following command:: 26 | 27 | python setup.py install 28 | 29 | Or, to build in place, run:: 30 | 31 | python setup.py build_ext --inplace 32 | 33 | Tutorial: Performing Coordinate Transforms on Alcator C-Mod Data 34 | ---------------------------------------------------------------- 35 | 36 | The basic class for manipulating EFIT results stored in the Alcator C-Mod MDSplus tree is :py:class:`~eqtools.CModEFIT.CModEFITTree`. To load the data from a specific shot, simply create the :py:class:`~eqtools.CModEFIT.CModEFITTree` object with the shot number as the argument:: 37 | 38 | e = eqtools.CModEFITTree(1140729030) 39 | 40 | The default EFIT to use is "ANALYSIS." If you want to use a different tree, such as "EFIT20," then you simply set this with the `tree` keyword:: 41 | 42 | e = eqtools.CModEFITTree(1140729030, tree='EFIT20') 43 | 44 | :py:mod:`eqtools` understands units. The default is to convert all lengths to meters (whereas quantities in the tree are inconsistent -- some are meters, some centimeters). If you want to specify a different default unit, use the `length_unit` keyword:: 45 | 46 | e = eqtools.CModEFITTree(1140729030, length_unit='cm') 47 | 48 | Once this is loaded, you can access the data you would normally have to pull from specific nodes in the tree using convenient getter methods. For instance, to get the elongation as a function of time, you can run:: 49 | 50 | kappa = e.getElongation() 51 | 52 | The timebase used for quantities like this is accessed with:: 53 | 54 | t = e.getTimeBase() 55 | 56 | For length/area/volume quantities, :py:mod:`eqtools` understands units. The default is to return in whatever units you specified when creating the :py:class:`~eqtools.CModEFIT.CModEFITTree`, but you can override this with the `length_unit` keyword. For instance, to get the vertical position of the magnetic axis in mm, you can run:: 57 | 58 | Z_mag = e.getMagZ(length_unit='mm') 59 | 60 | :py:mod:`eqtools` can map from almost any coordinate to any common flux surface label. For instance, say you want to know what the square root of normalized toroidal flux corresponding to a normalized flux surface volume of 0.5 is at t=1.0s. You can simply call:: 61 | 62 | rho = e.volnorm2phinorm(0.5, 1.0, sqrt=True) 63 | 64 | If a list of times is provided, the default behavior is to evaluate all of the points to be converted at each of the times. So, to follow the mapping of normalized poloidal flux values [0.1, 0.5, 1.0] to outboard midplane major radius at time points [1.0, 1.25, 1.5, 1.75], you could call:: 65 | 66 | psinorm = e.psinorm2rmid([0.1, 0.5, 1.0], [1.0, 1.25, 1.5, 1.75]) 67 | 68 | This will return a 4-by-3 array: one row for each time, one column for each location. If you want to override this behavior and instead consider a sequence of (psi, t) points, set the `each_t` keyword to False:: 69 | 70 | psinorm = e.psinorm2rmid([0.3, 0.35], [1.0, 1.1], each_t=False) 71 | 72 | This will return a two-element array with the Rmid values for (psinorm=0.3, t=1.0) and (psinorm=0.35, t=1.1). 73 | 74 | For programmatically mapping between coordinates, the :py:meth:`~eqtools.core.Equilibrium.rho2rho` method is quite useful. To map from outboard midplane major radius to normalized flux surface volume, you can simply call:: 75 | 76 | e.rho2rho('Rmid', 'volnorm', 0.75, 1.0) 77 | 78 | Finally, to get a look at the flux surfaces, simply run:: 79 | 80 | e.plotFlux() 81 | 82 | Package Reference 83 | ----------------- 84 | 85 | .. toctree:: 86 | :maxdepth: 4 87 | 88 | eqtools 89 | 90 | 91 | Indices and tables 92 | ================== 93 | 94 | * :ref:`genindex` 95 | * :ref:`modindex` 96 | * :ref:`search` 97 | 98 | -------------------------------------------------------------------------------- /docs/build/html/_sources/modules.rst.txt: -------------------------------------------------------------------------------- 1 | eqtools 2 | ======= 3 | 4 | .. toctree:: 5 | :maxdepth: 4 6 | 7 | eqtools 8 | -------------------------------------------------------------------------------- /docs/build/html/_sources/modules.txt: -------------------------------------------------------------------------------- 1 | eqtools 2 | ======= 3 | 4 | .. toctree:: 5 | :maxdepth: 4 6 | 7 | eqtools 8 | -------------------------------------------------------------------------------- /docs/build/html/_static/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_static/ajax-loader.gif -------------------------------------------------------------------------------- /docs/build/html/_static/classic.css: -------------------------------------------------------------------------------- 1 | /* 2 | * classic.css_t 3 | * ~~~~~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- classic theme. 6 | * 7 | * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | @import url("basic.css"); 13 | 14 | /* -- page layout ----------------------------------------------------------- */ 15 | 16 | body { 17 | font-family: sans-serif; 18 | font-size: 100%; 19 | background-color: #11303d; 20 | color: #000; 21 | margin: 0; 22 | padding: 0; 23 | } 24 | 25 | div.document { 26 | background-color: #1c4e63; 27 | } 28 | 29 | div.documentwrapper { 30 | float: left; 31 | width: 100%; 32 | } 33 | 34 | div.bodywrapper { 35 | margin: 0 0 0 230px; 36 | } 37 | 38 | div.body { 39 | background-color: #ffffff; 40 | color: #000000; 41 | padding: 0 20px 30px 20px; 42 | } 43 | 44 | div.footer { 45 | color: #ffffff; 46 | width: 100%; 47 | padding: 9px 0 9px 0; 48 | text-align: center; 49 | font-size: 75%; 50 | } 51 | 52 | div.footer a { 53 | color: #ffffff; 54 | text-decoration: underline; 55 | } 56 | 57 | div.related { 58 | background-color: #133f52; 59 | line-height: 30px; 60 | color: #ffffff; 61 | } 62 | 63 | div.related a { 64 | color: #ffffff; 65 | } 66 | 67 | div.sphinxsidebar { 68 | } 69 | 70 | div.sphinxsidebar h3 { 71 | font-family: 'Trebuchet MS', sans-serif; 72 | color: #ffffff; 73 | font-size: 1.4em; 74 | font-weight: normal; 75 | margin: 0; 76 | padding: 0; 77 | } 78 | 79 | div.sphinxsidebar h3 a { 80 | color: #ffffff; 81 | } 82 | 83 | div.sphinxsidebar h4 { 84 | font-family: 'Trebuchet MS', sans-serif; 85 | color: #ffffff; 86 | font-size: 1.3em; 87 | font-weight: normal; 88 | margin: 5px 0 0 0; 89 | padding: 0; 90 | } 91 | 92 | div.sphinxsidebar p { 93 | color: #ffffff; 94 | } 95 | 96 | div.sphinxsidebar p.topless { 97 | margin: 5px 10px 10px 10px; 98 | } 99 | 100 | div.sphinxsidebar ul { 101 | margin: 10px; 102 | padding: 0; 103 | color: #ffffff; 104 | } 105 | 106 | div.sphinxsidebar a { 107 | color: #98dbcc; 108 | } 109 | 110 | div.sphinxsidebar input { 111 | border: 1px solid #98dbcc; 112 | font-family: sans-serif; 113 | font-size: 1em; 114 | } 115 | 116 | 117 | 118 | /* -- hyperlink styles ------------------------------------------------------ */ 119 | 120 | a { 121 | color: #355f7c; 122 | text-decoration: none; 123 | } 124 | 125 | a:visited { 126 | color: #355f7c; 127 | text-decoration: none; 128 | } 129 | 130 | a:hover { 131 | text-decoration: underline; 132 | } 133 | 134 | 135 | 136 | /* -- body styles ----------------------------------------------------------- */ 137 | 138 | div.body h1, 139 | div.body h2, 140 | div.body h3, 141 | div.body h4, 142 | div.body h5, 143 | div.body h6 { 144 | font-family: 'Trebuchet MS', sans-serif; 145 | background-color: #f2f2f2; 146 | font-weight: normal; 147 | color: #20435c; 148 | border-bottom: 1px solid #ccc; 149 | margin: 20px -20px 10px -20px; 150 | padding: 3px 0 3px 10px; 151 | } 152 | 153 | div.body h1 { margin-top: 0; font-size: 200%; } 154 | div.body h2 { font-size: 160%; } 155 | div.body h3 { font-size: 140%; } 156 | div.body h4 { font-size: 120%; } 157 | div.body h5 { font-size: 110%; } 158 | div.body h6 { font-size: 100%; } 159 | 160 | a.headerlink { 161 | color: #c60f0f; 162 | font-size: 0.8em; 163 | padding: 0 4px 0 4px; 164 | text-decoration: none; 165 | } 166 | 167 | a.headerlink:hover { 168 | background-color: #c60f0f; 169 | color: white; 170 | } 171 | 172 | div.body p, div.body dd, div.body li, div.body blockquote { 173 | text-align: justify; 174 | line-height: 130%; 175 | } 176 | 177 | div.admonition p.admonition-title + p { 178 | display: inline; 179 | } 180 | 181 | div.admonition p { 182 | margin-bottom: 5px; 183 | } 184 | 185 | div.admonition pre { 186 | margin-bottom: 5px; 187 | } 188 | 189 | div.admonition ul, div.admonition ol { 190 | margin-bottom: 5px; 191 | } 192 | 193 | div.note { 194 | background-color: #eee; 195 | border: 1px solid #ccc; 196 | } 197 | 198 | div.seealso { 199 | background-color: #ffc; 200 | border: 1px solid #ff6; 201 | } 202 | 203 | div.topic { 204 | background-color: #eee; 205 | } 206 | 207 | div.warning { 208 | background-color: #ffe4e4; 209 | border: 1px solid #f66; 210 | } 211 | 212 | p.admonition-title { 213 | display: inline; 214 | } 215 | 216 | p.admonition-title:after { 217 | content: ":"; 218 | } 219 | 220 | pre { 221 | padding: 5px; 222 | background-color: #eeffcc; 223 | color: #333333; 224 | line-height: 120%; 225 | border: 1px solid #ac9; 226 | border-left: none; 227 | border-right: none; 228 | } 229 | 230 | code { 231 | background-color: #ecf0f3; 232 | padding: 0 1px 0 1px; 233 | font-size: 0.95em; 234 | } 235 | 236 | th { 237 | background-color: #ede; 238 | } 239 | 240 | .warning code { 241 | background: #efc2c2; 242 | } 243 | 244 | .note code { 245 | background: #d6d6d6; 246 | } 247 | 248 | .viewcode-back { 249 | font-family: sans-serif; 250 | } 251 | 252 | div.viewcode-block:target { 253 | background-color: #f4debf; 254 | border-top: 1px solid #ac9; 255 | border-bottom: 1px solid #ac9; 256 | } 257 | 258 | div.code-block-caption { 259 | color: #efefef; 260 | background-color: #1c4e63; 261 | } -------------------------------------------------------------------------------- /docs/build/html/_static/comment-bright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_static/comment-bright.png -------------------------------------------------------------------------------- /docs/build/html/_static/comment-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_static/comment-close.png -------------------------------------------------------------------------------- /docs/build/html/_static/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_static/comment.png -------------------------------------------------------------------------------- /docs/build/html/_static/contents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_static/contents.png -------------------------------------------------------------------------------- /docs/build/html/_static/default.css: -------------------------------------------------------------------------------- 1 | @import url("classic.css"); 2 | -------------------------------------------------------------------------------- /docs/build/html/_static/doctools.js: -------------------------------------------------------------------------------- 1 | /* 2 | * doctools.js 3 | * ~~~~~~~~~~~ 4 | * 5 | * Sphinx JavaScript utilities for all documentation. 6 | * 7 | * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /** 13 | * select a different prefix for underscore 14 | */ 15 | $u = _.noConflict(); 16 | 17 | /** 18 | * make the code below compatible with browsers without 19 | * an installed firebug like debugger 20 | if (!window.console || !console.firebug) { 21 | var names = ["log", "debug", "info", "warn", "error", "assert", "dir", 22 | "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", 23 | "profile", "profileEnd"]; 24 | window.console = {}; 25 | for (var i = 0; i < names.length; ++i) 26 | window.console[names[i]] = function() {}; 27 | } 28 | */ 29 | 30 | /** 31 | * small helper function to urldecode strings 32 | */ 33 | jQuery.urldecode = function(x) { 34 | return decodeURIComponent(x).replace(/\+/g, ' '); 35 | }; 36 | 37 | /** 38 | * small helper function to urlencode strings 39 | */ 40 | jQuery.urlencode = encodeURIComponent; 41 | 42 | /** 43 | * This function returns the parsed url parameters of the 44 | * current request. Multiple values per key are supported, 45 | * it will always return arrays of strings for the value parts. 46 | */ 47 | jQuery.getQueryParameters = function(s) { 48 | if (typeof s === 'undefined') 49 | s = document.location.search; 50 | var parts = s.substr(s.indexOf('?') + 1).split('&'); 51 | var result = {}; 52 | for (var i = 0; i < parts.length; i++) { 53 | var tmp = parts[i].split('=', 2); 54 | var key = jQuery.urldecode(tmp[0]); 55 | var value = jQuery.urldecode(tmp[1]); 56 | if (key in result) 57 | result[key].push(value); 58 | else 59 | result[key] = [value]; 60 | } 61 | return result; 62 | }; 63 | 64 | /** 65 | * highlight a given string on a jquery object by wrapping it in 66 | * span elements with the given class name. 67 | */ 68 | jQuery.fn.highlightText = function(text, className) { 69 | function highlight(node, addItems) { 70 | if (node.nodeType === 3) { 71 | var val = node.nodeValue; 72 | var pos = val.toLowerCase().indexOf(text); 73 | if (pos >= 0 && 74 | !jQuery(node.parentNode).hasClass(className) && 75 | !jQuery(node.parentNode).hasClass("nohighlight")) { 76 | var span; 77 | var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); 78 | if (isInSVG) { 79 | span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); 80 | } else { 81 | span = document.createElement("span"); 82 | span.className = className; 83 | } 84 | span.appendChild(document.createTextNode(val.substr(pos, text.length))); 85 | node.parentNode.insertBefore(span, node.parentNode.insertBefore( 86 | document.createTextNode(val.substr(pos + text.length)), 87 | node.nextSibling)); 88 | node.nodeValue = val.substr(0, pos); 89 | if (isInSVG) { 90 | var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); 91 | var bbox = node.parentElement.getBBox(); 92 | rect.x.baseVal.value = bbox.x; 93 | rect.y.baseVal.value = bbox.y; 94 | rect.width.baseVal.value = bbox.width; 95 | rect.height.baseVal.value = bbox.height; 96 | rect.setAttribute('class', className); 97 | addItems.push({ 98 | "parent": node.parentNode, 99 | "target": rect}); 100 | } 101 | } 102 | } 103 | else if (!jQuery(node).is("button, select, textarea")) { 104 | jQuery.each(node.childNodes, function() { 105 | highlight(this, addItems); 106 | }); 107 | } 108 | } 109 | var addItems = []; 110 | var result = this.each(function() { 111 | highlight(this, addItems); 112 | }); 113 | for (var i = 0; i < addItems.length; ++i) { 114 | jQuery(addItems[i].parent).before(addItems[i].target); 115 | } 116 | return result; 117 | }; 118 | 119 | /* 120 | * backward compatibility for jQuery.browser 121 | * This will be supported until firefox bug is fixed. 122 | */ 123 | if (!jQuery.browser) { 124 | jQuery.uaMatch = function(ua) { 125 | ua = ua.toLowerCase(); 126 | 127 | var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || 128 | /(webkit)[ \/]([\w.]+)/.exec(ua) || 129 | /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || 130 | /(msie) ([\w.]+)/.exec(ua) || 131 | ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || 132 | []; 133 | 134 | return { 135 | browser: match[ 1 ] || "", 136 | version: match[ 2 ] || "0" 137 | }; 138 | }; 139 | jQuery.browser = {}; 140 | jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; 141 | } 142 | 143 | /** 144 | * Small JavaScript module for the documentation. 145 | */ 146 | var Documentation = { 147 | 148 | init : function() { 149 | this.fixFirefoxAnchorBug(); 150 | this.highlightSearchWords(); 151 | this.initIndexTable(); 152 | if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) { 153 | this.initOnKeyListeners(); 154 | } 155 | }, 156 | 157 | /** 158 | * i18n support 159 | */ 160 | TRANSLATIONS : {}, 161 | PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; }, 162 | LOCALE : 'unknown', 163 | 164 | // gettext and ngettext don't access this so that the functions 165 | // can safely bound to a different name (_ = Documentation.gettext) 166 | gettext : function(string) { 167 | var translated = Documentation.TRANSLATIONS[string]; 168 | if (typeof translated === 'undefined') 169 | return string; 170 | return (typeof translated === 'string') ? translated : translated[0]; 171 | }, 172 | 173 | ngettext : function(singular, plural, n) { 174 | var translated = Documentation.TRANSLATIONS[singular]; 175 | if (typeof translated === 'undefined') 176 | return (n == 1) ? singular : plural; 177 | return translated[Documentation.PLURALEXPR(n)]; 178 | }, 179 | 180 | addTranslations : function(catalog) { 181 | for (var key in catalog.messages) 182 | this.TRANSLATIONS[key] = catalog.messages[key]; 183 | this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); 184 | this.LOCALE = catalog.locale; 185 | }, 186 | 187 | /** 188 | * add context elements like header anchor links 189 | */ 190 | addContextElements : function() { 191 | $('div[id] > :header:first').each(function() { 192 | $('\u00B6'). 193 | attr('href', '#' + this.id). 194 | attr('title', _('Permalink to this headline')). 195 | appendTo(this); 196 | }); 197 | $('dt[id]').each(function() { 198 | $('\u00B6'). 199 | attr('href', '#' + this.id). 200 | attr('title', _('Permalink to this definition')). 201 | appendTo(this); 202 | }); 203 | }, 204 | 205 | /** 206 | * workaround a firefox stupidity 207 | * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 208 | */ 209 | fixFirefoxAnchorBug : function() { 210 | if (document.location.hash && $.browser.mozilla) 211 | window.setTimeout(function() { 212 | document.location.href += ''; 213 | }, 10); 214 | }, 215 | 216 | /** 217 | * highlight the search words provided in the url in the text 218 | */ 219 | highlightSearchWords : function() { 220 | var params = $.getQueryParameters(); 221 | var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; 222 | if (terms.length) { 223 | var body = $('div.body'); 224 | if (!body.length) { 225 | body = $('body'); 226 | } 227 | window.setTimeout(function() { 228 | $.each(terms, function() { 229 | body.highlightText(this.toLowerCase(), 'highlighted'); 230 | }); 231 | }, 10); 232 | $('') 234 | .appendTo($('#searchbox')); 235 | } 236 | }, 237 | 238 | /** 239 | * init the domain index toggle buttons 240 | */ 241 | initIndexTable : function() { 242 | var togglers = $('img.toggler').click(function() { 243 | var src = $(this).attr('src'); 244 | var idnum = $(this).attr('id').substr(7); 245 | $('tr.cg-' + idnum).toggle(); 246 | if (src.substr(-9) === 'minus.png') 247 | $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); 248 | else 249 | $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); 250 | }).css('display', ''); 251 | if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { 252 | togglers.click(); 253 | } 254 | }, 255 | 256 | /** 257 | * helper function to hide the search marks again 258 | */ 259 | hideSearchWords : function() { 260 | $('#searchbox .highlight-link').fadeOut(300); 261 | $('span.highlighted').removeClass('highlighted'); 262 | }, 263 | 264 | /** 265 | * make the url absolute 266 | */ 267 | makeURL : function(relativeURL) { 268 | return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; 269 | }, 270 | 271 | /** 272 | * get the current relative url 273 | */ 274 | getCurrentURL : function() { 275 | var path = document.location.pathname; 276 | var parts = path.split(/\//); 277 | $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { 278 | if (this === '..') 279 | parts.pop(); 280 | }); 281 | var url = parts.join('/'); 282 | return path.substring(url.lastIndexOf('/') + 1, path.length - 1); 283 | }, 284 | 285 | initOnKeyListeners: function() { 286 | $(document).keyup(function(event) { 287 | var activeElementType = document.activeElement.tagName; 288 | // don't navigate when in search box or textarea 289 | if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { 290 | switch (event.keyCode) { 291 | case 37: // left 292 | var prevHref = $('link[rel="prev"]').prop('href'); 293 | if (prevHref) { 294 | window.location.href = prevHref; 295 | return false; 296 | } 297 | case 39: // right 298 | var nextHref = $('link[rel="next"]').prop('href'); 299 | if (nextHref) { 300 | window.location.href = nextHref; 301 | return false; 302 | } 303 | } 304 | } 305 | }); 306 | } 307 | }; 308 | 309 | // quick alias for translations 310 | _ = Documentation.gettext; 311 | 312 | $(document).ready(function() { 313 | Documentation.init(); 314 | }); 315 | -------------------------------------------------------------------------------- /docs/build/html/_static/documentation_options.js: -------------------------------------------------------------------------------- 1 | var DOCUMENTATION_OPTIONS = { 2 | URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), 3 | VERSION: '1.3.2', 4 | LANGUAGE: 'None', 5 | COLLAPSE_INDEX: false, 6 | FILE_SUFFIX: '.html', 7 | HAS_SOURCE: true, 8 | SOURCELINK_SUFFIX: '.txt', 9 | NAVIGATION_WITH_KEYS: false 10 | }; -------------------------------------------------------------------------------- /docs/build/html/_static/down-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_static/down-pressed.png -------------------------------------------------------------------------------- /docs/build/html/_static/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_static/down.png -------------------------------------------------------------------------------- /docs/build/html/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_static/file.png -------------------------------------------------------------------------------- /docs/build/html/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_static/minus.png -------------------------------------------------------------------------------- /docs/build/html/_static/navigation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_static/navigation.png -------------------------------------------------------------------------------- /docs/build/html/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/_static/plus.png -------------------------------------------------------------------------------- /docs/build/html/_static/pygments.css: -------------------------------------------------------------------------------- 1 | .highlight .hll { background-color: #ffffcc } 2 | .highlight { background: #eeffcc; } 3 | .highlight .c { color: #408090; font-style: italic } /* Comment */ 4 | .highlight .err { border: 1px solid #FF0000 } /* Error */ 5 | .highlight .k { color: #007020; font-weight: bold } /* Keyword */ 6 | .highlight .o { color: #666666 } /* Operator */ 7 | .highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */ 8 | .highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ 9 | .highlight .cp { color: #007020 } /* Comment.Preproc */ 10 | .highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */ 11 | .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ 12 | .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ 13 | .highlight .gd { color: #A00000 } /* Generic.Deleted */ 14 | .highlight .ge { font-style: italic } /* Generic.Emph */ 15 | .highlight .gr { color: #FF0000 } /* Generic.Error */ 16 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ 17 | .highlight .gi { color: #00A000 } /* Generic.Inserted */ 18 | .highlight .go { color: #333333 } /* Generic.Output */ 19 | .highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ 20 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 21 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ 22 | .highlight .gt { color: #0044DD } /* Generic.Traceback */ 23 | .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ 24 | .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ 25 | .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ 26 | .highlight .kp { color: #007020 } /* Keyword.Pseudo */ 27 | .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ 28 | .highlight .kt { color: #902000 } /* Keyword.Type */ 29 | .highlight .m { color: #208050 } /* Literal.Number */ 30 | .highlight .s { color: #4070a0 } /* Literal.String */ 31 | .highlight .na { color: #4070a0 } /* Name.Attribute */ 32 | .highlight .nb { color: #007020 } /* Name.Builtin */ 33 | .highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ 34 | .highlight .no { color: #60add5 } /* Name.Constant */ 35 | .highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ 36 | .highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ 37 | .highlight .ne { color: #007020 } /* Name.Exception */ 38 | .highlight .nf { color: #06287e } /* Name.Function */ 39 | .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ 40 | .highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ 41 | .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ 42 | .highlight .nv { color: #bb60d5 } /* Name.Variable */ 43 | .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ 44 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */ 45 | .highlight .mb { color: #208050 } /* Literal.Number.Bin */ 46 | .highlight .mf { color: #208050 } /* Literal.Number.Float */ 47 | .highlight .mh { color: #208050 } /* Literal.Number.Hex */ 48 | .highlight .mi { color: #208050 } /* Literal.Number.Integer */ 49 | .highlight .mo { color: #208050 } /* Literal.Number.Oct */ 50 | .highlight .sa { color: #4070a0 } /* Literal.String.Affix */ 51 | .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ 52 | .highlight .sc { color: #4070a0 } /* Literal.String.Char */ 53 | .highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */ 54 | .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ 55 | .highlight .s2 { color: #4070a0 } /* Literal.String.Double */ 56 | .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ 57 | .highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ 58 | .highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ 59 | .highlight .sx { color: #c65d09 } /* Literal.String.Other */ 60 | .highlight .sr { color: #235388 } /* Literal.String.Regex */ 61 | .highlight .s1 { color: #4070a0 } /* Literal.String.Single */ 62 | .highlight .ss { color: #517918 } /* Literal.String.Symbol */ 63 | .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ 64 | .highlight .fm { color: #06287e } /* Name.Function.Magic */ 65 | .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ 66 | .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ 67 | .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ 68 | .highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */ 69 | .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /docs/build/html/_static/sidebar.js: -------------------------------------------------------------------------------- 1 | /* 2 | * sidebar.js 3 | * ~~~~~~~~~~ 4 | * 5 | * This script makes the Sphinx sidebar collapsible. 6 | * 7 | * .sphinxsidebar contains .sphinxsidebarwrapper. This script adds 8 | * in .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton 9 | * used to collapse and expand the sidebar. 10 | * 11 | * When the sidebar is collapsed the .sphinxsidebarwrapper is hidden 12 | * and the width of the sidebar and the margin-left of the document 13 | * are decreased. When the sidebar is expanded the opposite happens. 14 | * This script saves a per-browser/per-session cookie used to 15 | * remember the position of the sidebar among the pages. 16 | * Once the browser is closed the cookie is deleted and the position 17 | * reset to the default (expanded). 18 | * 19 | * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. 20 | * :license: BSD, see LICENSE for details. 21 | * 22 | */ 23 | 24 | $(function() { 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | // global elements used by the functions. 34 | // the 'sidebarbutton' element is defined as global after its 35 | // creation, in the add_sidebar_button function 36 | var bodywrapper = $('.bodywrapper'); 37 | var sidebar = $('.sphinxsidebar'); 38 | var sidebarwrapper = $('.sphinxsidebarwrapper'); 39 | 40 | // for some reason, the document has no sidebar; do not run into errors 41 | if (!sidebar.length) return; 42 | 43 | // original margin-left of the bodywrapper and width of the sidebar 44 | // with the sidebar expanded 45 | var bw_margin_expanded = bodywrapper.css('margin-left'); 46 | var ssb_width_expanded = sidebar.width(); 47 | 48 | // margin-left of the bodywrapper and width of the sidebar 49 | // with the sidebar collapsed 50 | var bw_margin_collapsed = '.8em'; 51 | var ssb_width_collapsed = '.8em'; 52 | 53 | // colors used by the current theme 54 | var dark_color = $('.related').css('background-color'); 55 | var light_color = $('.document').css('background-color'); 56 | 57 | function sidebar_is_collapsed() { 58 | return sidebarwrapper.is(':not(:visible)'); 59 | } 60 | 61 | function toggle_sidebar() { 62 | if (sidebar_is_collapsed()) 63 | expand_sidebar(); 64 | else 65 | collapse_sidebar(); 66 | } 67 | 68 | function collapse_sidebar() { 69 | sidebarwrapper.hide(); 70 | sidebar.css('width', ssb_width_collapsed); 71 | bodywrapper.css('margin-left', bw_margin_collapsed); 72 | sidebarbutton.css({ 73 | 'margin-left': '0', 74 | 'height': bodywrapper.height() 75 | }); 76 | sidebarbutton.find('span').text('»'); 77 | sidebarbutton.attr('title', _('Expand sidebar')); 78 | document.cookie = 'sidebar=collapsed'; 79 | } 80 | 81 | function expand_sidebar() { 82 | bodywrapper.css('margin-left', bw_margin_expanded); 83 | sidebar.css('width', ssb_width_expanded); 84 | sidebarwrapper.show(); 85 | sidebarbutton.css({ 86 | 'margin-left': ssb_width_expanded-12, 87 | 'height': bodywrapper.height() 88 | }); 89 | sidebarbutton.find('span').text('«'); 90 | sidebarbutton.attr('title', _('Collapse sidebar')); 91 | document.cookie = 'sidebar=expanded'; 92 | } 93 | 94 | function add_sidebar_button() { 95 | sidebarwrapper.css({ 96 | 'float': 'left', 97 | 'margin-right': '0', 98 | 'width': ssb_width_expanded - 28 99 | }); 100 | // create the button 101 | sidebar.append( 102 | '
«
' 103 | ); 104 | var sidebarbutton = $('#sidebarbutton'); 105 | light_color = sidebarbutton.css('background-color'); 106 | // find the height of the viewport to center the '<<' in the page 107 | var viewport_height; 108 | if (window.innerHeight) 109 | viewport_height = window.innerHeight; 110 | else 111 | viewport_height = $(window).height(); 112 | sidebarbutton.find('span').css({ 113 | 'display': 'block', 114 | 'margin-top': (viewport_height - sidebar.position().top - 20) / 2 115 | }); 116 | 117 | sidebarbutton.click(toggle_sidebar); 118 | sidebarbutton.attr('title', _('Collapse sidebar')); 119 | sidebarbutton.css({ 120 | 'color': '#FFFFFF', 121 | 'border-left': '1px solid ' + dark_color, 122 | 'font-size': '1.2em', 123 | 'cursor': 'pointer', 124 | 'height': bodywrapper.height(), 125 | 'padding-top': '1px', 126 | 'margin-left': ssb_width_expanded - 12 127 | }); 128 | 129 | sidebarbutton.hover( 130 | function () { 131 | $(this).css('background-color', dark_color); 132 | }, 133 | function () { 134 | $(this).css('background-color', light_color); 135 | } 136 | ); 137 | } 138 | 139 | function set_position_from_cookie() { 140 | if (!document.cookie) 141 | return; 142 | var items = document.cookie.split(';'); 143 | for(var k=0; k 3 | 4 | 5 | 6 | 7 | eqtools — eqtools 1.3.2 documentation 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 32 | 33 |
34 | 68 | 89 |
90 |
91 | 103 | 107 | 108 | -------------------------------------------------------------------------------- /docs/build/html/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/html/objects.inv -------------------------------------------------------------------------------- /docs/build/html/py-modindex.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Python Module Index — eqtools 1.3.2 documentation 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 35 | 36 |
37 |
38 |
39 |
40 | 41 | 42 |

Python Module Index

43 | 44 |
45 | e 46 |
47 | 48 | 49 | 50 | 52 | 53 | 55 | 58 | 59 | 60 | 63 | 64 | 65 | 68 | 69 | 70 | 73 | 74 | 75 | 78 | 79 | 80 | 83 | 84 | 85 | 88 | 89 | 90 | 93 | 94 | 95 | 98 | 99 | 100 | 103 | 104 | 105 | 108 | 109 | 110 | 113 | 114 | 115 | 118 |
 
51 | e
56 | eqtools 57 |
    61 | eqtools.afilereader 62 |
    66 | eqtools.AUGData 67 |
    71 | eqtools.CModEFIT 72 |
    76 | eqtools.core 77 |
    81 | eqtools.D3DEFIT 82 |
    86 | eqtools.EFIT 87 |
    91 | eqtools.eqdskreader 92 |
    96 | eqtools.FromArrays 97 |
    101 | eqtools.NSTXEFIT 102 |
    106 | eqtools.pfilereader 107 |
    111 | eqtools.TCVLIUQE 112 |
    116 | eqtools.trispline 117 |
119 | 120 | 121 |
122 |
123 |
124 | 138 |
139 |
140 | 152 | 156 | 157 | -------------------------------------------------------------------------------- /docs/build/html/search.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Search — eqtools 1.3.2 documentation 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 37 | 38 |
39 |
40 |
41 |
42 | 43 |

Search

44 |
45 | 46 |

47 | Please activate JavaScript to enable the search 48 | functionality. 49 |

50 |
51 |

52 | From here you can search these documents. Enter your search 53 | words into the box below and click "search". Note that the search 54 | function will automatically search for all of the words. Pages 55 | containing fewer words won't appear in the result list. 56 |

57 |
58 | 59 | 60 | 61 |
62 | 63 |
64 | 65 |
66 | 67 |
68 |
69 |
70 | 74 |
75 |
76 | 88 | 92 | 93 | -------------------------------------------------------------------------------- /docs/build/latex/LICRcyr2utf8.xdy: -------------------------------------------------------------------------------- 1 | ;; -*- coding: utf-8; mode: Lisp; -*- 2 | ;; style file for xindy 3 | ;; filename: LICRcyr2utf8.xdy 4 | ;; description: style file for xindy which maps back LaTeX Internal 5 | ;; Character Representation of Cyrillic to utf-8 6 | ;; usage: for use with pdflatex produced .idx files. 7 | ;; Contributed by the Sphinx team, July 2018. 8 | (merge-rule "\IeC {\'\CYRG }" "Ѓ" :string) 9 | (merge-rule "\IeC {\'\CYRK }" "Ќ" :string) 10 | (merge-rule "\IeC {\'\cyrg }" "ѓ" :string) 11 | (merge-rule "\IeC {\'\cyrk }" "ќ" :string) 12 | (merge-rule "\IeC {\CYRA }" "А" :string) 13 | (merge-rule "\IeC {\CYRB }" "Б" :string) 14 | (merge-rule "\IeC {\CYRC }" "Ц" :string) 15 | (merge-rule "\IeC {\CYRCH }" "Ч" :string) 16 | (merge-rule "\IeC {\CYRD }" "Д" :string) 17 | (merge-rule "\IeC {\CYRDJE }" "Ђ" :string) 18 | (merge-rule "\IeC {\CYRDZE }" "Ѕ" :string) 19 | (merge-rule "\IeC {\CYRDZHE }" "Џ" :string) 20 | (merge-rule "\IeC {\CYRE }" "Е" :string) 21 | (merge-rule "\IeC {\CYREREV }" "Э" :string) 22 | (merge-rule "\IeC {\CYRERY }" "Ы" :string) 23 | (merge-rule "\IeC {\CYRF }" "Ф" :string) 24 | (merge-rule "\IeC {\CYRG }" "Г" :string) 25 | (merge-rule "\IeC {\CYRGUP }" "Ґ" :string) 26 | (merge-rule "\IeC {\CYRH }" "Х" :string) 27 | (merge-rule "\IeC {\CYRHRDSN }" "Ъ" :string) 28 | (merge-rule "\IeC {\CYRI }" "И" :string) 29 | (merge-rule "\IeC {\CYRIE }" "Є" :string) 30 | (merge-rule "\IeC {\CYRII }" "І" :string) 31 | (merge-rule "\IeC {\CYRISHRT }" "Й" :string) 32 | (merge-rule "\IeC {\CYRJE }" "Ј" :string) 33 | (merge-rule "\IeC {\CYRK }" "К" :string) 34 | (merge-rule "\IeC {\CYRL }" "Л" :string) 35 | (merge-rule "\IeC {\CYRLJE }" "Љ" :string) 36 | (merge-rule "\IeC {\CYRM }" "М" :string) 37 | (merge-rule "\IeC {\CYRN }" "Н" :string) 38 | (merge-rule "\IeC {\CYRNJE }" "Њ" :string) 39 | (merge-rule "\IeC {\CYRO }" "О" :string) 40 | (merge-rule "\IeC {\CYRP }" "П" :string) 41 | (merge-rule "\IeC {\CYRR }" "Р" :string) 42 | (merge-rule "\IeC {\CYRS }" "С" :string) 43 | (merge-rule "\IeC {\CYRSFTSN }" "Ь" :string) 44 | (merge-rule "\IeC {\CYRSH }" "Ш" :string) 45 | (merge-rule "\IeC {\CYRSHCH }" "Щ" :string) 46 | (merge-rule "\IeC {\CYRT }" "Т" :string) 47 | (merge-rule "\IeC {\CYRTSHE }" "Ћ" :string) 48 | (merge-rule "\IeC {\CYRU }" "У" :string) 49 | (merge-rule "\IeC {\CYRUSHRT }" "Ў" :string) 50 | (merge-rule "\IeC {\CYRV }" "В" :string) 51 | (merge-rule "\IeC {\CYRYA }" "Я" :string) 52 | (merge-rule "\IeC {\CYRYI }" "Ї" :string) 53 | (merge-rule "\IeC {\CYRYO }" "Ё" :string) 54 | (merge-rule "\IeC {\CYRYU }" "Ю" :string) 55 | (merge-rule "\IeC {\CYRZ }" "З" :string) 56 | (merge-rule "\IeC {\CYRZH }" "Ж" :string) 57 | (merge-rule "\IeC {\cyra }" "а" :string) 58 | (merge-rule "\IeC {\cyrb }" "б" :string) 59 | (merge-rule "\IeC {\cyrc }" "ц" :string) 60 | (merge-rule "\IeC {\cyrch }" "ч" :string) 61 | (merge-rule "\IeC {\cyrd }" "д" :string) 62 | (merge-rule "\IeC {\cyrdje }" "ђ" :string) 63 | (merge-rule "\IeC {\cyrdze }" "ѕ" :string) 64 | (merge-rule "\IeC {\cyrdzhe }" "џ" :string) 65 | (merge-rule "\IeC {\cyre }" "е" :string) 66 | (merge-rule "\IeC {\cyrerev }" "э" :string) 67 | (merge-rule "\IeC {\cyrery }" "ы" :string) 68 | (merge-rule "\IeC {\cyrf }" "ф" :string) 69 | (merge-rule "\IeC {\cyrg }" "г" :string) 70 | (merge-rule "\IeC {\cyrgup }" "ґ" :string) 71 | (merge-rule "\IeC {\cyrh }" "х" :string) 72 | (merge-rule "\IeC {\cyrhrdsn }" "ъ" :string) 73 | (merge-rule "\IeC {\cyri }" "и" :string) 74 | (merge-rule "\IeC {\cyrie }" "є" :string) 75 | (merge-rule "\IeC {\cyrii }" "і" :string) 76 | (merge-rule "\IeC {\cyrishrt }" "й" :string) 77 | (merge-rule "\IeC {\cyrje }" "ј" :string) 78 | (merge-rule "\IeC {\cyrk }" "к" :string) 79 | (merge-rule "\IeC {\cyrl }" "л" :string) 80 | (merge-rule "\IeC {\cyrlje }" "љ" :string) 81 | (merge-rule "\IeC {\cyrm }" "м" :string) 82 | (merge-rule "\IeC {\cyrn }" "н" :string) 83 | (merge-rule "\IeC {\cyrnje }" "њ" :string) 84 | (merge-rule "\IeC {\cyro }" "о" :string) 85 | (merge-rule "\IeC {\cyrp }" "п" :string) 86 | (merge-rule "\IeC {\cyrr }" "р" :string) 87 | (merge-rule "\IeC {\cyrs }" "с" :string) 88 | (merge-rule "\IeC {\cyrsftsn }" "ь" :string) 89 | (merge-rule "\IeC {\cyrsh }" "ш" :string) 90 | (merge-rule "\IeC {\cyrshch }" "щ" :string) 91 | (merge-rule "\IeC {\cyrt }" "т" :string) 92 | (merge-rule "\IeC {\cyrtshe }" "ћ" :string) 93 | (merge-rule "\IeC {\cyru }" "у" :string) 94 | (merge-rule "\IeC {\cyrushrt }" "ў" :string) 95 | (merge-rule "\IeC {\cyrv }" "в" :string) 96 | (merge-rule "\IeC {\cyrya }" "я" :string) 97 | (merge-rule "\IeC {\cyryi }" "ї" :string) 98 | (merge-rule "\IeC {\cyryo }" "ё" :string) 99 | (merge-rule "\IeC {\cyryu }" "ю" :string) 100 | (merge-rule "\IeC {\cyrz }" "з" :string) 101 | (merge-rule "\IeC {\cyrzh }" "ж" :string) 102 | -------------------------------------------------------------------------------- /docs/build/latex/LatinRules.xdy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/latex/LatinRules.xdy -------------------------------------------------------------------------------- /docs/build/latex/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx LaTeX output 2 | 3 | ALLDOCS = $(basename $(wildcard *.tex)) 4 | ALLPDF = $(addsuffix .pdf,$(ALLDOCS)) 5 | ALLDVI = $(addsuffix .dvi,$(ALLDOCS)) 6 | ALLXDV = 7 | ALLPS = $(addsuffix .ps,$(ALLDOCS)) 8 | ALLIMGS = $(wildcard *.png *.gif *.jpg *.jpeg) 9 | 10 | # Prefix for archive names 11 | ARCHIVEPREFIX = 12 | # Additional LaTeX options (passed via variables in latexmkrc/latexmkjarc file) 13 | export LATEXOPTS = 14 | # Additional latexmk options 15 | LATEXMKOPTS = 16 | # format: pdf or dvi (used only by archive targets) 17 | FMT = pdf 18 | 19 | LATEX = latexmk -dvi 20 | PDFLATEX = latexmk -pdf -dvi- -ps- 21 | 22 | 23 | %.png %.gif %.jpg %.jpeg: FORCE_MAKE 24 | extractbb '$@' 25 | 26 | %.dvi: %.tex FORCE_MAKE 27 | $(LATEX) $(LATEXMKOPTS) '$<' 28 | 29 | %.ps: %.dvi 30 | dvips '$<' 31 | 32 | %.pdf: %.tex FORCE_MAKE 33 | $(PDFLATEX) $(LATEXMKOPTS) '$<' 34 | 35 | all: $(ALLPDF) 36 | 37 | all-dvi: $(ALLDVI) 38 | 39 | all-ps: $(ALLPS) 40 | 41 | all-pdf: $(ALLPDF) 42 | 43 | zip: all-$(FMT) 44 | mkdir $(ARCHIVEPREFIX)docs-$(FMT) 45 | cp $(ALLPDF) $(ARCHIVEPREFIX)docs-$(FMT) 46 | zip -q -r -9 $(ARCHIVEPREFIX)docs-$(FMT).zip $(ARCHIVEPREFIX)docs-$(FMT) 47 | rm -r $(ARCHIVEPREFIX)docs-$(FMT) 48 | 49 | tar: all-$(FMT) 50 | mkdir $(ARCHIVEPREFIX)docs-$(FMT) 51 | cp $(ALLPDF) $(ARCHIVEPREFIX)docs-$(FMT) 52 | tar cf $(ARCHIVEPREFIX)docs-$(FMT).tar $(ARCHIVEPREFIX)docs-$(FMT) 53 | rm -r $(ARCHIVEPREFIX)docs-$(FMT) 54 | 55 | gz: tar 56 | gzip -9 < $(ARCHIVEPREFIX)docs-$(FMT).tar > $(ARCHIVEPREFIX)docs-$(FMT).tar.gz 57 | 58 | bz2: tar 59 | bzip2 -9 -k $(ARCHIVEPREFIX)docs-$(FMT).tar 60 | 61 | xz: tar 62 | xz -9 -k $(ARCHIVEPREFIX)docs-$(FMT).tar 63 | 64 | clean: 65 | rm -f *.log *.ind *.aux *.toc *.syn *.idx *.out *.ilg *.pla *.ps *.tar *.tar.gz *.tar.bz2 *.tar.xz $(ALLPDF) $(ALLDVI) $(ALLXDV) *.fls *.fdb_latexmk 66 | 67 | .PHONY: all all-pdf all-dvi all-ps clean zip tar gz bz2 xz 68 | .PHONY: FORCE_MAKE -------------------------------------------------------------------------------- /docs/build/latex/eqtools.ilg: -------------------------------------------------------------------------------- 1 | This is makeindex, version 2.15 [TeX Live 2019] (kpathsea + Thai support). 2 | Scanning style file ./python.ist.......done (7 attributes redefined, 0 ignored). 3 | Scanning input file eqtools.idx....done (479 entries accepted, 0 rejected). 4 | Sorting entries.......done (5006 comparisons). 5 | Generating output file eqtools.ind....done (573 lines written, 0 warnings). 6 | Output written in eqtools.ind. 7 | Transcript written in eqtools.ilg. 8 | -------------------------------------------------------------------------------- /docs/build/latex/eqtools.out: -------------------------------------------------------------------------------- 1 | \BOOKMARK [0][-]{chapter.1}{\376\377\000O\000v\000e\000r\000v\000i\000e\000w}{}% 1 2 | \BOOKMARK [0][-]{chapter.2}{\376\377\000I\000n\000s\000t\000a\000l\000l\000a\000t\000i\000o\000n}{}% 2 3 | \BOOKMARK [0][-]{chapter.3}{\376\377\000T\000u\000t\000o\000r\000i\000a\000l\000:\000\040\000P\000e\000r\000f\000o\000r\000m\000i\000n\000g\000\040\000C\000o\000o\000r\000d\000i\000n\000a\000t\000e\000\040\000T\000r\000a\000n\000s\000f\000o\000r\000m\000s\000\040\000o\000n\000\040\000A\000l\000c\000a\000t\000o\000r\000\040\000C\000-\000M\000o\000d\000\040\000D\000a\000t\000a}{}% 3 4 | \BOOKMARK [0][-]{chapter.4}{\376\377\000P\000a\000c\000k\000a\000g\000e\000\040\000R\000e\000f\000e\000r\000e\000n\000c\000e}{}% 4 5 | \BOOKMARK [1][-]{section.4.1}{\376\377\000e\000q\000t\000o\000o\000l\000s\000\040\000p\000a\000c\000k\000a\000g\000e}{chapter.4}% 5 6 | \BOOKMARK [2][-]{subsection.4.1.1}{\376\377\000S\000u\000b\000m\000o\000d\000u\000l\000e\000s}{section.4.1}% 6 7 | \BOOKMARK [2][-]{subsection.4.1.2}{\376\377\000e\000q\000t\000o\000o\000l\000s\000.\000A\000U\000G\000D\000a\000t\000a\000\040\000m\000o\000d\000u\000l\000e}{section.4.1}% 7 8 | \BOOKMARK [2][-]{subsection.4.1.3}{\376\377\000e\000q\000t\000o\000o\000l\000s\000.\000C\000M\000o\000d\000E\000F\000I\000T\000\040\000m\000o\000d\000u\000l\000e}{section.4.1}% 8 9 | \BOOKMARK [2][-]{subsection.4.1.4}{\376\377\000e\000q\000t\000o\000o\000l\000s\000.\000D\0003\000D\000E\000F\000I\000T\000\040\000m\000o\000d\000u\000l\000e}{section.4.1}% 9 10 | \BOOKMARK [2][-]{subsection.4.1.5}{\376\377\000e\000q\000t\000o\000o\000l\000s\000.\000E\000F\000I\000T\000\040\000m\000o\000d\000u\000l\000e}{section.4.1}% 10 11 | \BOOKMARK [2][-]{subsection.4.1.6}{\376\377\000e\000q\000t\000o\000o\000l\000s\000.\000F\000r\000o\000m\000A\000r\000r\000a\000y\000s\000\040\000m\000o\000d\000u\000l\000e}{section.4.1}% 11 12 | \BOOKMARK [2][-]{subsection.4.1.7}{\376\377\000e\000q\000t\000o\000o\000l\000s\000.\000N\000S\000T\000X\000E\000F\000I\000T\000\040\000m\000o\000d\000u\000l\000e}{section.4.1}% 12 13 | \BOOKMARK [2][-]{subsection.4.1.8}{\376\377\000e\000q\000t\000o\000o\000l\000s\000.\000T\000C\000V\000L\000I\000U\000Q\000E\000\040\000m\000o\000d\000u\000l\000e}{section.4.1}% 13 14 | \BOOKMARK [2][-]{subsection.4.1.9}{\376\377\000e\000q\000t\000o\000o\000l\000s\000.\000a\000f\000i\000l\000e\000r\000e\000a\000d\000e\000r\000\040\000m\000o\000d\000u\000l\000e}{section.4.1}% 14 15 | \BOOKMARK [2][-]{subsection.4.1.10}{\376\377\000e\000q\000t\000o\000o\000l\000s\000.\000c\000o\000r\000e\000\040\000m\000o\000d\000u\000l\000e}{section.4.1}% 15 16 | \BOOKMARK [2][-]{subsection.4.1.11}{\376\377\000e\000q\000t\000o\000o\000l\000s\000.\000e\000q\000d\000s\000k\000r\000e\000a\000d\000e\000r\000\040\000m\000o\000d\000u\000l\000e}{section.4.1}% 16 17 | \BOOKMARK [2][-]{subsection.4.1.12}{\376\377\000e\000q\000t\000o\000o\000l\000s\000.\000f\000i\000l\000e\000w\000r\000i\000t\000e\000r\000\040\000m\000o\000d\000u\000l\000e}{section.4.1}% 17 18 | \BOOKMARK [2][-]{subsection.4.1.13}{\376\377\000e\000q\000t\000o\000o\000l\000s\000.\000p\000f\000i\000l\000e\000r\000e\000a\000d\000e\000r\000\040\000m\000o\000d\000u\000l\000e}{section.4.1}% 18 19 | \BOOKMARK [2][-]{subsection.4.1.14}{\376\377\000e\000q\000t\000o\000o\000l\000s\000.\000t\000r\000i\000s\000p\000l\000i\000n\000e\000\040\000m\000o\000d\000u\000l\000e}{section.4.1}% 19 20 | \BOOKMARK [2][-]{subsection.4.1.15}{\376\377\000M\000o\000d\000u\000l\000e\000\040\000c\000o\000n\000t\000e\000n\000t\000s}{section.4.1}% 20 21 | \BOOKMARK [0][-]{chapter.5}{\376\377\000I\000n\000d\000i\000c\000e\000s\000\040\000a\000n\000d\000\040\000t\000a\000b\000l\000e\000s}{}% 21 22 | \BOOKMARK [0][-]{section*.469}{\376\377\000P\000y\000t\000h\000o\000n\000\040\000M\000o\000d\000u\000l\000e\000\040\000I\000n\000d\000e\000x}{}% 22 23 | \BOOKMARK [0][-]{section*.470}{\376\377\000I\000n\000d\000e\000x}{}% 23 24 | -------------------------------------------------------------------------------- /docs/build/latex/eqtools.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSFCPlasmaTools/eqtools/88525bd6edf096f46ff64dcd062827fa3706ffc0/docs/build/latex/eqtools.pdf -------------------------------------------------------------------------------- /docs/build/latex/eqtools.toc: -------------------------------------------------------------------------------- 1 | \babel@toc {english}{} 2 | \contentsline {chapter}{\numberline {1}Overview}{3}{chapter.1}% 3 | \contentsline {chapter}{\numberline {2}Installation}{5}{chapter.2}% 4 | \contentsline {chapter}{\numberline {3}Tutorial: Performing Coordinate Transforms on Alcator C-Mod Data}{7}{chapter.3}% 5 | \contentsline {chapter}{\numberline {4}Package Reference}{9}{chapter.4}% 6 | \contentsline {section}{\numberline {4.1}eqtools package}{9}{section.4.1}% 7 | \contentsline {subsection}{\numberline {4.1.1}Submodules}{9}{subsection.4.1.1}% 8 | \contentsline {subsection}{\numberline {4.1.2}eqtools.AUGData module}{9}{subsection.4.1.2}% 9 | \contentsline {subsection}{\numberline {4.1.3}eqtools.CModEFIT module}{22}{subsection.4.1.3}% 10 | \contentsline {subsection}{\numberline {4.1.4}eqtools.D3DEFIT module}{24}{subsection.4.1.4}% 11 | \contentsline {subsection}{\numberline {4.1.5}eqtools.EFIT module}{26}{subsection.4.1.5}% 12 | \contentsline {subsection}{\numberline {4.1.6}eqtools.FromArrays module}{36}{subsection.4.1.6}% 13 | \contentsline {subsection}{\numberline {4.1.7}eqtools.NSTXEFIT module}{37}{subsection.4.1.7}% 14 | \contentsline {subsection}{\numberline {4.1.8}eqtools.TCVLIUQE module}{40}{subsection.4.1.8}% 15 | \contentsline {subsection}{\numberline {4.1.9}eqtools.afilereader module}{47}{subsection.4.1.9}% 16 | \contentsline {subsection}{\numberline {4.1.10}eqtools.core module}{47}{subsection.4.1.10}% 17 | \contentsline {subsection}{\numberline {4.1.11}eqtools.eqdskreader module}{166}{subsection.4.1.11}% 18 | \contentsline {subsection}{\numberline {4.1.12}eqtools.filewriter module}{184}{subsection.4.1.12}% 19 | \contentsline {subsection}{\numberline {4.1.13}eqtools.pfilereader module}{184}{subsection.4.1.13}% 20 | \contentsline {subsection}{\numberline {4.1.14}eqtools.trispline module}{185}{subsection.4.1.14}% 21 | \contentsline {subsection}{\numberline {4.1.15}Module contents}{187}{subsection.4.1.15}% 22 | \contentsline {chapter}{\numberline {5}Indices and tables}{189}{chapter.5}% 23 | \contentsline {chapter}{Python Module Index}{191}{section*.469}% 24 | \contentsline {chapter}{Index}{193}{section*.470}% 25 | -------------------------------------------------------------------------------- /docs/build/latex/footnotehyper-sphinx.sty: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e} 2 | \ProvidesPackage{footnotehyper-sphinx}% 3 | [2017/10/27 v1.7 hyperref aware footnote.sty for sphinx (JFB)] 4 | %% 5 | %% Package: footnotehyper-sphinx 6 | %% Version: based on footnotehyper.sty 2017/03/07 v1.0 7 | %% as available at https://www.ctan.org/pkg/footnotehyper 8 | %% License: the one applying to Sphinx 9 | %% 10 | %% Refer to the PDF documentation at https://www.ctan.org/pkg/footnotehyper for 11 | %% the code comments. 12 | %% 13 | %% Differences: 14 | %% 1. a partial tabulary compatibility layer added (enough for Sphinx mark-up), 15 | %% 2. use of \spx@opt@BeforeFootnote from sphinx.sty, 16 | %% 3. use of \sphinxunactivateextrasandspace from sphinx.sty, 17 | %% 4. macro definition \sphinxfootnotemark, 18 | %% 5. macro definition \sphinxlongtablepatch 19 | %% 6. replaced an \undefined by \@undefined 20 | \DeclareOption*{\PackageWarning{footnotehyper-sphinx}{Option `\CurrentOption' is unknown}}% 21 | \ProcessOptions\relax 22 | \newbox\FNH@notes 23 | \newdimen\FNH@width 24 | \let\FNH@colwidth\columnwidth 25 | \newif\ifFNH@savingnotes 26 | \AtBeginDocument {% 27 | \let\FNH@latex@footnote \footnote 28 | \let\FNH@latex@footnotetext\footnotetext 29 | \let\FNH@H@@footnotetext \@footnotetext 30 | \newenvironment{savenotes} 31 | {\FNH@savenotes\ignorespaces}{\FNH@spewnotes\ignorespacesafterend}% 32 | \let\spewnotes \FNH@spewnotes 33 | \let\footnote \FNH@footnote 34 | \let\footnotetext \FNH@footnotetext 35 | \let\endfootnote \FNH@endfntext 36 | \let\endfootnotetext\FNH@endfntext 37 | \@ifpackageloaded{hyperref} 38 | {\ifHy@hyperfootnotes 39 | \let\FNH@H@@footnotetext\H@@footnotetext 40 | \else 41 | \let\FNH@hyper@fntext\FNH@nohyp@fntext 42 | \fi}% 43 | {\let\FNH@hyper@fntext\FNH@nohyp@fntext}% 44 | }% 45 | \def\FNH@hyper@fntext{\FNH@fntext\FNH@hyper@fntext@i}% 46 | \def\FNH@nohyp@fntext{\FNH@fntext\FNH@nohyp@fntext@i}% 47 | \def\FNH@fntext #1{% 48 | \ifx\ifmeasuring@\@undefined 49 | \expandafter\@secondoftwo\else\expandafter\@firstofone\fi 50 | % these two lines modified for Sphinx (tabulary compatibility): 51 | {\ifmeasuring@\expandafter\@gobbletwo\else\expandafter\@firstofone\fi}% 52 | {\ifx\equation$\expandafter\@gobbletwo\fi #1}%$ 53 | }% 54 | \long\def\FNH@hyper@fntext@i#1{% 55 | \global\setbox\FNH@notes\vbox 56 | {\unvbox\FNH@notes 57 | \FNH@startnote 58 | \@makefntext 59 | {\rule\z@\footnotesep\ignorespaces 60 | \ifHy@nesting\expandafter\ltx@firstoftwo 61 | \else\expandafter\ltx@secondoftwo 62 | \fi 63 | {\expandafter\hyper@@anchor\expandafter{\Hy@footnote@currentHref}{#1}}% 64 | {\Hy@raisedlink 65 | {\expandafter\hyper@@anchor\expandafter{\Hy@footnote@currentHref}% 66 | {\relax}}% 67 | \let\@currentHref\Hy@footnote@currentHref 68 | \let\@currentlabelname\@empty 69 | #1}% 70 | \@finalstrut\strutbox 71 | }% 72 | \FNH@endnote 73 | }% 74 | }% 75 | \long\def\FNH@nohyp@fntext@i#1{% 76 | \global\setbox\FNH@notes\vbox 77 | {\unvbox\FNH@notes 78 | \FNH@startnote 79 | \@makefntext{\rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% 80 | \FNH@endnote 81 | }% 82 | }% 83 | \def\FNH@startnote{% 84 | \hsize\FNH@colwidth 85 | \interlinepenalty\interfootnotelinepenalty 86 | \reset@font\footnotesize 87 | \floatingpenalty\@MM 88 | \@parboxrestore 89 | \protected@edef\@currentlabel{\csname p@\@mpfn\endcsname\@thefnmark}% 90 | \color@begingroup 91 | }% 92 | \def\FNH@endnote{\color@endgroup}% 93 | \def\FNH@savenotes{% 94 | \begingroup 95 | \ifFNH@savingnotes\else 96 | \FNH@savingnotestrue 97 | \let\@footnotetext \FNH@hyper@fntext 98 | \let\@mpfootnotetext \FNH@hyper@fntext 99 | \let\H@@mpfootnotetext\FNH@nohyp@fntext 100 | \FNH@width\columnwidth 101 | \let\FNH@colwidth\FNH@width 102 | \global\setbox\FNH@notes\box\voidb@x 103 | \let\FNH@thempfn\thempfn 104 | \let\FNH@mpfn\@mpfn 105 | \ifx\@minipagerestore\relax\let\@minipagerestore\@empty\fi 106 | \expandafter\def\expandafter\@minipagerestore\expandafter{% 107 | \@minipagerestore 108 | \let\thempfn\FNH@thempfn 109 | \let\@mpfn\FNH@mpfn 110 | }% 111 | \fi 112 | }% 113 | \def\FNH@spewnotes {% 114 | \endgroup 115 | \ifFNH@savingnotes\else 116 | \ifvoid\FNH@notes\else 117 | \begingroup 118 | \let\@makefntext\@empty 119 | \let\@finalstrut\@gobble 120 | \let\rule\@gobbletwo 121 | \FNH@H@@footnotetext{\unvbox\FNH@notes}% 122 | \endgroup 123 | \fi 124 | \fi 125 | }% 126 | \def\FNH@footnote@envname {footnote}% 127 | \def\FNH@footnotetext@envname{footnotetext}% 128 | \def\FNH@footnote{% 129 | % this line added for Sphinx: 130 | \spx@opt@BeforeFootnote 131 | \ifx\@currenvir\FNH@footnote@envname 132 | \expandafter\FNH@footnoteenv 133 | \else 134 | \expandafter\FNH@latex@footnote 135 | \fi 136 | }% 137 | \def\FNH@footnoteenv{% 138 | % this line added for Sphinx (footnotes in parsed literal blocks): 139 | \catcode13=5 \sphinxunactivateextrasandspace 140 | \@ifnextchar[% 141 | \FNH@footnoteenv@i %] 142 | {\stepcounter\@mpfn 143 | \protected@xdef\@thefnmark{\thempfn}% 144 | \@footnotemark 145 | \def\FNH@endfntext@fntext{\@footnotetext}% 146 | \FNH@startfntext}% 147 | }% 148 | \def\FNH@footnoteenv@i[#1]{% 149 | \begingroup 150 | \csname c@\@mpfn\endcsname #1\relax 151 | \unrestored@protected@xdef\@thefnmark{\thempfn}% 152 | \endgroup 153 | \@footnotemark 154 | \def\FNH@endfntext@fntext{\@footnotetext}% 155 | \FNH@startfntext 156 | }% 157 | \def\FNH@footnotetext{% 158 | \ifx\@currenvir\FNH@footnotetext@envname 159 | \expandafter\FNH@footnotetextenv 160 | \else 161 | \expandafter\FNH@latex@footnotetext 162 | \fi 163 | }% 164 | \def\FNH@footnotetextenv{% 165 | \@ifnextchar[% 166 | \FNH@footnotetextenv@i %] 167 | {\protected@xdef\@thefnmark{\thempfn}% 168 | \def\FNH@endfntext@fntext{\@footnotetext}% 169 | \FNH@startfntext}% 170 | }% 171 | \def\FNH@footnotetextenv@i[#1]{% 172 | \begingroup 173 | \csname c@\@mpfn\endcsname #1\relax 174 | \unrestored@protected@xdef\@thefnmark{\thempfn}% 175 | \endgroup 176 | \ifFNH@savingnotes 177 | \def\FNH@endfntext@fntext{\FNH@nohyp@fntext}% 178 | \else 179 | \def\FNH@endfntext@fntext{\FNH@H@@footnotetext}% 180 | \fi 181 | \FNH@startfntext 182 | }% 183 | \def\FNH@startfntext{% 184 | \setbox\z@\vbox\bgroup 185 | \FNH@startnote 186 | \FNH@prefntext 187 | \rule\z@\footnotesep\ignorespaces 188 | }% 189 | \def\FNH@endfntext {% 190 | \@finalstrut\strutbox 191 | \FNH@postfntext 192 | \FNH@endnote 193 | \egroup 194 | \begingroup 195 | \let\@makefntext\@empty\let\@finalstrut\@gobble\let\rule\@gobbletwo 196 | \FNH@endfntext@fntext {\unvbox\z@}% 197 | \endgroup 198 | }% 199 | \AtBeginDocument{% 200 | \let\FNH@@makefntext\@makefntext 201 | \ifx\@makefntextFB\@undefined 202 | \expandafter\@gobble\else\expandafter\@firstofone\fi 203 | {\ifFBFrenchFootnotes \let\FNH@@makefntext\@makefntextFB \else 204 | \let\FNH@@makefntext\@makefntextORI\fi}% 205 | \expandafter\FNH@check@a\FNH@@makefntext{1.2!3?4,}% 206 | \FNH@@@1.2!3?4,\FNH@@@\relax 207 | }% 208 | \long\def\FNH@check@a #11.2!3?4,#2\FNH@@@#3{% 209 | \ifx\relax#3\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi 210 | \FNH@bad@makefntext@alert 211 | {\def\FNH@prefntext{#1}\def\FNH@postfntext{#2}\FNH@check@b}% 212 | }% 213 | \def\FNH@check@b #1\relax{% 214 | \expandafter\expandafter\expandafter\FNH@check@c 215 | \expandafter\meaning\expandafter\FNH@prefntext 216 | \meaning\FNH@postfntext1.2!3?4,\FNH@check@c\relax 217 | }% 218 | \def\FNH@check@c #11.2!3?4,#2#3\relax{% 219 | \ifx\FNH@check@c#2\expandafter\@gobble\fi\FNH@bad@makefntext@alert 220 | }% 221 | % slight reformulation for Sphinx 222 | \def\FNH@bad@makefntext@alert{% 223 | \PackageWarningNoLine{footnotehyper-sphinx}% 224 | {Footnotes will be sub-optimal, sorry. This is due to the document class or^^J 225 | some package modifying macro \string\@makefntext.^^J 226 | You can try to report this incompatibility at^^J 227 | https://github.com/sphinx-doc/sphinx with this info:}% 228 | \typeout{\meaning\@makefntext}% 229 | \let\FNH@prefntext\@empty\let\FNH@postfntext\@empty 230 | }% 231 | % this macro from original footnote.sty is not used anymore by Sphinx 232 | % but for simplicity sake let's just keep it as is 233 | \def\makesavenoteenv{\@ifnextchar[\FNH@msne@ii\FNH@msne@i}%] 234 | \def\FNH@msne@i #1{% 235 | \expandafter\let\csname FNH$#1\expandafter\endcsname %$ 236 | \csname #1\endcsname 237 | \expandafter\let\csname endFNH$#1\expandafter\endcsname %$ 238 | \csname end#1\endcsname 239 | \FNH@msne@ii[#1]{FNH$#1}%$ 240 | }% 241 | \def\FNH@msne@ii[#1]#2{% 242 | \expandafter\edef\csname#1\endcsname{% 243 | \noexpand\savenotes 244 | \expandafter\noexpand\csname#2\endcsname 245 | }% 246 | \expandafter\edef\csname end#1\endcsname{% 247 | \expandafter\noexpand\csname end#2\endcsname 248 | \noexpand\expandafter 249 | \noexpand\spewnotes 250 | \noexpand\if@endpe\noexpand\@endpetrue\noexpand\fi 251 | }% 252 | }% 253 | % end of footnotehyper 2017/02/16 v0.99 254 | % some extras for Sphinx : 255 | % \sphinxfootnotemark: usable in section titles and silently removed from TOCs. 256 | \def\sphinxfootnotemark [#1]% 257 | {\ifx\thepage\relax\else\protect\spx@opt@BeforeFootnote 258 | \protect\footnotemark[#1]\fi}% 259 | \AtBeginDocument{% 260 | % let hyperref less complain 261 | \pdfstringdefDisableCommands{\def\sphinxfootnotemark [#1]{}}% 262 | % to obtain hyperlinked footnotes in longtable environment we must replace 263 | % hyperref's patch of longtable's patch of \@footnotetext by our own 264 | \let\LT@p@ftntext\FNH@hyper@fntext 265 | % this *requires* longtable to be used always wrapped in savenotes environment 266 | }% 267 | \endinput 268 | %% 269 | %% End of file `footnotehyper-sphinx.sty'. 270 | -------------------------------------------------------------------------------- /docs/build/latex/latexmkjarc: -------------------------------------------------------------------------------- 1 | $latex = 'platex ' . $ENV{'LATEXOPTS'} . ' -kanji=utf8 %O %S'; 2 | $dvipdf = 'dvipdfmx %O -o %D %S'; 3 | $makeindex = 'internal mendex %S %B %D'; 4 | sub mendex { 5 | my ($source, $basename, $destination) = @_; 6 | my $dictfile = $basename . ".dic"; 7 | unlink($destination); 8 | system("mendex", "-U", "-f", "-d", $dictfile, "-s", "python.ist", $source); 9 | if ($? > 0) { 10 | print("mendex exited with error code $? (ignored)\n"); 11 | } 12 | if (!-e $destination) { 13 | # create an empty .ind file if nothing 14 | open(FH, ">" . $destination); 15 | close(FH); 16 | } 17 | return 0; 18 | } 19 | add_cus_dep( "glo", "gls", 0, "makeglo" ); 20 | sub makeglo { 21 | return system( "mendex -J -f -s gglo.ist -o '$_[0].gls' '$_[0].glo'" ); 22 | } 23 | -------------------------------------------------------------------------------- /docs/build/latex/latexmkrc: -------------------------------------------------------------------------------- 1 | $latex = 'latex ' . $ENV{'LATEXOPTS'} . ' %O %S'; 2 | $pdflatex = 'pdflatex ' . $ENV{'LATEXOPTS'} . ' %O %S'; 3 | $lualatex = 'lualatex ' . $ENV{'LATEXOPTS'} . ' %O %S'; 4 | $xelatex = 'xelatex --no-pdf ' . $ENV{'LATEXOPTS'} . ' %O %S'; 5 | $makeindex = 'makeindex -s python.ist %O -o %D %S'; 6 | add_cus_dep( "glo", "gls", 0, "makeglo" ); 7 | sub makeglo { 8 | return system( "makeindex -s gglo.ist -o '$_[0].gls' '$_[0].glo'" ); 9 | } -------------------------------------------------------------------------------- /docs/build/latex/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | REM Command file for Sphinx documentation 4 | 5 | pushd %~dp0 6 | 7 | set PDFLATEX=latexmk -pdf -dvi- -ps- 8 | 9 | set "LATEXOPTS= " 10 | 11 | if "%1" == "" goto all-pdf 12 | 13 | if "%1" == "all-pdf" ( 14 | :all-pdf 15 | for %%i in (*.tex) do ( 16 | %PDFLATEX% %LATEXMKOPTS% %%i 17 | ) 18 | goto end 19 | ) 20 | 21 | if "%1" == "all-pdf-ja" ( 22 | goto all-pdf 23 | ) 24 | 25 | if "%1" == "clean" ( 26 | del /q /s *.dvi *.log *.ind *.aux *.toc *.syn *.idx *.out *.ilg *.pla *.ps *.tar *.tar.gz *.tar.bz2 *.tar.xz *.fls *.fdb_latexmk 27 | goto end 28 | ) 29 | 30 | :end 31 | popd -------------------------------------------------------------------------------- /docs/build/latex/missfont.log: -------------------------------------------------------------------------------- 1 | mktextfm ptmr8t 2 | mktextfm ptmr8t 3 | mktextfm phvr8t 4 | mktextfm phvb8t 5 | mktextfm nullfont 6 | mktextfm ptmri8t 7 | mktextfm ptmri8t 8 | mktextfm phvro8t 9 | mktextfm nullfont 10 | mktextfm phvbo8t 11 | mktextfm nullfont 12 | mktextfm nullfont 13 | mktextfm ptmr8t 14 | mktextfm phvr8t 15 | mktextfm phvb8t 16 | mktextfm nullfont 17 | mktextfm ptmr8t 18 | mktextfm ptmb8t 19 | mktextfm nullfont 20 | mktextfm phvr8t 21 | mktextfm phvb8t 22 | mktextfm nullfont 23 | mktextfm phvb8t 24 | mktextfm nullfont 25 | mktextfm ptmr8t 26 | mktextfm phvr8t 27 | mktextfm phvr8t 28 | mktextfm phvb8t 29 | mktextfm nullfont 30 | mktextfm pcrb8t 31 | mktextfm nullfont 32 | mktextfm pcrr8t 33 | mktextfm pcrb8t 34 | mktextfm nullfont 35 | mktextfm ptmr8c 36 | -------------------------------------------------------------------------------- /docs/build/latex/python.ist: -------------------------------------------------------------------------------- 1 | line_max 100 2 | headings_flag 1 3 | heading_prefix " \\bigletter " 4 | 5 | preamble "\\begin{sphinxtheindex} 6 | \\let\\bigletter\\sphinxstyleindexlettergroup 7 | \\let\\spxpagem \\sphinxstyleindexpagemain 8 | \\let\\spxentry \\sphinxstyleindexentry 9 | \\let\\spxextra \\sphinxstyleindexextra 10 | 11 | " 12 | 13 | postamble "\n\n\\end{sphinxtheindex}\n" 14 | 15 | symhead_positive "{\\sphinxsymbolsname}" 16 | numhead_positive "{\\sphinxnumbersname}" 17 | -------------------------------------------------------------------------------- /docs/build/latex/sphinx.xdy: -------------------------------------------------------------------------------- 1 | ;;; -*- mode: lisp; coding: utf-8; -*- 2 | 3 | ;; Unfortunately xindy is out-of-the-box hyperref-incompatible. This 4 | ;; configuration is a workaround, which requires to pass option 5 | ;; hyperindex=false to hyperref. 6 | ;; textit and emph not currently used, spxpagem replaces former textbf 7 | (define-attributes (("textbf" "textit" "emph" "spxpagem" "default"))) 8 | (markup-locref :open "\textbf{\hyperpage{" :close "}}" :attr "textbf") 9 | (markup-locref :open "\textit{\hyperpage{" :close "}}" :attr "textit") 10 | (markup-locref :open "\emph{\hyperpage{" :close "}}" :attr "emph") 11 | (markup-locref :open "\spxpagem{\hyperpage{" :close "}}" :attr "spxpagem") 12 | (markup-locref :open "\hyperpage{" :close "}" :attr "default") 13 | 14 | (require "numeric-sort.xdy") 15 | 16 | ;; xindy base module latex.xdy loads tex.xdy and the latter instructs 17 | ;; xindy to ignore **all** TeX macros in .idx entries, except those 18 | ;; explicitely described in merge rule. But when after applying all 19 | ;; merge rules an empty string results, xindy raises an error: 20 | 21 | ;; ERROR: CHAR: index 0 should be less than the length of the string 22 | 23 | ;; For example when using pdflatex with utf-8 characters the index 24 | ;; file will contain \IeC macros and they will get ignored except if 25 | ;; suitable merge rules are loaded early. The texindy script coming 26 | ;; with xindy provides this, but only for Latin scripts. The texindy 27 | ;; man page says to use rather xelatex or lualatex in case of Cyrillic 28 | ;; scripts. 29 | 30 | ;; Sphinx contributes LICRcyr2utf8.xdy to provide support for Cyrillic 31 | ;; scripts for the pdflatex engine. 32 | 33 | ;; Another issue caused by xindy ignoring all TeX macros except those 34 | ;; explicitely declared reveals itself when attempting to index ">>>", 35 | ;; as the ">" is converted to "\textgreater{}" by Sphinx's LaTeX 36 | ;; escaping. 37 | 38 | ;; To fix this, Sphinx does **not** use texindy, and does not even 39 | ;; load the xindy latex.xdy base module. 40 | 41 | ;(require "latex.xdy") 42 | 43 | ;; Rather it incorporates some suitable extracts from latex.xdy and 44 | ;; tex.xdy with additional Sphinx contributed rules. 45 | 46 | ;; But, this means for pdflatex and Latin scripts that the xindy file 47 | ;; tex/inputenc/uf8.xdy is not usable because it refers to the macro 48 | ;; \IeC only sporadically, and as tex.xdy is not loaded, a rule such as 49 | ;; (merge-rule "\'e" "é" :string) 50 | ;; does not work, it must be 51 | ;; (merge-rule "\IeC {\'e}" "é" :string) 52 | ;; So Sphinx contributes LICRlatin2utf8.xdy to mitigate that problem. 53 | 54 | ;;;;;;;; extracts from tex.xdy (discarding most original comments): 55 | 56 | ;;; 57 | ;;; TeX conventions 58 | ;;; 59 | 60 | ;; Discard leading and trailing white space. Collapse multiple white 61 | ;; space characters to blank. 62 | 63 | (merge-rule "^ +" "" :eregexp) 64 | (merge-rule " +$" "" :eregexp) 65 | (merge-rule " +" " " :eregexp) 66 | 67 | ;; Handle TeX markup 68 | 69 | (merge-rule "\\([{}$%&#])" "\1" :eregexp) 70 | 71 | ;;;;;;;; end of extracts from xindy's tex.xdy 72 | 73 | ;;;;;;;; extracts from latex.xdy: 74 | 75 | ;; Standard location classes: arabic and roman numbers, and alphabets. 76 | 77 | (define-location-class "arabic-page-numbers" ("arabic-numbers")) 78 | (define-location-class "roman-page-numbers" ("roman-numbers-lowercase")) 79 | (define-location-class "Roman-page-numbers" ("roman-numbers-uppercase")) 80 | (define-location-class "alpha-page-numbers" ("alpha")) 81 | (define-location-class "Alpha-page-numbers" ("ALPHA")) 82 | 83 | ;; Output Markup 84 | 85 | (markup-letter-group-list :sep "~n~n \indexspace~n") 86 | 87 | (markup-indexentry :open "~n \item " :depth 0) 88 | (markup-indexentry :open "~n \subitem " :depth 1) 89 | (markup-indexentry :open "~n \subsubitem " :depth 2) 90 | 91 | (markup-locclass-list :open ", " :sep ", ") 92 | (markup-locref-list :sep ", ") 93 | 94 | ;;;;;;;; end of extracts from latex.xdy 95 | 96 | ;; The LaTeX \index command turns \ into normal character so the TeX macros 97 | ;; written to .idx files are not followed by a blank. This is different 98 | ;; from non-ascii letters which end up (with pdflatex) as \IeC macros in .idx 99 | ;; file, with a blank space after \IeC 100 | 101 | ;; Details of the syntax are explained at 102 | ;; http://xindy.sourceforge.net/doc/manual-3.html 103 | ;; In absence of :string, "xindy uses an auto-detection mechanism to decide, 104 | ;; if the pattern is a regular expression or not". But it is not obvious to 105 | ;; guess, for example "\\_" is not detected as RE but "\\P\{\}" is, so for 106 | ;; being sure we apply the :string switch everywhere and do not use \\ etc... 107 | 108 | ;; Go back from sphinx.util.texescape TeX macros to UTF-8 109 | 110 | (merge-rule "\sphinxleftcurlybrace{}" "{" :string) 111 | (merge-rule "\sphinxrightcurlybrace{}" "}" :string) 112 | (merge-rule "\_" "_" :string) 113 | (merge-rule "{[}" "[" :string) 114 | (merge-rule "{]}" "]" :string) 115 | (merge-rule "{}`" "`" :string) 116 | (merge-rule "\textbackslash{}" "\" :string) ; " for Emacs syntax highlighting 117 | (merge-rule "\textasciitilde{}" "~~" :string); the ~~ escape is needed here 118 | (merge-rule "\textless{}" "<" :string) 119 | (merge-rule "\textgreater{}" ">" :string) 120 | (merge-rule "\textasciicircum{}" "^" :string) 121 | (merge-rule "\P{}" "¶" :string) 122 | (merge-rule "\S{}" "§" :string) 123 | (merge-rule "\texteuro{}" "€" :string) 124 | (merge-rule "\(\infty\)" "∞" :string) 125 | (merge-rule "\(\pm\)" "±" :string) 126 | (merge-rule "\(\rightarrow\)" "→" :string) 127 | (merge-rule "\(\checkmark\)" "✓" :string) 128 | (merge-rule "\textendash{}" "–" :string) 129 | (merge-rule "\textbar{}" "|" :string) 130 | (merge-rule "\(\sp{\text{0}}\)" "⁰" :string) 131 | (merge-rule "\(\sp{\text{1}}\)" "¹" :string) 132 | (merge-rule "\(\sp{\text{2}}\)" "²" :string) 133 | (merge-rule "\(\sp{\text{3}}\)" "³" :string) 134 | (merge-rule "\(\sp{\text{4}}\)" "⁴" :string) 135 | (merge-rule "\(\sp{\text{5}}\)" "⁵" :string) 136 | (merge-rule "\(\sp{\text{6}}\)" "⁶" :string) 137 | (merge-rule "\(\sp{\text{7}}\)" "⁷" :string) 138 | (merge-rule "\(\sp{\text{8}}\)" "⁸" :string) 139 | (merge-rule "\(\sp{\text{9}}\)" "⁹" :string) 140 | (merge-rule "\(\sb{\text{0}}\)" "₀" :string) 141 | (merge-rule "\(\sb{\text{1}}\)" "₁" :string) 142 | (merge-rule "\(\sb{\text{2}}\)" "₂" :string) 143 | (merge-rule "\(\sb{\text{3}}\)" "₃" :string) 144 | (merge-rule "\(\sb{\text{4}}\)" "₄" :string) 145 | (merge-rule "\(\sb{\text{5}}\)" "₅" :string) 146 | (merge-rule "\(\sb{\text{6}}\)" "₆" :string) 147 | (merge-rule "\(\sb{\text{7}}\)" "₇" :string) 148 | (merge-rule "\(\sb{\text{8}}\)" "₈" :string) 149 | (merge-rule "\(\sb{\text{9}}\)" "₉" :string) 150 | (merge-rule "\IeC {\textalpha }" "α" :string) 151 | (merge-rule "\IeC {\textbeta }" "β" :string) 152 | (merge-rule "\IeC {\textgamma }" "γ" :string) 153 | (merge-rule "\IeC {\textdelta }" "δ" :string) 154 | (merge-rule "\IeC {\textepsilon }" "ε" :string) 155 | (merge-rule "\IeC {\textzeta }" "ζ" :string) 156 | (merge-rule "\IeC {\texteta }" "η" :string) 157 | (merge-rule "\IeC {\texttheta }" "θ" :string) 158 | (merge-rule "\IeC {\textiota }" "ι" :string) 159 | (merge-rule "\IeC {\textkappa }" "κ" :string) 160 | (merge-rule "\IeC {\textlambda }" "λ" :string) 161 | (merge-rule "\IeC {\textmu }" "μ" :string) 162 | (merge-rule "\IeC {\textnu }" "ν" :string) 163 | (merge-rule "\IeC {\textxi }" "ξ" :string) 164 | (merge-rule "\IeC {\textomicron }" "ο" :string) 165 | (merge-rule "\IeC {\textpi }" "π" :string) 166 | (merge-rule "\IeC {\textrho }" "ρ" :string) 167 | (merge-rule "\IeC {\textsigma }" "σ" :string) 168 | (merge-rule "\IeC {\texttau }" "τ" :string) 169 | (merge-rule "\IeC {\textupsilon }" "υ" :string) 170 | (merge-rule "\IeC {\textphi }" "φ" :string) 171 | (merge-rule "\IeC {\textchi }" "χ" :string) 172 | (merge-rule "\IeC {\textpsi }" "ψ" :string) 173 | (merge-rule "\IeC {\textomega }" "ω" :string) 174 | (merge-rule "\IeC {\textAlpha }" "Α" :string) 175 | (merge-rule "\IeC {\textBeta }" "Β" :string) 176 | (merge-rule "\IeC {\textGamma }" "Γ" :string) 177 | (merge-rule "\IeC {\textDelta }" "Δ" :string) 178 | (merge-rule "\IeC {\textEpsilon }" "Ε" :string) 179 | (merge-rule "\IeC {\textZeta }" "Ζ" :string) 180 | (merge-rule "\IeC {\textEta }" "Η" :string) 181 | (merge-rule "\IeC {\textTheta }" "Θ" :string) 182 | (merge-rule "\IeC {\textIota }" "Ι" :string) 183 | (merge-rule "\IeC {\textKappa }" "Κ" :string) 184 | (merge-rule "\IeC {\textLambda }" "Λ" :string) 185 | (merge-rule "\IeC {\textMu }" "Μ" :string) 186 | (merge-rule "\IeC {\textNu }" "Ν" :string) 187 | (merge-rule "\IeC {\textTheta }" "Θ" :string) 188 | (merge-rule "\IeC {\textIota }" "Ι" :string) 189 | (merge-rule "\IeC {\textKappa }" "Κ" :string) 190 | (merge-rule "\IeC {\textLambda }" "Λ" :string) 191 | (merge-rule "\IeC {\textMu }" "Μ" :string) 192 | (merge-rule "\IeC {\textNu }" "Ν" :string) 193 | (merge-rule "\IeC {\textXi }" "Ξ" :string) 194 | (merge-rule "\IeC {\textOmicron }" "Ο" :string) 195 | (merge-rule "\IeC {\textPi }" "Π" :string) 196 | (merge-rule "\IeC {\textRho }" "Ρ" :string) 197 | (merge-rule "\IeC {\textSigma }" "Σ" :string) 198 | (merge-rule "\IeC {\textTau }" "Τ" :string) 199 | (merge-rule "\IeC {\textUpsilon }" "Υ" :string) 200 | (merge-rule "\IeC {\textPhi }" "Φ" :string) 201 | (merge-rule "\IeC {\textChi }" "Χ" :string) 202 | (merge-rule "\IeC {\textPsi }" "Ψ" :string) 203 | (merge-rule "\IeC {\textOmega }" "Ω" :string) 204 | (merge-rule "\IeC {\textohm }" "Ω" :string) 205 | 206 | ;; This xindy module provides some basic support for "see" 207 | (require "makeindex.xdy") 208 | 209 | ;; This creates one-letter headings and works fine with utf-8 letters. 210 | ;; For Cyrillic with pdflatex works thanks to LICRcyr2utf8.xdy 211 | (require "latin-lettergroups.xdy") 212 | 213 | ;; currently we don't (know how to easily) separate "Numbers" from 214 | ;; "Symbols" with xindy as is the case with makeindex. 215 | (markup-index :open "\begin{sphinxtheindex} 216 | \let\lettergroup\sphinxstyleindexlettergroup 217 | \let\lettergroupDefault\sphinxstyleindexlettergroupDefault 218 | \let\spxpagem\sphinxstyleindexpagemain 219 | \let\spxentry\sphinxstyleindexentry 220 | \let\spxextra\sphinxstyleindexextra 221 | 222 | " 223 | :close " 224 | 225 | \end{sphinxtheindex} 226 | " 227 | :tree) 228 | 229 | -------------------------------------------------------------------------------- /docs/build/latex/sphinxcyrillic.sty: -------------------------------------------------------------------------------- 1 | %% CYRILLIC IN NON-CYRILLIC DOCUMENTS (pdflatex only) 2 | % 3 | % refs: https://tex.stackexchange.com/q/460271/ 4 | \ProvidesPackage{sphinxcyrillic}% 5 | [2018/11/21 v2.0 support for Cyrillic in non-Cyrillic documents] 6 | \RequirePackage{kvoptions} 7 | \SetupKeyvalOptions{prefix=spx@cyropt@} % use \spx@cyropt@ prefix 8 | \DeclareBoolOption[false]{Xtwo} 9 | \DeclareBoolOption[false]{TtwoA} 10 | \DeclareDefaultOption{\@unknownoptionerror} 11 | \ProcessLocalKeyvalOptions* % ignore class options 12 | 13 | \ifspx@cyropt@Xtwo 14 | % original code by tex.sx user egreg: 15 | % https://tex.stackexchange.com/a/460325/ 16 | % 159 Cyrillic glyphs as available in X2 TeX 8bit font encoding 17 | % This assumes inputenc loaded with utf8 option, or LaTeX release 18 | % as recent as 2018/04/01 which does it automatically. 19 | \@tfor\next:=% 20 | {Ё}{Ђ}{Є}{Ѕ}{І}{Ј}{Љ}{Њ}{Ћ}{Ў}{Џ}{А}{Б}{В}{Г}{Д}{Е}{Ж}{З}{И}{Й}% 21 | {К}{Л}{М}{Н}{О}{П}{Р}{С}{Т}{У}{Ф}{Х}{Ц}{Ч}{Ш}{Щ}{Ъ}{Ы}{Ь}{Э}{Ю}% 22 | {Я}{а}{б}{в}{г}{д}{е}{ж}{з}{и}{й}{к}{л}{м}{н}{о}{п}{р}{с}{т}{у}% 23 | {ф}{х}{ц}{ч}{ш}{щ}{ъ}{ы}{ь}{э}{ю}{я}{ё}{ђ}{є}{ѕ}{і}{ј}{љ}{њ}{ћ}% 24 | {ў}{џ}{Ѣ}{ѣ}{Ѫ}{ѫ}{Ѵ}{ѵ}{Ґ}{ґ}{Ғ}{ғ}{Ҕ}{ҕ}{Җ}{җ}{Ҙ}{ҙ}{Қ}{қ}{Ҝ}{ҝ}% 25 | {Ҟ}{ҟ}{Ҡ}{ҡ}{Ң}{ң}{Ҥ}{ҥ}{Ҧ}{ҧ}{Ҩ}{ҩ}{Ҫ}{ҫ}{Ҭ}{ҭ}{Ү}{ү}{Ұ}{ұ}{Ҳ}{ҳ}% 26 | {Ҵ}{ҵ}{Ҷ}{ҷ}{Ҹ}{ҹ}{Һ}{һ}{Ҽ}{ҽ}{Ҿ}{ҿ}{Ӏ}{Ӄ}{ӄ}{Ӆ}{ӆ}{Ӈ}{ӈ}{Ӌ}{ӌ}% 27 | {Ӎ}{ӎ}{Ӕ}{ӕ}{Ә}{ә}{Ӡ}{ӡ}{Ө}{ө}\do 28 | {% 29 | \begingroup\def\IeC{\protect\DeclareTextSymbolDefault}% 30 | \protected@edef\@temp{\endgroup\next{X2}}\@temp 31 | }% 32 | \else 33 | \ifspx@cyropt@TtwoA 34 | % original code by tex.sx user jfbu: 35 | % https://tex.stackexchange.com/a/460305/ 36 | % 63*2+1=127 Cyrillic glyphs as found in T2A 8bit TeX font-encoding 37 | \@tfor\@tempa:=% 38 | {ae}{a}{b}{chrdsc}{chvcrs}{ch}{c}{dje}{dze}{dzhe}{d}{erev}{ery}{e}% 39 | {f}{ghcrs}{gup}{g}{hdsc}{hrdsn}{h}{ie}{ii}{ishrt}{i}{je}% 40 | {kbeak}{kdsc}{kvcrs}{k}{lje}{l}{m}{ndsc}{ng}{nje}{n}{otld}{o}{p}{r}% 41 | {schwa}{sdsc}{sftsn}{shch}{shha}{sh}{s}{tshe}{t}{ushrt}{u}{v}% 42 | {ya}{yhcrs}{yi}{yo}{yu}{y}{zdsc}{zhdsc}{zh}{z}\do 43 | {% 44 | \expandafter\DeclareTextSymbolDefault\expandafter 45 | {\csname cyr\@tempa\endcsname}{T2A}% 46 | \expandafter\uppercase\expandafter{\expandafter 47 | \def\expandafter\@tempa\expandafter{\@tempa}}% 48 | \expandafter\DeclareTextSymbolDefault\expandafter 49 | {\csname CYR\@tempa\endcsname}{T2A}% 50 | }% 51 | \DeclareTextSymbolDefault{\CYRpalochka}{T2A}% 52 | \fi\fi 53 | \endinput 54 | -------------------------------------------------------------------------------- /docs/build/latex/sphinxhighlight.sty: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1995/12/01] 2 | \ProvidesPackage{sphinxhighlight}[2016/05/29 stylesheet for highlighting with pygments] 3 | 4 | 5 | \makeatletter 6 | \def\PYG@reset{\let\PYG@it=\relax \let\PYG@bf=\relax% 7 | \let\PYG@ul=\relax \let\PYG@tc=\relax% 8 | \let\PYG@bc=\relax \let\PYG@ff=\relax} 9 | \def\PYG@tok#1{\csname PYG@tok@#1\endcsname} 10 | \def\PYG@toks#1+{\ifx\relax#1\empty\else% 11 | \PYG@tok{#1}\expandafter\PYG@toks\fi} 12 | \def\PYG@do#1{\PYG@bc{\PYG@tc{\PYG@ul{% 13 | \PYG@it{\PYG@bf{\PYG@ff{#1}}}}}}} 14 | \def\PYG#1#2{\PYG@reset\PYG@toks#1+\relax+\PYG@do{#2}} 15 | 16 | \expandafter\def\csname PYG@tok@w\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.73,0.73}{##1}}} 17 | \expandafter\def\csname PYG@tok@c\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}} 18 | \expandafter\def\csname PYG@tok@cp\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} 19 | \expandafter\def\csname PYG@tok@cs\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}\def\PYG@bc##1{\setlength{\fboxsep}{0pt}\colorbox[rgb]{1.00,0.94,0.94}{\strut ##1}}} 20 | \expandafter\def\csname PYG@tok@k\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} 21 | \expandafter\def\csname PYG@tok@kp\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} 22 | \expandafter\def\csname PYG@tok@kt\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.56,0.13,0.00}{##1}}} 23 | \expandafter\def\csname PYG@tok@o\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} 24 | \expandafter\def\csname PYG@tok@ow\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} 25 | \expandafter\def\csname PYG@tok@nb\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} 26 | \expandafter\def\csname PYG@tok@nf\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.02,0.16,0.49}{##1}}} 27 | \expandafter\def\csname PYG@tok@nc\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.05,0.52,0.71}{##1}}} 28 | \expandafter\def\csname PYG@tok@nn\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.05,0.52,0.71}{##1}}} 29 | \expandafter\def\csname PYG@tok@ne\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} 30 | \expandafter\def\csname PYG@tok@nv\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}} 31 | \expandafter\def\csname PYG@tok@no\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.38,0.68,0.84}{##1}}} 32 | \expandafter\def\csname PYG@tok@nl\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.13,0.44}{##1}}} 33 | \expandafter\def\csname PYG@tok@ni\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.84,0.33,0.22}{##1}}} 34 | \expandafter\def\csname PYG@tok@na\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} 35 | \expandafter\def\csname PYG@tok@nt\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.02,0.16,0.45}{##1}}} 36 | \expandafter\def\csname PYG@tok@nd\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.33,0.33,0.33}{##1}}} 37 | \expandafter\def\csname PYG@tok@s\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} 38 | \expandafter\def\csname PYG@tok@sd\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} 39 | \expandafter\def\csname PYG@tok@si\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.44,0.63,0.82}{##1}}} 40 | \expandafter\def\csname PYG@tok@se\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} 41 | \expandafter\def\csname PYG@tok@sr\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.14,0.33,0.53}{##1}}} 42 | \expandafter\def\csname PYG@tok@ss\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.32,0.47,0.09}{##1}}} 43 | \expandafter\def\csname PYG@tok@sx\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.78,0.36,0.04}{##1}}} 44 | \expandafter\def\csname PYG@tok@m\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} 45 | \expandafter\def\csname PYG@tok@gh\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}} 46 | \expandafter\def\csname PYG@tok@gu\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.50,0.00,0.50}{##1}}} 47 | \expandafter\def\csname PYG@tok@gd\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.63,0.00,0.00}{##1}}} 48 | \expandafter\def\csname PYG@tok@gi\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.63,0.00}{##1}}} 49 | \expandafter\def\csname PYG@tok@gr\endcsname{\def\PYG@tc##1{\textcolor[rgb]{1.00,0.00,0.00}{##1}}} 50 | \expandafter\def\csname PYG@tok@ge\endcsname{\let\PYG@it=\textit} 51 | \expandafter\def\csname PYG@tok@gs\endcsname{\let\PYG@bf=\textbf} 52 | \expandafter\def\csname PYG@tok@gp\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.78,0.36,0.04}{##1}}} 53 | \expandafter\def\csname PYG@tok@go\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.20,0.20,0.20}{##1}}} 54 | \expandafter\def\csname PYG@tok@gt\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.27,0.87}{##1}}} 55 | \expandafter\def\csname PYG@tok@err\endcsname{\def\PYG@bc##1{\setlength{\fboxsep}{0pt}\fcolorbox[rgb]{1.00,0.00,0.00}{1,1,1}{\strut ##1}}} 56 | \expandafter\def\csname PYG@tok@kc\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} 57 | \expandafter\def\csname PYG@tok@kd\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} 58 | \expandafter\def\csname PYG@tok@kn\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} 59 | \expandafter\def\csname PYG@tok@kr\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} 60 | \expandafter\def\csname PYG@tok@bp\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} 61 | \expandafter\def\csname PYG@tok@fm\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.02,0.16,0.49}{##1}}} 62 | \expandafter\def\csname PYG@tok@vc\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}} 63 | \expandafter\def\csname PYG@tok@vg\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}} 64 | \expandafter\def\csname PYG@tok@vi\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}} 65 | \expandafter\def\csname PYG@tok@vm\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}} 66 | \expandafter\def\csname PYG@tok@sa\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} 67 | \expandafter\def\csname PYG@tok@sb\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} 68 | \expandafter\def\csname PYG@tok@sc\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} 69 | \expandafter\def\csname PYG@tok@dl\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} 70 | \expandafter\def\csname PYG@tok@s2\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} 71 | \expandafter\def\csname PYG@tok@sh\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} 72 | \expandafter\def\csname PYG@tok@s1\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} 73 | \expandafter\def\csname PYG@tok@mb\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} 74 | \expandafter\def\csname PYG@tok@mf\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} 75 | \expandafter\def\csname PYG@tok@mh\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} 76 | \expandafter\def\csname PYG@tok@mi\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} 77 | \expandafter\def\csname PYG@tok@il\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} 78 | \expandafter\def\csname PYG@tok@mo\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} 79 | \expandafter\def\csname PYG@tok@ch\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}} 80 | \expandafter\def\csname PYG@tok@cm\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}} 81 | \expandafter\def\csname PYG@tok@cpf\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}} 82 | \expandafter\def\csname PYG@tok@c1\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}} 83 | 84 | \def\PYGZbs{\char`\\} 85 | \def\PYGZus{\char`\_} 86 | \def\PYGZob{\char`\{} 87 | \def\PYGZcb{\char`\}} 88 | \def\PYGZca{\char`\^} 89 | \def\PYGZam{\char`\&} 90 | \def\PYGZlt{\char`\<} 91 | \def\PYGZgt{\char`\>} 92 | \def\PYGZsh{\char`\#} 93 | \def\PYGZpc{\char`\%} 94 | \def\PYGZdl{\char`\$} 95 | \def\PYGZhy{\char`\-} 96 | \def\PYGZsq{\char`\'} 97 | \def\PYGZdq{\char`\"} 98 | \def\PYGZti{\char`\~} 99 | % for compatibility with earlier versions 100 | \def\PYGZat{@} 101 | \def\PYGZlb{[} 102 | \def\PYGZrb{]} 103 | \makeatother 104 | 105 | \renewcommand\PYGZsq{\textquotesingle} 106 | -------------------------------------------------------------------------------- /docs/build/latex/sphinxhowto.cls: -------------------------------------------------------------------------------- 1 | % 2 | % sphinxhowto.cls for Sphinx (http://sphinx-doc.org/) 3 | % 4 | 5 | \NeedsTeXFormat{LaTeX2e}[1995/12/01] 6 | \ProvidesClass{sphinxhowto}[2018/12/23 v2.0 Document class (Sphinx howto)] 7 | 8 | % 'oneside' option overriding the 'twoside' default 9 | \newif\if@oneside 10 | \DeclareOption{oneside}{\@onesidetrue} 11 | % Pass remaining document options to the parent class. 12 | \DeclareOption*{\PassOptionsToClass{\CurrentOption}{\sphinxdocclass}} 13 | \ProcessOptions\relax 14 | 15 | % Default to two-side document 16 | \if@oneside 17 | % nothing to do (oneside is the default) 18 | \else 19 | \PassOptionsToClass{twoside}{\sphinxdocclass} 20 | \fi 21 | 22 | \LoadClass{\sphinxdocclass} 23 | 24 | % Set some sane defaults for section numbering depth and TOC depth. You can 25 | % reset these counters in your preamble. 26 | % 27 | \setcounter{secnumdepth}{2} 28 | \setcounter{tocdepth}{2}% i.e. section and subsection 29 | 30 | % Change the title page to look a bit better, and fit in with the fncychap 31 | % ``Bjarne'' style a bit better. 32 | % 33 | \newcommand{\sphinxmaketitle}{% 34 | \noindent\rule{\textwidth}{1pt}\par 35 | \begingroup % for PDF information dictionary 36 | \def\endgraf{ }\def\and{\& }% 37 | \pdfstringdefDisableCommands{\def\\{, }}% overwrite hyperref setup 38 | \hypersetup{pdfauthor={\@author}, pdftitle={\@title}}% 39 | \endgroup 40 | \begin{flushright} 41 | \sphinxlogo 42 | \py@HeaderFamily 43 | {\Huge \@title }\par 44 | {\itshape\large \py@release \releaseinfo}\par 45 | \vspace{25pt} 46 | {\Large 47 | \begin{tabular}[t]{c} 48 | \@author 49 | \end{tabular}\kern-\tabcolsep}\par 50 | \vspace{25pt} 51 | \@date \par 52 | \py@authoraddress \par 53 | \end{flushright} 54 | \@thanks 55 | \setcounter{footnote}{0} 56 | \let\thanks\relax\let\maketitle\relax 57 | %\gdef\@thanks{}\gdef\@author{}\gdef\@title{} 58 | } 59 | 60 | \newcommand{\sphinxtableofcontents}{% 61 | \begingroup 62 | \parskip \z@skip 63 | \sphinxtableofcontentshook 64 | \tableofcontents 65 | \endgroup 66 | \noindent\rule{\textwidth}{1pt}\par 67 | \vspace{12pt}% 68 | } 69 | \newcommand\sphinxtableofcontentshook{} 70 | \pagenumbering{arabic} 71 | 72 | % Fix the bibliography environment to add an entry to the Table of 73 | % Contents. 74 | % For an article document class this environment is a section, 75 | % so no page break before it. 76 | % 77 | \newenvironment{sphinxthebibliography}[1]{% 78 | % \phantomsection % not needed here since TeXLive 2010's hyperref 79 | \begin{thebibliography}{#1}% 80 | \addcontentsline{toc}{section}{\ifdefined\refname\refname\else\ifdefined\bibname\bibname\fi\fi}}{\end{thebibliography}} 81 | 82 | 83 | % Same for the indices. 84 | % The memoir class already does this, so we don't duplicate it in that case. 85 | % 86 | \@ifclassloaded{memoir} 87 | {\newenvironment{sphinxtheindex}{\begin{theindex}}{\end{theindex}}} 88 | {\newenvironment{sphinxtheindex}{% 89 | \phantomsection % needed because no chapter, section, ... is created by theindex 90 | \begin{theindex}% 91 | \addcontentsline{toc}{section}{\indexname}}{\end{theindex}}} 92 | -------------------------------------------------------------------------------- /docs/build/latex/sphinxmanual.cls: -------------------------------------------------------------------------------- 1 | % 2 | % sphinxmanual.cls for Sphinx (http://sphinx-doc.org/) 3 | % 4 | 5 | \NeedsTeXFormat{LaTeX2e}[1995/12/01] 6 | \ProvidesClass{sphinxmanual}[2018/12/23 v2.0 Document class (Sphinx manual)] 7 | 8 | % chapters starting at odd pages (overridden by 'openany' document option) 9 | \PassOptionsToClass{openright}{\sphinxdocclass} 10 | 11 | % 'oneside' option overriding the 'twoside' default 12 | \newif\if@oneside 13 | \DeclareOption{oneside}{\@onesidetrue} 14 | % Pass remaining document options to the parent class. 15 | \DeclareOption*{\PassOptionsToClass{\CurrentOption}{\sphinxdocclass}} 16 | \ProcessOptions\relax 17 | 18 | % Defaults two-side document 19 | \if@oneside 20 | % nothing to do (oneside is the default) 21 | \else 22 | \PassOptionsToClass{twoside}{\sphinxdocclass} 23 | \fi 24 | 25 | \LoadClass{\sphinxdocclass} 26 | 27 | % Set some sane defaults for section numbering depth and TOC depth. You can 28 | % reset these counters in your preamble. 29 | % 30 | \setcounter{secnumdepth}{2} 31 | \setcounter{tocdepth}{1} 32 | 33 | % Change the title page to look a bit better, and fit in with the fncychap 34 | % ``Bjarne'' style a bit better. 35 | % 36 | \newcommand{\sphinxmaketitle}{% 37 | \let\sphinxrestorepageanchorsetting\relax 38 | \ifHy@pageanchor\def\sphinxrestorepageanchorsetting{\Hy@pageanchortrue}\fi 39 | \hypersetup{pageanchor=false}% avoid duplicate destination warnings 40 | \begin{titlepage}% 41 | \let\footnotesize\small 42 | \let\footnoterule\relax 43 | \noindent\rule{\textwidth}{1pt}\par 44 | \begingroup % for PDF information dictionary 45 | \def\endgraf{ }\def\and{\& }% 46 | \pdfstringdefDisableCommands{\def\\{, }}% overwrite hyperref setup 47 | \hypersetup{pdfauthor={\@author}, pdftitle={\@title}}% 48 | \endgroup 49 | \begin{flushright}% 50 | \sphinxlogo 51 | \py@HeaderFamily 52 | {\Huge \@title \par} 53 | {\itshape\LARGE \py@release\releaseinfo \par} 54 | \vfill 55 | {\LARGE 56 | \begin{tabular}[t]{c} 57 | \@author 58 | \end{tabular}\kern-\tabcolsep 59 | \par} 60 | \vfill\vfill 61 | {\large 62 | \@date \par 63 | \vfill 64 | \py@authoraddress \par 65 | }% 66 | \end{flushright}%\par 67 | \@thanks 68 | \end{titlepage}% 69 | \setcounter{footnote}{0}% 70 | \let\thanks\relax\let\maketitle\relax 71 | %\gdef\@thanks{}\gdef\@author{}\gdef\@title{} 72 | \clearpage 73 | \ifdefined\sphinxbackoftitlepage\sphinxbackoftitlepage\fi 74 | \if@openright\cleardoublepage\else\clearpage\fi 75 | \sphinxrestorepageanchorsetting 76 | } 77 | 78 | \newcommand{\sphinxtableofcontents}{% 79 | \pagenumbering{roman}% 80 | \begingroup 81 | \parskip \z@skip 82 | \sphinxtableofcontentshook 83 | \tableofcontents 84 | \endgroup 85 | % before resetting page counter, let's do the right thing. 86 | \if@openright\cleardoublepage\else\clearpage\fi 87 | \pagenumbering{arabic}% 88 | } 89 | 90 | % This is needed to get the width of the section # area wide enough in the 91 | % library reference. Doing it here keeps it the same for all the manuals. 92 | % 93 | \newcommand{\sphinxtableofcontentshook}{% 94 | \renewcommand*\l@section{\@dottedtocline{1}{1.5em}{2.6em}}% 95 | \renewcommand*\l@subsection{\@dottedtocline{2}{4.1em}{3.5em}}% 96 | } 97 | 98 | % Fix the bibliography environment to add an entry to the Table of 99 | % Contents. 100 | % For a report document class this environment is a chapter. 101 | % 102 | \newenvironment{sphinxthebibliography}[1]{% 103 | \if@openright\cleardoublepage\else\clearpage\fi 104 | % \phantomsection % not needed here since TeXLive 2010's hyperref 105 | \begin{thebibliography}{#1}% 106 | \addcontentsline{toc}{chapter}{\bibname}}{\end{thebibliography}} 107 | 108 | % Same for the indices. 109 | % The memoir class already does this, so we don't duplicate it in that case. 110 | % 111 | \@ifclassloaded{memoir} 112 | {\newenvironment{sphinxtheindex}{\begin{theindex}}{\end{theindex}}} 113 | {\newenvironment{sphinxtheindex}{% 114 | \if@openright\cleardoublepage\else\clearpage\fi 115 | \phantomsection % needed as no chapter, section, ... created 116 | \begin{theindex}% 117 | \addcontentsline{toc}{chapter}{\indexname}}{\end{theindex}}} 118 | -------------------------------------------------------------------------------- /docs/build/latex/sphinxmessages.sty: -------------------------------------------------------------------------------- 1 | % 2 | % sphinxmessages.sty 3 | % 4 | % message resources for Sphinx 5 | % 6 | \ProvidesPackage{sphinxmessages}[2019/01/04 v2.0 Localized LaTeX macros (Sphinx team)] 7 | 8 | \renewcommand{\literalblockcontinuedname}{continued from previous page} 9 | \renewcommand{\literalblockcontinuesname}{continues on next page} 10 | \renewcommand{\sphinxnonalphabeticalgroupname}{Non-alphabetical} 11 | \renewcommand{\sphinxsymbolsname}{Symbols} 12 | \renewcommand{\sphinxnumbersname}{Numbers} 13 | \def\pageautorefname{page} 14 | 15 | \addto\captionsenglish{\renewcommand{\figurename}{Fig.\@{} }} 16 | \def\fnum@figure{\figurename\thefigure{}} 17 | 18 | \addto\captionsenglish{\renewcommand{\tablename}{Table }} 19 | \def\fnum@table{\tablename\thetable{}} 20 | 21 | \addto\captionsenglish{\renewcommand{\literalblockname}{Listing}} -------------------------------------------------------------------------------- /docs/source/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # eqtools documentation build configuration file, created by 4 | # sphinx-quickstart on Wed Sep 4 17:55:14 2013. 5 | # 6 | # This file is execfile()d with the current directory set to its containing dir. 7 | # 8 | # Note that not all possible configuration values are present in this 9 | # autogenerated file. 10 | # 11 | # All configuration values have a default; values that are commented out 12 | # serve to show the default. 13 | 14 | import sys, os 15 | 16 | # If extensions (or modules to document with autodoc) are in another directory, 17 | # add these directories to sys.path here. If the directory is relative to the 18 | # documentation root, use os.path.abspath to make it absolute, like shown here. 19 | sys.path.insert(0, os.path.abspath('../..')) 20 | 21 | # -- General configuration ----------------------------------------------------- 22 | 23 | # If your documentation needs a minimal Sphinx version, state it here. 24 | #needs_sphinx = '1.0' 25 | 26 | # Add any Sphinx extension module names here, as strings. They can be extensions 27 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. 28 | extensions = ['sphinx.ext.autodoc', 'sphinx.ext.imgmath', 'sphinx.ext.viewcode', 'sphinx.ext.napoleon'] 29 | 30 | # MAC addition: Get constructor docstring properly: 31 | autoclass_content = 'both' 32 | # Keep things in module order: 33 | autodoc_member_order = 'bysource' 34 | 35 | # Add any paths that contain templates here, relative to this directory. 36 | templates_path = ['_templates'] 37 | 38 | # The suffix of source filenames. 39 | source_suffix = '.rst' 40 | 41 | # The encoding of source files. 42 | #source_encoding = 'utf-8-sig' 43 | 44 | # The master toctree document. 45 | master_doc = 'index' 46 | 47 | # General information about the project. 48 | project = u'eqtools' 49 | copyright = u'2016, Mark Chilenski, Ian Faust and John Walk' 50 | 51 | # The version info for the project you're documenting, acts as replacement for 52 | # |version| and |release|, also used in various other places throughout the 53 | # built documents. 54 | # 55 | # The short X.Y version. 56 | version = '1.5.0' 57 | # The full version, including alpha/beta/rc tags. 58 | release = '1.5.0' 59 | 60 | # The language for content autogenerated by Sphinx. Refer to documentation 61 | # for a list of supported languages. 62 | #language = None 63 | 64 | # There are two options for replacing |today|: either, you set today to some 65 | # non-false value, then it is used: 66 | #today = '' 67 | # Else, today_fmt is used as the format for a strftime call. 68 | #today_fmt = '%B %d, %Y' 69 | 70 | # List of patterns, relative to source directory, that match files and 71 | # directories to ignore when looking for source files. 72 | exclude_patterns = [] 73 | 74 | # The reST default role (used for this markup: `text`) to use for all documents. 75 | #default_role = None 76 | 77 | # If true, '()' will be appended to :func: etc. cross-reference text. 78 | #add_function_parentheses = True 79 | 80 | # If true, the current module name will be prepended to all description 81 | # unit titles (such as .. function::). 82 | #add_module_names = True 83 | 84 | # If true, sectionauthor and moduleauthor directives will be shown in the 85 | # output. They are ignored by default. 86 | #show_authors = False 87 | 88 | # The name of the Pygments (syntax highlighting) style to use. 89 | pygments_style = 'sphinx' 90 | 91 | # A list of ignored prefixes for module index sorting. 92 | #modindex_common_prefix = [] 93 | 94 | 95 | # -- Options for HTML output --------------------------------------------------- 96 | 97 | # The theme to use for HTML and HTML Help pages. See the documentation for 98 | # a list of builtin themes. 99 | html_theme = 'default' 100 | 101 | # Theme options are theme-specific and customize the look and feel of a theme 102 | # further. For a list of options available for each theme, see the 103 | # documentation. 104 | #html_theme_options = {} 105 | 106 | # Add any paths that contain custom themes here, relative to this directory. 107 | #html_theme_path = [] 108 | 109 | # The name for this set of Sphinx documents. If None, it defaults to 110 | # " v documentation". 111 | #html_title = None 112 | 113 | # A shorter title for the navigation bar. Default is the same as html_title. 114 | #html_short_title = None 115 | 116 | # The name of an image file (relative to this directory) to place at the top 117 | # of the sidebar. 118 | #html_logo = None 119 | 120 | # The name of an image file (within the static path) to use as favicon of the 121 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 122 | # pixels large. 123 | #html_favicon = None 124 | 125 | # Add any paths that contain custom static files (such as style sheets) here, 126 | # relative to this directory. They are copied after the builtin static files, 127 | # so a file named "default.css" will overwrite the builtin "default.css". 128 | html_static_path = ['_static'] 129 | 130 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, 131 | # using the given strftime format. 132 | #html_last_updated_fmt = '%b %d, %Y' 133 | 134 | # If true, SmartyPants will be used to convert quotes and dashes to 135 | # typographically correct entities. 136 | #html_use_smartypants = True 137 | 138 | # Custom sidebar templates, maps document names to template names. 139 | #html_sidebars = {} 140 | 141 | # Additional templates that should be rendered to pages, maps page names to 142 | # template names. 143 | #html_additional_pages = {} 144 | 145 | # If false, no module index is generated. 146 | #html_domain_indices = True 147 | 148 | # If false, no index is generated. 149 | #html_use_index = True 150 | 151 | # If true, the index is split into individual pages for each letter. 152 | #html_split_index = False 153 | 154 | # If true, links to the reST sources are added to the pages. 155 | #html_show_sourcelink = True 156 | 157 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. 158 | #html_show_sphinx = True 159 | 160 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. 161 | #html_show_copyright = True 162 | 163 | # If true, an OpenSearch description file will be output, and all pages will 164 | # contain a tag referring to it. The value of this option must be the 165 | # base URL from which the finished HTML is served. 166 | #html_use_opensearch = '' 167 | 168 | # This is the file name suffix for HTML files (e.g. ".xhtml"). 169 | #html_file_suffix = None 170 | 171 | # Output file base name for HTML help builder. 172 | htmlhelp_basename = 'eqtoolsdoc' 173 | 174 | 175 | # -- Options for LaTeX output -------------------------------------------------- 176 | 177 | latex_elements = { 178 | # The paper size ('letterpaper' or 'a4paper'). 179 | #'papersize': 'letterpaper', 180 | 181 | # The font size ('10pt', '11pt' or '12pt'). 182 | #'pointsize': '10pt', 183 | 184 | # Additional stuff for the LaTeX preamble. 185 | 'preamble': r'\hypersetup{bookmarksdepth=3}', 186 | } 187 | 188 | # Grouping the document tree into LaTeX files. List of tuples 189 | # (source start file, target name, title, author, documentclass [howto/manual]). 190 | latex_documents = [ 191 | ('index', 'eqtools.tex', u'eqtools Documentation', 192 | u'Mark Chilenski, Ian Faust and John Walk', 'manual'), 193 | ] 194 | 195 | # The name of an image file (relative to this directory) to place at the top of 196 | # the title page. 197 | #latex_logo = None 198 | 199 | # For "manual" documents, if this is true, then toplevel headings are parts, 200 | # not chapters. 201 | #latex_use_parts = False 202 | 203 | # If true, show page references after internal links. 204 | #latex_show_pagerefs = False 205 | 206 | # If true, show URL addresses after external links. 207 | #latex_show_urls = False 208 | 209 | # Documents to append as an appendix to all manuals. 210 | #latex_appendices = [] 211 | 212 | # If false, no module index is generated. 213 | #latex_domain_indices = True 214 | 215 | 216 | # -- Options for manual page output -------------------------------------------- 217 | 218 | # One entry per manual page. List of tuples 219 | # (source start file, name, description, authors, manual section). 220 | man_pages = [ 221 | ('index', 'eqtools', u'eqtools Documentation', 222 | [u'Mark Chilenski, Ian Faust and John Walk'], 1) 223 | ] 224 | 225 | # If true, show URL addresses after external links. 226 | #man_show_urls = False 227 | 228 | 229 | # -- Options for Texinfo output ------------------------------------------------ 230 | 231 | # Grouping the document tree into Texinfo files. List of tuples 232 | # (source start file, target name, title, author, 233 | # dir menu entry, description, category) 234 | texinfo_documents = [ 235 | ('index', 'eqtools', u'eqtools Documentation', 236 | u'Mark Chilenski, Ian Faust and John Walk', 'eqtools', 'Tools for working with magnetic equilibrium reconstructions.', 237 | 'Miscellaneous'), 238 | ] 239 | 240 | # Documents to append as an appendix to all manuals. 241 | #texinfo_appendices = [] 242 | 243 | # If false, no module index is generated. 244 | #texinfo_domain_indices = True 245 | 246 | # How to display URL addresses: 'footnote', 'no', or 'inline'. 247 | #texinfo_show_urls = 'footnote' 248 | -------------------------------------------------------------------------------- /docs/source/eqtools.rst: -------------------------------------------------------------------------------- 1 | eqtools package 2 | =============== 3 | 4 | Submodules 5 | ---------- 6 | 7 | eqtools.AUGData module 8 | ---------------------- 9 | 10 | .. automodule:: eqtools.AUGData 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | eqtools.CModEFIT module 16 | ----------------------- 17 | 18 | .. automodule:: eqtools.CModEFIT 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | eqtools.D3DEFIT module 24 | ---------------------- 25 | 26 | .. automodule:: eqtools.D3DEFIT 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | eqtools.EFIT module 32 | ------------------- 33 | 34 | .. automodule:: eqtools.EFIT 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | eqtools.FromArrays module 40 | ------------------------- 41 | 42 | .. automodule:: eqtools.FromArrays 43 | :members: 44 | :undoc-members: 45 | :show-inheritance: 46 | 47 | eqtools.NSTXEFIT module 48 | ----------------------- 49 | 50 | .. automodule:: eqtools.NSTXEFIT 51 | :members: 52 | :undoc-members: 53 | :show-inheritance: 54 | 55 | eqtools.TCVLIUQE module 56 | ----------------------- 57 | 58 | .. automodule:: eqtools.TCVLIUQE 59 | :members: 60 | :undoc-members: 61 | :show-inheritance: 62 | 63 | eqtools.afilereader module 64 | -------------------------- 65 | 66 | .. automodule:: eqtools.afilereader 67 | :members: 68 | :undoc-members: 69 | :show-inheritance: 70 | 71 | eqtools.core module 72 | ------------------- 73 | 74 | .. automodule:: eqtools.core 75 | :members: 76 | :undoc-members: 77 | :show-inheritance: 78 | 79 | eqtools.eqdskreader module 80 | -------------------------- 81 | 82 | .. automodule:: eqtools.eqdskreader 83 | :members: 84 | :undoc-members: 85 | :show-inheritance: 86 | 87 | eqtools.filewriter module 88 | ------------------------- 89 | 90 | .. automodule:: eqtools.filewriter 91 | :members: 92 | :undoc-members: 93 | :show-inheritance: 94 | 95 | eqtools.pfilereader module 96 | -------------------------- 97 | 98 | .. automodule:: eqtools.pfilereader 99 | :members: 100 | :undoc-members: 101 | :show-inheritance: 102 | 103 | eqtools.trispline module 104 | ------------------------ 105 | 106 | .. automodule:: eqtools.trispline 107 | :members: 108 | :undoc-members: 109 | :show-inheritance: 110 | 111 | 112 | Module contents 113 | --------------- 114 | 115 | .. automodule:: eqtools 116 | :members: 117 | :undoc-members: 118 | :show-inheritance: 119 | -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | .. eqtools documentation master file, created by 2 | sphinx-quickstart on Wed Sep 4 17:55:14 2013. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | eqtools: Tools for interacting with magnetic equilibria 7 | ======================================================= 8 | 9 | Homepage: https://github.com/PSFCPlasmaTools/eqtools 10 | 11 | Overview 12 | -------- 13 | 14 | :py:mod:`eqtools` is a Python package for working with magnetic equilibrium reconstructions from magnetic plasma confinement devices. At present, interfaces exist for data from the Alcator C-Mod and NSTX MDSplus trees as well as eqdsk a- and g-files. :py:mod:`eqtools` is designed to be flexible and extensible such that it can become a uniform interface to perform mapping operations and accessing equilibrium data for any magnetic confinement device, regardless of how the data are accessed. 15 | 16 | The main class of :py:mod:`eqtools` is the :py:class:`~eqtools.core.Equilibrium`, which contains all of the coordinate mapping functions as well as templates for methods to fetch data (primarily dictated to the quantities computed by EFIT). Subclasses such as :py:class:`~eqtools.EFIT.EFITTree`, :py:class:`~eqtools.CModEFIT.CModEFITTree`, :py:class:`~eqtools.NSTXEFIT.NSTXEFITTree` and :py:class:`~eqtools.eqdskreader.EqdskReader` implement specific methods to access the data and convert it to the form needed for the routines in :py:class:`~eqtools.core.Equilibrium`. These classes are smart about caching intermediate results, so you will get a performance boost by using the same instance throughout your analysis of a given shot. 17 | 18 | Installation 19 | ------------ 20 | 21 | The easiest way to install the latest release version is with `pip`:: 22 | 23 | pip install eqtools 24 | 25 | To install from source, uncompress the source files and, from the directory containing `setup.py`, run the following command:: 26 | 27 | python setup.py install 28 | 29 | Or, to build in place, run:: 30 | 31 | python setup.py build_ext --inplace 32 | 33 | Tutorial: Performing Coordinate Transforms on Alcator C-Mod Data 34 | ---------------------------------------------------------------- 35 | 36 | The basic class for manipulating EFIT results stored in the Alcator C-Mod MDSplus tree is :py:class:`~eqtools.CModEFIT.CModEFITTree`. To load the data from a specific shot, simply create the :py:class:`~eqtools.CModEFIT.CModEFITTree` object with the shot number as the argument:: 37 | 38 | e = CModEFIT.CModEFITTree(1140729030) 39 | 40 | The default EFIT to use is "ANALYSIS." If you want to use a different tree, such as "EFIT20," then you simply set this with the `tree` keyword:: 41 | 42 | e = CModEFIT.CModEFITTree(1140729030, tree='EFIT20') 43 | 44 | :py:mod:`eqtools` understands units. The default is to convert all lengths to meters (whereas quantities in the tree are inconsistent -- some are meters, some centimeters). If you want to specify a different default unit, use the `length_unit` keyword:: 45 | 46 | e = CModEFIT.CModEFITTree(1140729030, length_unit='cm') 47 | 48 | Once this is loaded, you can access the data you would normally have to pull from specific nodes in the tree using convenient getter methods. For instance, to get the elongation as a function of time, you can run:: 49 | 50 | kappa = e.getElongation() 51 | 52 | The timebase used for quantities like this is accessed with:: 53 | 54 | t = e.getTimeBase() 55 | 56 | For length/area/volume quantities, :py:mod:`eqtools` understands units. The default is to return in whatever units you specified when creating the :py:class:`~eqtools.CModEFIT.CModEFITTree`, but you can override this with the `length_unit` keyword. For instance, to get the vertical position of the magnetic axis in mm, you can run:: 57 | 58 | Z_mag = e.getMagZ(length_unit='mm') 59 | 60 | :py:mod:`eqtools` can map from almost any coordinate to any common flux surface label. For instance, say you want to know what the square root of normalized toroidal flux corresponding to a normalized flux surface volume of 0.5 is at t=1.0s. You can simply call:: 61 | 62 | rho = e.volnorm2phinorm(0.5, 1.0, sqrt=True) 63 | 64 | If a list of times is provided, the default behavior is to evaluate all of the points to be converted at each of the times. So, to follow the mapping of normalized poloidal flux values [0.1, 0.5, 1.0] to outboard midplane major radius at time points [1.0, 1.25, 1.5, 1.75], you could call:: 65 | 66 | psinorm = e.psinorm2rmid([0.1, 0.5, 1.0], [1.0, 1.25, 1.5, 1.75]) 67 | 68 | This will return a 4-by-3 array: one row for each time, one column for each location. If you want to override this behavior and instead consider a sequence of (psi, t) points, set the `each_t` keyword to False:: 69 | 70 | psinorm = e.psinorm2rmid([0.3, 0.35], [1.0, 1.1], each_t=False) 71 | 72 | This will return a two-element array with the Rmid values for (psinorm=0.3, t=1.0) and (psinorm=0.35, t=1.1). 73 | 74 | For programmatically mapping between coordinates, the :py:meth:`~eqtools.core.Equilibrium.rho2rho` method is quite useful. To map from outboard midplane major radius to normalized flux surface volume, you can simply call:: 75 | 76 | e.rho2rho('Rmid', 'volnorm', 0.75, 1.0) 77 | 78 | Finally, to get a look at the flux surfaces, simply run:: 79 | 80 | e.plotFlux() 81 | 82 | Package Reference 83 | ----------------- 84 | 85 | .. toctree:: 86 | :maxdepth: 4 87 | 88 | eqtools 89 | 90 | 91 | Indices and tables 92 | ================== 93 | 94 | * :ref:`genindex` 95 | * :ref:`modindex` 96 | * :ref:`search` 97 | 98 | -------------------------------------------------------------------------------- /docs/source/modules.rst: -------------------------------------------------------------------------------- 1 | eqtools 2 | ======= 3 | 4 | .. toctree:: 5 | :maxdepth: 4 6 | 7 | eqtools 8 | -------------------------------------------------------------------------------- /docs/source/readthedocs-pip-requirements.txt: -------------------------------------------------------------------------------- 1 | numpy 2 | scipy 3 | matplotlib 4 | -------------------------------------------------------------------------------- /eqtools/.gitignore: -------------------------------------------------------------------------------- 1 | _tricubmodule.c 2 | -------------------------------------------------------------------------------- /eqtools/D3DEFIT.py: -------------------------------------------------------------------------------- 1 | # This program is distributed under the terms of the GNU General Purpose License (GPL). 2 | # Refer to http://www.gnu.org/licenses/gpl.txt 3 | # 4 | # This file is part of EqTools. 5 | # 6 | # EqTools is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # EqTools is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with EqTools. If not, see . 18 | 19 | """This module provides classes inheriting :py:class:`eqtools.EFIT.EFITTree` for 20 | working with DIII-D EFIT data. 21 | """ 22 | 23 | import scipy 24 | 25 | from .EFIT import EFITTree 26 | from .core import PropertyAccessMixin, ModuleWarning 27 | 28 | import warnings 29 | 30 | try: 31 | import MDSplus 32 | _has_MDS = True 33 | except Exception as _e_MDS: 34 | if isinstance(_e_MDS, ImportError): 35 | warnings.warn("MDSplus module could not be loaded -- classes that use " 36 | "MDSplus for data access will not work.", 37 | ModuleWarning) 38 | else: 39 | warnings.warn("MDSplus module could not be loaded -- classes that use " 40 | "MDSplus for data access will not work. Exception raised " 41 | "was of type %s, message was '%s'." 42 | % (_e_MDS.__class__, _e_MDS.message), 43 | ModuleWarning) 44 | _has_MDS = False 45 | 46 | 47 | class D3DEFITTree(EFITTree): 48 | """Inherits :py:class:`eqtools.EFIT.EFITTree` class. Machine-specific data 49 | handling class for DIII-D. Pulls EFIT data from selected MDS tree 50 | and shot, stores as object attributes. Each EFIT variable or set of 51 | variables is recovered with a corresponding getter method. Essential data 52 | for EFIT mapping are pulled on initialization (e.g. psirz grid). Additional 53 | data are pulled at the first request and stored for subsequent usage. 54 | 55 | Intializes DIII-D version of EFITTree object. Pulls data from MDS tree for 56 | storage in instance attributes. Core attributes are populated from the MDS 57 | tree on initialization. Additional attributes are initialized as None, 58 | filled on the first request to the object. 59 | 60 | Args: 61 | shot (integer): DIII-D shot index. 62 | 63 | Keyword Args: 64 | tree (string): Optional input for EFIT tree, defaults to 'EFIT01' 65 | (i.e., EFIT data are under \\EFIT01::top.results). 66 | length_unit (string): Sets the base unit used for any quantity whose 67 | dimensions are length to any power. Valid options are: 68 | 69 | =========== =========================================================================================== 70 | 'm' meters 71 | 'cm' centimeters 72 | 'mm' millimeters 73 | 'in' inches 74 | 'ft' feet 75 | 'yd' yards 76 | 'smoot' smoots 77 | 'cubit' cubits 78 | 'hand' hands 79 | 'default' whatever the default in the tree is (no conversion is performed, units may be inconsistent) 80 | =========== =========================================================================================== 81 | 82 | Default is 'm' (all units taken and returned in meters). 83 | gfile (string): Optional input for EFIT geqdsk location name, 84 | defaults to 'geqdsk' (i.e., EFIT data are under 85 | \\tree::top.results.GEQDSK) 86 | afile (string): Optional input for EFIT aeqdsk location name, 87 | defaults to 'aeqdsk' (i.e., EFIT data are under 88 | \\tree::top.results.AEQDSK) 89 | tspline (Boolean): Sets whether or not interpolation in time is 90 | performed using a tricubic spline or nearest-neighbor 91 | interpolation. Tricubic spline interpolation requires at least 92 | four complete equilibria at different times. It is also assumed 93 | that they are functionally correlated, and that parameters do 94 | not vary out of their boundaries (derivative = 0 boundary 95 | condition). Default is False (use nearest neighbor interpolation). 96 | monotonic (Boolean): Sets whether or not the "monotonic" form of time 97 | window finding is used. If True, the timebase must be monotonically 98 | increasing. Default is False (use slower, safer method). 99 | """ 100 | def __init__(self, shot, tree='EFIT01', length_unit='m', gfile='geqdsk', 101 | afile='aeqdsk', tspline=False, monotonic=True): 102 | root = '\\'+tree+'::top.results.' 103 | 104 | super(D3DEFITTree, self).__init__(shot, 105 | tree, 106 | root, 107 | length_unit=length_unit, 108 | gfile=gfile, 109 | afile=afile, 110 | tspline=tspline, 111 | monotonic=monotonic) 112 | 113 | def getFluxVol(self): 114 | """Not implemented in D3DEFIT tree. 115 | 116 | Returns: 117 | volume within flux surface [psi,t] 118 | """ 119 | super(EFITTree, self).getFluxVol() 120 | 121 | def getRmidPsi(self, length_unit=1): 122 | """returns maximum major radius of each flux surface. 123 | 124 | Keyword Args: 125 | length_unit (String or 1): unit of Rmid. Defaults to 1, indicating 126 | the default parameter unit (typically m). 127 | 128 | Returns: 129 | Rmid (Array): [nt,npsi] array of maximum (outboard) major radius of 130 | flux surface psi. 131 | 132 | Raises: 133 | Value Error: if module cannot retrieve data from MDS tree. 134 | """ 135 | 136 | super(EFITTree, self).getRmidPsi() 137 | 138 | 139 | class D3DEFITTreeProp(D3DEFITTree, PropertyAccessMixin): 140 | """D3DEFITTree with the PropertyAccessMixin added to enable property-style 141 | access. This is good for interactive use, but may drag the performance down. 142 | """ 143 | pass 144 | -------------------------------------------------------------------------------- /eqtools/FromArrays.py: -------------------------------------------------------------------------------- 1 | # This program is distributed under the terms of the GNU General Purpose License (GPL). 2 | # Refer to http://www.gnu.org/licenses/gpl.txt 3 | # 4 | # This file is part of EqTools. 5 | # 6 | # EqTools is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # EqTools is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with EqTools. If not, see . 18 | 19 | from .core import Equilibrium 20 | 21 | import numpy 22 | 23 | 24 | class ArrayEquilibrium(Equilibrium): 25 | """Class to represent an equilibrium specified as arrays of data. 26 | 27 | Create ArrayEquilibrium instance from arrays of data. 28 | 29 | Has very little checking on the shape/type of the arrays at this point. 30 | 31 | Args: 32 | psiRZ: Array-like, (M, N, P). 33 | Flux values at M times, N Z locations and P R locations. 34 | rGrid: Array-like, (P,). 35 | R coordinates that psiRZ is given at. 36 | zGrid: Array-like, (N,). 37 | Z coordinates that psiRZ is given at. 38 | time: Array-like, (M,). 39 | Times that psiRZ is given at. 40 | q: Array-like, (S, M). 41 | q profile evaluated at S values of psinorm from 0 to 1, given at M 42 | times. 43 | fluxVol: Array-like, (S, M). 44 | Flux surface volumes evaluated at S values of psinorm from 0 to 1, 45 | given at M times. 46 | psiLCFS: Array-like, (M,). 47 | Flux at the last closed flux surface, given at M times. 48 | psiAxis: Array-like, (M,). 49 | Flux at the magnetic axis, given at M times. 50 | rmag: Array-like, (M,). 51 | Radial coordinate of the magnetic axis, given at M times. 52 | zmag: Array-like, (M,). 53 | Vertical coordinate of the magnetic axis, given at M times. 54 | Rout: Outboard midplane radius of the last closed flux surface. 55 | 56 | Keyword Args: 57 | length_unit: String. 58 | Sets the base unit used for any quantity whose 59 | dimensions are length to any power. Valid options are: 60 | 61 | =========== =========================================================================================== 62 | 'm' meters 63 | 'cm' centimeters 64 | 'mm' millimeters 65 | 'in' inches 66 | 'ft' feet 67 | 'yd' yards 68 | 'smoot' smoots 69 | 'cubit' cubits 70 | 'hand' hands 71 | 'default' whatever the default in the tree is (no conversion is performed, units may be inconsistent) 72 | =========== =========================================================================================== 73 | 74 | Default is 'm' (all units taken and returned in meters). 75 | tspline: Boolean. 76 | Sets whether or not interpolation in time is 77 | performed using a tricubic spline or nearest-neighbor 78 | interpolation. Tricubic spline interpolation requires at least 79 | four complete equilibria at different times. It is also assumed 80 | that they are functionally correlated, and that parameters do 81 | not vary out of their boundaries (derivative = 0 boundary 82 | condition). Default is False (use nearest neighbor interpolation). 83 | monotonic: Boolean. 84 | Sets whether or not the "monotonic" form of time window 85 | finding is used. If True, the timebase must be monotonically 86 | increasing. Default is False (use slower, safer method). 87 | verbose: Boolean. 88 | Allows or blocks console readout during operation. Defaults to True, 89 | displaying useful information for the user. Set to False for quiet 90 | usage or to avoid console clutter for multiple instances. 91 | """ 92 | def __init__(self, psiRZ, rGrid, zGrid, time, q, fluxVol, psiLCFS, psiAxis, 93 | rmag, zmag, Rout, **kwargs): 94 | self._psiRZ = numpy.asarray(psiRZ, dtype=float) 95 | self._rGrid = numpy.asarray(rGrid, dtype=float) 96 | self._zGrid = numpy.asarray(zGrid, dtype=float) 97 | self._time = numpy.asarray(time, dtype=float) 98 | self._qpsi = numpy.asarray(q, dtype=float) 99 | self._fluxVol = numpy.asarray(fluxVol, dtype=float) 100 | self._psiLCFS = numpy.asarray(psiLCFS, dtype=float) 101 | self._psiAxis = numpy.asarray(psiAxis, dtype=float) 102 | self._rmag = numpy.asarray(rmag, dtype=float) 103 | self._zmag = numpy.asarray(zmag, dtype=float) 104 | self._RmidLCFS = numpy.asarray(Rout, dtype=float) 105 | 106 | self._defaultUnits = {} 107 | self._defaultUnits['_psiRZ'] = 'Wb/rad' 108 | self._defaultUnits['_rGrid'] = 'm' 109 | self._defaultUnits['_zGrid'] = 'm' 110 | self._defaultUnits['_time'] = 's' 111 | self._defaultUnits['_qpsi'] = ' ' 112 | self._defaultUnits['_fluxVol'] = 'm^3' 113 | self._defaultUnits['_psiLFCS'] = 'Wb/rad' 114 | self._defaultUnits['_psiAxis'] = 'Wb/rad' 115 | self._defaultUnits['_rmag'] = 'm' 116 | self._defaultUnits['_zmag'] = 'm' 117 | self._defaultUnits['_RmidLCFS'] = 'm' 118 | self._defaultUnits['_RLCFS'] = 'm' 119 | self._defaultUnits['_ZLCFS'] = 'm' 120 | 121 | super(ArrayEquilibrium, self).__init__(**kwargs) 122 | 123 | def getTimeBase(self): 124 | """Returns a copy of the time base vector, array dimensions are (M,). 125 | """ 126 | return self._time.copy() 127 | 128 | def getFluxGrid(self): 129 | """Returns a copy of the flux array, dimensions are (M, N, P), corresponding to (time, Z, R). 130 | """ 131 | return self._psiRZ.copy() 132 | 133 | def getRGrid(self, length_unit=1): 134 | """Returns a copy of the radial grid, dimensions are (P,). 135 | """ 136 | unit_factor = self._getLengthConversionFactor( 137 | self._defaultUnits['_rGrid'], length_unit 138 | ) 139 | return unit_factor * self._rGrid.copy() 140 | 141 | def getZGrid(self, length_unit=1): 142 | """Returns a copy of the vertical grid, dimensions are (N,). 143 | """ 144 | unit_factor = self._getLengthConversionFactor( 145 | self._defaultUnits['_zGrid'], length_unit 146 | ) 147 | return unit_factor * self._zGrid.copy() 148 | 149 | def getQProfile(self): 150 | """Returns safety factor q profile (over Q values of psinorm from 0 to 1), dimensions are (Q, M) 151 | """ 152 | return self._qpsi.copy() 153 | 154 | def getFluxVol(self, length_unit=3): 155 | """returns volume within flux surface [psi,t] 156 | """ 157 | unit_factor = self._getLengthConversionFactor( 158 | self._defaultUnits['_fluxVol'], length_unit 159 | ) 160 | return unit_factor * self._fluxVol.copy() 161 | 162 | def getFluxLCFS(self): 163 | """returns psi at separatrix [t] 164 | """ 165 | return self._psiLCFS.copy() 166 | 167 | def getFluxAxis(self): 168 | """returns psi on magnetic axis [t] 169 | """ 170 | return self._psiAxis.copy() 171 | 172 | def getMagR(self, length_unit=1): 173 | """returns magnetic-axis major radius [t] 174 | """ 175 | unit_factor = self._getLengthConversionFactor( 176 | self._defaultUnits['_rmag'], length_unit 177 | ) 178 | return unit_factor * self._rmag.copy() 179 | 180 | def getMagZ(self, length_unit=1): 181 | """returns magnetic-axis Z [t] 182 | """ 183 | unit_factor = self._getLengthConversionFactor( 184 | self._defaultUnits['_zmag'], length_unit 185 | ) 186 | return unit_factor * self._zmag.copy() 187 | 188 | def getRmidOut(self, length_unit=1): 189 | """returns outboard-midplane major radius [t] 190 | """ 191 | unit_factor = self._getLengthConversionFactor( 192 | self._defaultUnits['_RmidLCFS'], length_unit 193 | ) 194 | return unit_factor * self._RmidLCFS.copy() 195 | 196 | def getRLCFS(self, length_unit=1): 197 | raise NotImplementedError( 198 | "getRLCFS not supported for ArrayEquilibrium!" 199 | ) 200 | 201 | def getZLCFS(self, length_unit=1): 202 | raise NotImplementedError( 203 | "getRLCFS not supported for ArrayEquilibrium!" 204 | ) 205 | 206 | def getCurrentSign(self): 207 | return 1 208 | -------------------------------------------------------------------------------- /eqtools/__init__.py: -------------------------------------------------------------------------------- 1 | # This program is distributed under the terms of the GNU General Purpose License (GPL). 2 | # Refer to http://www.gnu.org/licenses/gpl.txt 3 | # 4 | # This file is part of EqTools. 5 | # 6 | # EqTools is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # EqTools is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with EqTools. If not, see . 18 | 19 | """Provides classes for interacting with magnetic equilibrium data in a variety of formats. 20 | """ 21 | 22 | __version__ = '1.5.0' 23 | 24 | from .core import * 25 | # from .EFIT import * 26 | # from .CModEFIT import * 27 | # from .AUGData import * 28 | # from .NSTXEFIT import * 29 | # from .D3DEFIT import * 30 | # from .eqdskreader import * 31 | # from .pfilereader import * 32 | # from .FromArrays import * 33 | # from .TCVLIUQE import * 34 | -------------------------------------------------------------------------------- /eqtools/_tricub.h: -------------------------------------------------------------------------------- 1 | /***************************************************************** 2 | 3 | This file is part of the eqtools package. 4 | 5 | EqTools is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | EqTools is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with EqTools. If not, see . 17 | 18 | Copyright 2025 Ian C. Faust 19 | 20 | ******************************************************************/ 21 | 22 | long ismonotonic(double val[], int ix); 23 | long isregular(double val[], int ix); 24 | 25 | void nonreg_ev(double val[], double x0[], double x1[], double x2[], double f[], double fx0[], double fx1[], double fx2[], int ix0, int ix1, int ix2, int ix); 26 | void nonreg_ev_full(double val[], double x0[], double x1[], double x2[], double f[], double fx0[], double fx1[], double fx2[], int ix0, int ix1, int ix2, int ix, int d0, int d1, int d2); 27 | void reg_ev(double val[], double x0[], double x1[], double x2[], double f[], double fx0[], double fx1[], double fx2[], int ix0, int ix1, int ix2, int ix); 28 | void reg_ev_full(double val[], double x0[], double x1[], double x2[], double f[], double fx0[], double fx1[], double fx2[], int ix0, int ix1, int ix2, int ix, int d0, int d1, int d2); 29 | void ev(double val[], double x0[], double x1[], double x2[], double f[], double fx0[], double fx1[], double fx2[], int ix0, int ix1, int ix2, int ix); 30 | -------------------------------------------------------------------------------- /eqtools/_tricub.pyf: -------------------------------------------------------------------------------- 1 | ! File _tricub.pyf 2 | python module _tricub 3 | interface 4 | 5 | C This file is part of the EqTools package. 6 | C 7 | C EqTools is free software: you can redistribute it and/or modify 8 | C it under the terms of the GNU General Public License as published by 9 | C the Free Software Foundation, either version 3 of the License, or 10 | C (at your option) any later version. 11 | C 12 | C EqTools is distributed in the hope that it will be useful, 13 | C but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | C GNU General Public License for more details. 16 | C 17 | C You should have received a copy of the GNU General Public License 18 | C along with EqTools. If not, see . 19 | C 20 | C Copyright 2013 Ian C. Faust 21 | 22 | subroutine reg_ev(val,x0,x1,x2,f,fx0,fx1,fx2,ix0,ix1,ix2,ix) 23 | intent(c) reg_ev 24 | intent(c) 25 | 26 | integer intent(hide),depend(x0) :: ix = len(x0) 27 | integer intent(hide),depend(f) :: ix0 = shape(f,2) 28 | integer intent(hide),depend(f) :: ix1 = shape(f,1) 29 | integer intent(hide),depend(f) :: ix2 = shape(f,0) 30 | double precision intent(in) :: x0(ix) 31 | double precision intent(in) :: x1(ix) 32 | double precision intent(in) :: x2(ix) 33 | double precision intent(in) :: fx0(ix0) 34 | double precision intent(in) :: fx1(ix1) 35 | double precision intent(in) :: fx2(ix2) 36 | double precision intent(in) :: f(ix2,ix1,ix0) 37 | double precision intent(out) :: val(ix) 38 | 39 | end subroutine reg_ev 40 | 41 | subroutine reg_ev_full(val,x0,x1,x2,f,fx0,fx1,fx2,ix0,ix1,ix2,ix,d0,d1,d2) 42 | intent(c) reg_ev_full 43 | intent(c) 44 | 45 | integer intent(hide),depend(x0) :: ix = len(x0) 46 | integer intent(hide),depend(f) :: ix0 = shape(f,2) 47 | integer intent(hide),depend(f) :: ix1 = shape(f,1) 48 | integer intent(hide),depend(f) :: ix2 = shape(f,0) 49 | double precision intent(in) :: x0(ix) 50 | double precision intent(in) :: x1(ix) 51 | double precision intent(in) :: x2(ix) 52 | double precision intent(in) :: fx0(ix0) 53 | double precision intent(in) :: fx1(ix1) 54 | double precision intent(in) :: fx2(ix2) 55 | double precision intent(in) :: f(ix2,ix1,ix0) 56 | double precision intent(out) :: val(ix) 57 | integer intent(in) :: d0 58 | integer intent(in) :: d1 59 | integer intent(in) :: d2 60 | 61 | end subroutine reg_ev_full 62 | 63 | 64 | subroutine nonreg_ev(val,x0,x1,x2,f,fx0,fx1,fx2,ix0,ix1,ix2,ix) 65 | intent(c) nonreg_ev 66 | intent(c) 67 | 68 | integer intent(hide),depend(x0) :: ix = len(x0) 69 | integer intent(hide),depend(f) :: ix0 = shape(f,2) 70 | integer intent(hide),depend(f) :: ix1 = shape(f,1) 71 | integer intent(hide),depend(f) :: ix2 = shape(f,0) 72 | double precision intent(in) :: x0(ix) 73 | double precision intent(in) :: x1(ix) 74 | double precision intent(in) :: x2(ix) 75 | double precision intent(in) :: fx0(ix0) 76 | double precision intent(in) :: fx1(ix1) 77 | double precision intent(in) :: fx2(ix2) 78 | double precision intent(in) :: f(ix2,ix1,ix0) 79 | double precision intent(out) :: val(ix) 80 | 81 | end subroutine nonreg_ev 82 | 83 | subroutine nonreg_ev_full(val,x0,x1,x2,f,fx0,fx1,fx2,ix0,ix1,ix2,ix,d0,d1,d2) 84 | intent(c) nonreg_ev_full 85 | intent(c) 86 | 87 | integer intent(hide),depend(x0) :: ix = len(x0) 88 | integer intent(hide),depend(f) :: ix0 = shape(f,2) 89 | integer intent(hide),depend(f) :: ix1 = shape(f,1) 90 | integer intent(hide),depend(f) :: ix2 = shape(f,0) 91 | double precision intent(in) :: x0(ix) 92 | double precision intent(in) :: x1(ix) 93 | double precision intent(in) :: x2(ix) 94 | double precision intent(in) :: fx0(ix0) 95 | double precision intent(in) :: fx1(ix1) 96 | double precision intent(in) :: fx2(ix2) 97 | double precision intent(in) :: f(ix2,ix1,ix0) 98 | double precision intent(out) :: val(ix) 99 | integer intent(in) :: d0 100 | integer intent(in) :: d1 101 | integer intent(in) :: d2 102 | 103 | end subroutine nonreg_ev_full 104 | 105 | 106 | subroutine ev(val,x0,x1,x2,f,fx0,fx1,fx2,ix0,ix1,ix2,ix,d0,d1,d2) 107 | intent(c) ev 108 | intent(c) 109 | 110 | integer intent(hide),depend(x0) :: ix = len(x0) 111 | integer intent(hide),depend(f) :: ix0 = shape(f,2) 112 | integer intent(hide),depend(f) :: ix1 = shape(f,1) 113 | integer intent(hide),depend(f) :: ix2 = shape(f,0) 114 | double precision intent(in) :: x0(ix) 115 | double precision intent(in) :: x1(ix) 116 | double precision intent(in) :: x2(ix) 117 | double precision intent(in) :: fx0(ix0) 118 | double precision intent(in) :: fx1(ix1) 119 | double precision intent(in) :: fx2(ix2) 120 | double precision intent(in) :: f(ix2,ix1,ix0) 121 | double precision intent(out) :: val(ix) 122 | integer intent(in) :: d0 123 | integer intent(in) :: d1 124 | integer intent(in) :: d2 125 | 126 | end subroutine ev 127 | 128 | function ismonotonic(val,ix) 129 | intent(c) ismonotonic 130 | intent(c) 131 | 132 | integer intent(hide),depend(val) :: ix = len(val) 133 | double precision intent(in) :: val(ix) 134 | 135 | end function ismonotonic 136 | 137 | function isregular(val,ix) 138 | intent(c) isregular 139 | intent(c) 140 | 141 | integer intent(hide),depend(val) :: ix = len(val) 142 | double precision intent(in) :: val(ix) 143 | 144 | end function isregular 145 | 146 | end interface 147 | end python module _tricub 148 | 149 | -------------------------------------------------------------------------------- /eqtools/_tricubmodule.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | #include "_tricub.h" 7 | 8 | /***************************************************************** 9 | 10 | This file is part of the eqtools package. 11 | 12 | EqTools is free software: you can redistribute it and/or modify 13 | it under the terms of the GNU General Public License as published by 14 | the Free Software Foundation, either version 3 of the License, or 15 | (at your option) any later version. 16 | 17 | EqTools is distributed in the hope that it will be useful, 18 | but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | GNU General Public License for more details. 21 | 22 | You should have received a copy of the GNU General Public License 23 | along with EqTools. If not, see . 24 | 25 | Copyright 2025 Ian C. Faust 26 | 27 | ******************************************************************/ 28 | 29 | #define LENGTH_ASSERT(a, i) \ 30 | if (check_1d_array(a, i)) \ 31 | return 1 32 | 33 | #define ARRAY_SHAPE(a, i) PyArray_DIM((PyArrayObject *)a, i) 34 | #define ARRAY_DATA(a) PyArray_DATA((PyArrayObject *)a) 35 | 36 | #define CHECK_ARRAY(a) \ 37 | if (to_array(&a)) \ 38 | return 1 39 | 40 | struct input { 41 | double *x0; 42 | double *x1; 43 | double *x2; 44 | double *f; 45 | double *fx0; 46 | double *fx1; 47 | double *fx2; 48 | int ix0; 49 | int ix1; 50 | int ix2; 51 | int ix; 52 | int d0; 53 | int d1; 54 | int d2; 55 | }; 56 | 57 | static inline int 58 | to_array(PyObject **obj) { /* Check in numpy array, dtype is double, and if the 59 | * number of dimensions of the array is correct, then 60 | * return the numpy C-contiguous array. Otherwise, 61 | * raise a specified Python error and return NULL. 62 | */ 63 | PyArrayObject *array = NULL; 64 | 65 | if (!((*obj) && PyArray_Check(*obj))) { 66 | PyErr_SetString(PyExc_TypeError, "Input is not a numpy.ndarray subtype"); 67 | return 1; 68 | } 69 | array = (PyArrayObject *)*obj; 70 | 71 | if (PyArray_TYPE(array) != NPY_DOUBLE) { 72 | PyErr_SetString(PyExc_TypeError, "array must be dtype double"); 73 | return 1; 74 | } 75 | 76 | if (!PyArray_ISCARRAY_RO(array)) 77 | array = PyArray_GETCONTIGUOUS(*obj); 78 | *obj = (PyObject*) array; 79 | 80 | return 0; 81 | } 82 | 83 | static inline int check_1d_array(PyObject *array, int length) { 84 | if (array && ARRAY_SHAPE(array, 0) != length) { 85 | PyErr_SetString(PyExc_TypeError, "1-d array has incorrect length"); 86 | return 1; 87 | } 88 | return 0; 89 | } 90 | 91 | static int to_scalar(PyObject *obj, void *output) { 92 | // if not supplied do nothing 93 | if (!obj) 94 | return 0; 95 | 96 | if (PyArray_CheckScalar(obj)) { 97 | PyErr_SetString(PyExc_TypeError, "Input is not a numpy scalar"); 98 | return 1; 99 | } 100 | 101 | if (PyArray_TYPE((PyArrayObject *)obj) != NPY_INT) { 102 | PyErr_SetString(PyExc_TypeError, "scalar must be dtype int"); 103 | return 1; 104 | } 105 | 106 | PyArray_ScalarAsCtype(obj, output); 107 | return 0; 108 | } 109 | 110 | static inline int parse_input(PyObject *args, struct input *data) { 111 | PyObject *x0obj, *x1obj, *x2obj, *fobj, *fx0obj, *fx1obj, *fx2obj; 112 | PyObject *d0obj = NULL, *d1obj = NULL, *d2obj = NULL; 113 | if (!PyArg_ParseTuple(args, "OOOOOOO|OOO", &x0obj, &x1obj, &x2obj, &fobj, 114 | &fx0obj, &fx1obj, &fx2obj, &d0obj, &d1obj, &d2obj)) 115 | return 1; 116 | 117 | CHECK_ARRAY(x0obj); 118 | CHECK_ARRAY(x1obj); 119 | CHECK_ARRAY(x2obj); 120 | CHECK_ARRAY(fobj); 121 | CHECK_ARRAY(fx0obj); 122 | CHECK_ARRAY(fx1obj); 123 | CHECK_ARRAY(fx2obj); 124 | 125 | // get dimension for testing 126 | data->ix = ARRAY_SHAPE(x0obj, 0); 127 | 128 | LENGTH_ASSERT(x1obj, data->ix); 129 | LENGTH_ASSERT(x2obj, data->ix); 130 | 131 | // assert f is 3 dimensions 132 | if (!fobj || PyArray_NDIM((PyArrayObject *)fobj) != 3) { 133 | PyErr_SetString(PyExc_TypeError, "f array is not 3 dimensional"); 134 | return 1; 135 | } 136 | 137 | data->ix0 = ARRAY_SHAPE(fobj, 2); 138 | data->ix1 = ARRAY_SHAPE(fobj, 1); 139 | data->ix2 = ARRAY_SHAPE(fobj, 0); 140 | 141 | LENGTH_ASSERT(fx0obj, data->ix0); 142 | LENGTH_ASSERT(fx1obj, data->ix1); 143 | LENGTH_ASSERT(fx2obj, data->ix2); 144 | // set values for C code 145 | data->x0 = (double *)ARRAY_DATA(x0obj); 146 | data->x1 = (double *)ARRAY_DATA(x1obj); 147 | data->x2 = (double *)ARRAY_DATA(x2obj); 148 | data->f = (double *)ARRAY_DATA(fobj); 149 | data->fx0 = (double *)ARRAY_DATA(fx0obj); 150 | data->fx1 = (double *)ARRAY_DATA(fx1obj); 151 | data->fx2 = (double *)ARRAY_DATA(fx2obj); 152 | 153 | if (d0obj && to_scalar(d0obj, &data->d0)) 154 | return 1; 155 | if (d1obj && to_scalar(d0obj, &data->d1)) 156 | return 1; 157 | if (d2obj && to_scalar(d0obj, &data->d2)) 158 | return 1; 159 | 160 | return 0; 161 | } 162 | 163 | static PyObject *python_reg_ev( 164 | PyObject *self, 165 | PyObject *args) { /* If the above function returns -1, an 166 | * appropriate Python exception will have been 167 | * set, and the function simply returns NULL 168 | */ 169 | double *val; 170 | struct input s; 171 | npy_intp length; 172 | PyObject *output; 173 | 174 | if (parse_input(args, &s)) 175 | return NULL; 176 | length = (npy_intp)s.ix; 177 | output = PyArray_SimpleNew(1, &length, NPY_DOUBLE); 178 | val = (double *)ARRAY_DATA(output); 179 | 180 | reg_ev(val, s.x0, s.x1, s.x2, s.f, s.fx0, s.fx1, s.fx2, s.ix0, s.ix1, s.ix2, 181 | s.ix); 182 | return output; 183 | } 184 | 185 | static PyObject *python_reg_ev_full( 186 | PyObject *self, 187 | PyObject *args) { /* If the above function returns -1, an appropriate Python 188 | * exception will have been set, and the function simply 189 | * returns NULL 190 | */ 191 | double *val; 192 | struct input s; 193 | npy_intp length; 194 | PyObject *output; 195 | 196 | if (parse_input(args, &s)) 197 | return NULL; 198 | length = (npy_intp)s.ix; 199 | output = PyArray_SimpleNew(1, &length, NPY_DOUBLE); 200 | val = (double *)ARRAY_DATA(output); 201 | 202 | reg_ev_full(val, s.x0, s.x1, s.x2, s.f, s.fx0, s.fx1, s.fx2, s.ix0, s.ix1, 203 | s.ix2, s.ix, s.d0, s.d1, s.d2); 204 | return output; 205 | } 206 | 207 | static PyObject *python_nonreg_ev( 208 | PyObject *self, 209 | PyObject *args) { /* If the above function returns -1, an appropriate Python 210 | * exception will have been set, and the function simply 211 | * returns NULL 212 | */ 213 | double *val; 214 | struct input s; 215 | npy_intp length; 216 | PyObject *output; 217 | 218 | if (parse_input(args, &s)) 219 | return NULL; 220 | length = (npy_intp)s.ix; 221 | output = PyArray_SimpleNew(1, &length, NPY_DOUBLE); 222 | val = (double *)ARRAY_DATA(output); 223 | 224 | nonreg_ev(val, s.x0, s.x1, s.x2, s.f, s.fx0, s.fx1, s.fx2, s.ix0, s.ix1, 225 | s.ix2, s.ix); 226 | return output; 227 | } 228 | 229 | static PyObject *python_nonreg_ev_full( 230 | PyObject *self, 231 | PyObject *args) { /* If the above function returns -1, an appropriate Python 232 | * exception will have been set, and the function simply 233 | * returns NULL 234 | */ 235 | double *val; 236 | struct input s; 237 | npy_intp length; 238 | PyObject *output; 239 | 240 | if (parse_input(args, &s)) 241 | return NULL; 242 | length = (npy_intp)s.ix; 243 | output = PyArray_SimpleNew(1, &length, NPY_DOUBLE); 244 | val = (double *)ARRAY_DATA(output); 245 | 246 | nonreg_ev_full(val, s.x0, s.x1, s.x2, s.f, s.fx0, s.fx1, s.fx2, s.ix0, s.ix1, 247 | s.ix2, s.ix, s.d0, s.d1, s.d2); 248 | return output; 249 | } 250 | 251 | static PyObject * 252 | python_ev(PyObject *self, 253 | PyObject *args) { /* If the above function returns -1, an appropriate 254 | * Python exception will have been set, and the 255 | * function simply returns NULL 256 | */ 257 | double *val; 258 | struct input s; 259 | npy_intp length; 260 | PyObject *output; 261 | 262 | if (parse_input(args, &s)) 263 | return NULL; 264 | length = (npy_intp)s.ix; 265 | output = PyArray_SimpleNew(1, &length, NPY_DOUBLE); 266 | val = (double *)ARRAY_DATA(output); 267 | 268 | ev(val, s.x0, s.x1, s.x2, s.f, s.fx0, s.fx1, s.fx2, s.ix0, s.ix1, s.ix2, 269 | s.ix); 270 | return output; 271 | } 272 | 273 | static PyObject *python_ismonotonic(PyObject *self, PyObject *arg) { 274 | int ix; 275 | double *data; 276 | 277 | if (to_array(&arg)) 278 | return NULL; 279 | ix = ARRAY_SHAPE(arg, 0); 280 | data = (double *)ARRAY_DATA(arg); 281 | return PyBool_FromLong(ismonotonic(data, ix)); 282 | } 283 | 284 | static PyObject *python_isregular(PyObject *self, PyObject *arg) { 285 | int ix; 286 | double *data; 287 | if (to_array(&arg)) 288 | return NULL; 289 | 290 | ix = ARRAY_SHAPE(arg, 0); 291 | data = (double *)ARRAY_DATA(arg); 292 | return PyBool_FromLong(isregular(data, ix)); 293 | } 294 | 295 | static PyMethodDef TricubMethods[] = { 296 | {"reg_ev", python_reg_ev, METH_VARARGS, ""}, 297 | {"reg_ev_full", python_reg_ev_full, METH_VARARGS, ""}, 298 | {"nonreg_ev", python_nonreg_ev, METH_VARARGS, ""}, 299 | {"nonreg_ev_full", python_nonreg_ev_full, METH_VARARGS, ""}, 300 | {"ev", python_ev, METH_VARARGS, ""}, 301 | {"ismonotonic", python_ismonotonic, METH_O, ""}, 302 | {"isregular", python_isregular, METH_O, ""}, 303 | {NULL, NULL, 0, NULL} /* Sentinel */ 304 | }; 305 | 306 | static struct PyModuleDef _tricubStruct = {PyModuleDef_HEAD_INIT, 307 | "_tricub", 308 | "", 309 | -1, 310 | TricubMethods, 311 | NULL, 312 | NULL, 313 | NULL, 314 | NULL}; 315 | 316 | /* Module initialization */ 317 | PyObject *PyInit__tricub(void) { 318 | import_array(); 319 | return PyModule_Create(&_tricubStruct); 320 | } 321 | -------------------------------------------------------------------------------- /eqtools/pfilereader.py: -------------------------------------------------------------------------------- 1 | # This program is distributed under the terms of the GNU General Purpose License (GPL). 2 | # Refer to http://www.gnu.org/licenses/gpl.txt 3 | # 4 | # This file is part of EqTools. 5 | # 6 | # EqTools is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # EqTools is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with EqTools. If not, see . 18 | 19 | """ 20 | This module contains the :py:class:`PFileReader` class, a lightweight data 21 | handler for p-file (radial profile) datasets. 22 | 23 | Classes: 24 | PFileReader: 25 | Data-storage class for p-file data. Reads 26 | data from ASCII p-file, storing as copy-safe object 27 | attributes. 28 | """ 29 | 30 | import numpy as np 31 | import csv 32 | import re 33 | from collections import namedtuple 34 | 35 | 36 | class PFileReader(object): 37 | """Class to read ASCII p-file (profile data storage) into lightweight, 38 | user-friendly data structure. 39 | 40 | P-files store data blocks containing the following: a header with parameter 41 | name, parameter units, x-axis units, and number of data points, followed by 42 | values of axis x, parameter y, and derivative dy/dx. Each parameter block 43 | is read into a namedtuple storing 44 | 45 | ======== ============== 46 | 'name' parameter name 47 | 'npts' array size 48 | 'x' abscissa array 49 | 'y' data array 50 | 'dydx' data gradient 51 | 'xunits' abscissa units 52 | 'units' data units 53 | ======== ============== 54 | 55 | with each namedtuple stored as an attribute of the PFileReader instance. 56 | This gracefully handles variable formats of p-files (differing versions of 57 | p-files will have different parameters stored). Data blocks are accessed 58 | as attributes in a copy-safe manner. 59 | 60 | Creates instance of PFileReader. 61 | 62 | Args: 63 | pfile (String): Path to ASCII p-file to be loaded. 64 | 65 | Keyword Args: 66 | verbose (Boolean): Option to print message on object creation 67 | listing available data parameters. Defaults to True. 68 | 69 | Examples: 70 | Load p-file data located at `file_path`, while suppressing terminal 71 | output of stored parameters:: 72 | 73 | pfr = eqtools.PFileReader(file_path,verbose=False) 74 | 75 | Recover electron density data (for example):: 76 | 77 | ne_data = pfr.ne 78 | 79 | Recover abscissa and electron density data (for example):: 80 | 81 | ne = pfr.ne.y 82 | abscis = pfr.ne.x 83 | 84 | Available parameters in pfr may be listed via the overridden __str__ 85 | command. 86 | """ 87 | def __init__(self, pfile, verbose=True): 88 | self._pfile = pfile 89 | self._params = [] 90 | 91 | with open(pfile, 'r') as readfile: 92 | dia = csv.excel() 93 | dia.skipinitialspace = True 94 | reader = csv.reader(readfile, dia, delimiter=' ') 95 | 96 | # define data structure as named tuple for storing parameter values 97 | data = namedtuple( 98 | 'DataStruct', 99 | ['name', 'npts', 'units', 'xunits', 'x', 'y', 'dydx'] 100 | ) 101 | 102 | # iterate through lines of file, checking for a header line; 103 | # at each header, read the next npts lines of data into 104 | # appropriate arrays. 105 | # continue until no headerline is found (throws StopIteration). 106 | # Populate list of params with available variables. 107 | while True: 108 | try: 109 | headerline = next(reader) 110 | except StopIteration: 111 | break 112 | 113 | npts = int(headerline[0]) # size of abscissa, data arrays 114 | abscis = headerline[1] # string name of abscissa variable (e.g. 'psinorm') 115 | var = re.split(r'[\(\)]', headerline[2]) 116 | param = var[0] # string name of parameter (e.g. 'ne') 117 | units = var[1] # string name of units (e.g. '10^20/m^3') 118 | 119 | # read npts next lines, populate arrays 120 | x = [] 121 | val = [] 122 | gradval = [] 123 | for j in range(npts): 124 | dataline = next(reader) 125 | x.append(float(dataline[0])) 126 | val.append(float(dataline[1])) 127 | gradval.append(float(dataline[2])) 128 | x = np.array(x) 129 | val = np.array(val) 130 | gradval = np.array(gradval) 131 | 132 | # collate into storage structure 133 | vars(self)['_'+param] = data(name=param, 134 | npts=npts, 135 | units=units, 136 | xunits=abscis, 137 | x=x, 138 | y=val, 139 | dydx=gradval) 140 | self._params.append(param) 141 | 142 | if verbose: 143 | print('P-file data loaded from '+self._pfile) 144 | print('Available parameters:') 145 | for par in self._params: 146 | un = vars(self)['_'+par].units 147 | xun = vars(self)['_'+par].xunits 148 | print(str(par).ljust(8)+str(xun).ljust(12)+str(un)) 149 | 150 | def __str__(self): 151 | """overrides default string method for useful output. 152 | """ 153 | mes = 'P-file data from '+self._pfile+' containing parameters:\n' 154 | for par in self._params: 155 | un = vars(self)['_'+par].units 156 | xun = vars(self)['_'+par].xunits 157 | mes += str(par).ljust(8)+str(xun).ljust(12)+str(un)+'\n' 158 | return mes 159 | 160 | def __getattribute__(self, name): 161 | """Copy-safe attribute retrieval method overriding default 162 | object.__getattribute__. 163 | 164 | Tries to retrieve attribute as-written (first check for default object 165 | attributes). If that fails, looks for pseudo-private attributes, marked 166 | by preceding underscore, to retrieve data blocks. If this fails, 167 | raise AttributeError. 168 | 169 | Args: 170 | name (String): Name (without leading underscore for data variables) 171 | of attribute. 172 | 173 | Raises: 174 | AttributeError: if no attribute can be found. 175 | """ 176 | try: 177 | return super(PFileReader, self).__getattribute__(name) 178 | except AttributeError: 179 | try: 180 | attr = super(PFileReader, self).__getattribute__('_'+name) 181 | if type(attr) is list: 182 | return attr[:] 183 | else: 184 | return attr 185 | except AttributeError: 186 | raise AttributeError('No attribute "%s" found' % name) 187 | 188 | def __setattr__(self, name, value): 189 | """Copy-safe attribute setting method overriding default 190 | `object.__setattr__`. 191 | 192 | Raises error if object already has attribute `_{name}` for input name, 193 | as such an attribute would interfere with automatic property generation 194 | in :py:meth:`__getattribute__`. 195 | 196 | Args: 197 | name (String): Attribute name. 198 | 199 | Raises: 200 | AttributeError: if attempting to create attribute with protected 201 | pseudo-private name. 202 | """ 203 | if hasattr(self, '_'+name): 204 | raise AttributeError( 205 | "PFileReader object already has data attribute" 206 | " '_%(n)s', creating attribute '%(n)s' will" 207 | " conflict with automatic property generation." 208 | % {'n': name} 209 | ) 210 | else: 211 | super(PFileReader, self).__setattr__(name, value) 212 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools", "numpy"] 3 | 4 | [project] 5 | name = "eqtools" 6 | version = "1.5.0" 7 | authors = [ 8 | { name="Mark Chilenski" }, 9 | { name="Ian Faust" }, 10 | { name="John Walk" } 11 | ] 12 | description = "Python tools for magnetic equilibria in tokamak plasmas" 13 | readme = "README.md" 14 | dependencies = [ 15 | "numpy", 16 | "scipy", 17 | "matplotlib" 18 | ] 19 | 20 | [project.urls] 21 | "Homepage" = "https://github.com/PSFCPlasmaTools/eqtools/" -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import numpy 2 | from setuptools import Extension, setup 3 | 4 | tricub = Extension( 5 | name='eqtools._tricub', 6 | sources=['eqtools/_tricubmodule.c', 'eqtools/_tricub.c'], 7 | include_dirs=[numpy.get_include(), './eqtools'], 8 | ) 9 | 10 | setup( 11 | name='eqtools', 12 | version='1.5.0', 13 | packages=['eqtools'], 14 | install_requires=['scipy', 'numpy', 'matplotlib'], 15 | author=['Mark Chilenski', 'Ian Faust', 'John Walk'], 16 | author_email='psfcplasmatools@mit.edu', 17 | url='https://github.com/PSFCPlasmaTools/eqtools/', 18 | description='Python tools for magnetic equilibria in tokamak plasmas', 19 | long_description=open('README.md', 'r').read(), 20 | ext_modules=[tricub], 21 | license='GPL' 22 | ) 23 | -------------------------------------------------------------------------------- /tests/demo.py: -------------------------------------------------------------------------------- 1 | # This script demonstrates some basic functionality of eqtools, giving basic 2 | # inputs and the expected outputs. For a more detailed demo, refer to the online 3 | # documentation at eqtools.readthedocs.org. For a more detailed set of tests, 4 | # run the files test.py and unittests.py in this directory. 5 | 6 | import eqtools 7 | 8 | # Load the sample data (for local C-Mod users the data are taken from the 9 | # MDSplus tree, for other users the pickled data are used): 10 | try: 11 | shot = 1120914027 12 | # Run tests with both of these to be sure that tspline does everything right: 13 | e = eqtools.CModEFITTree(shot) 14 | except: 15 | import warnings 16 | warnings.warn( 17 | "Could not access MDSplus data. Defaulting to pickled data. You may want " 18 | "to modify unittests.py to use your own local data system to ensure " 19 | "consistency for your use case.", 20 | RuntimeWarning 21 | ) 22 | try: 23 | import cPickle as pkl 24 | except: 25 | import pickle as pkl 26 | 27 | with open('test_data.pkl', 'rb') as f: 28 | shot, e, et = pkl.load(f, encoding='bytes') 29 | 30 | # Convert psinorm = 0.5 to Rmid at t=[0.25, 0.5, 0.75, 1.0]: 31 | Rmid = e.psinorm2rmid(0.5, [0.25, 0.5, 0.75, 1.0]) 32 | # Rmid should now be: [0.81060089, 0.81021389, 0.81252954, 0.81248401] 33 | -------------------------------------------------------------------------------- /tests/test.py: -------------------------------------------------------------------------------- 1 | # This program is distributed under the terms of the GNU General Purpose License (GPL). 2 | # Refer to http://www.gnu.org/licenses/gpl.txt 3 | # 4 | # This file is part of EqTools. 5 | # 6 | # EqTools is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # EqTools is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with EqTools. If not, see . 18 | 19 | """testing script using :py:class:`CircSolovievEFIT` object to compare 20 | numerical calculations of flux mapping to analytic forms used in 21 | Soloviev equilibria with circular cross section. 22 | """ 23 | import eqtools 24 | import SolovievEFIT as sefit 25 | import matplotlib as mpl 26 | import matplotlib.pyplot as plt 27 | import numpy 28 | import warnings 29 | 30 | warnings.simplefilter("ignore") 31 | plt.ion() 32 | 33 | # we will start by generating a Soloviev EFIT with C-Mod-like parameters: 34 | # R = 0.69 m, a = 0.22 m, Ip = 1.0 MA, Bt = 5.4 T. 35 | # we'll use a volume-averaged toroidal beta of 0.2 as well. 36 | # leave default length unit in meters, and use a 257x257 grid (default) 37 | 38 | equil = sefit.CircSolovievEFIT(0.69, 0.22, 5.4, 1.0, 0.02, npts=20) 39 | 40 | # show off our nice equilibrium! 41 | equil.plotFlux(False) 42 | 43 | # next we'll generate a testing RZ grid to check flux mappings between 44 | # the analytic and numerical solutions. We'll fill the entire mapping 45 | # space -- create a test point at the midpoint of each "face" in the 46 | # defined RZ grid in equil, so it's equidistant from each of its 47 | # nearest-neighbor points for the interpolation. 48 | 49 | # gets axes for psiRZ in equil 50 | R = equil.getRGrid() 51 | Z = equil.getZGrid() 52 | rGrid, zGrid = numpy.meshgrid(R, Z) 53 | 54 | # construct face points as meshgrid 55 | rFace, zFace = numpy.meshgrid((R[:-1] + R[1:]) / 2.0, (Z[:-1] + Z[1:]) / 2.0) 56 | print(rFace.shape) 57 | 58 | # plot illustration 59 | fig = plt.figure(figsize=(8, 8)) 60 | ax = fig.add_subplot(111) 61 | ax.plot(rGrid, zGrid, 'ob', markersize=5) 62 | ax.plot(rFace, zFace, 'or', markersize=5) 63 | 64 | # calculate fluxes! 65 | psi_analytic = equil.rz2psi_analytic(rFace, zFace) 66 | psi_numerical = equil.rz2psi(rFace, zFace) 67 | 68 | fig2 = plt.figure(figsize=(10, 8)) 69 | ax2 = fig2.add_subplot(111) 70 | ax2.set_xlabel('$R$ (m)') 71 | ax2.set_ylabel('$Z$ (m)') 72 | ax2.set_title( 73 | "$(\\psi_{analytic} - \\psi_{numerical})/\\psi_{analytic}$, %i x %i grid" 74 | % (equil._npts, equil._npts) 75 | ) 76 | cf = ax2.contourf( 77 | rFace, zFace, (psi_analytic-psi_numerical)/psi_analytic, 50, zorder=2 78 | ) 79 | cb = plt.colorbar(cf) 80 | circ = plt.Circle( 81 | (equil._R, 0.0), equil._a, ec='r', fc='none', linewidth=3, zorder=3 82 | ) 83 | ax2.add_patch(circ) 84 | ax2.plot(equil._R, 0.0, 'rx', markersize=10, zorder=3) 85 | 86 | fig3, (ax3, ax4) = plt.subplots(1, 2, sharey=True, figsize=(16, 8)) 87 | ax3.contourf(rFace, zFace, psi_analytic, 50) 88 | ax4.contourf(rFace, zFace, psi_numerical, 50) 89 | fig3.subplots_adjust(wspace=0) 90 | ax3.set_xlabel('$R$ (m)') 91 | ax4.set_xlabel('$R$ (m)') 92 | ax3.set_ylabel('$Z$ (m)') 93 | ax3.set_title('analytic calculation') 94 | ax4.set_title('numerical calculation') 95 | 96 | fig4 = plt.figure(figsize=(8, 8)) 97 | ax5 = fig4.add_subplot(111) 98 | ax5.contour(rGrid, zGrid, equil.rz2psi(rGrid, zGrid), 50) 99 | --------------------------------------------------------------------------------