Store and access magnetic field coefficients for Feltor
Project description
A lightweight module to store and access magnetic field coefficients for Feltor
The repository serves as a storage for often used magnetic field coefficients for Feltor simulations. Furthermore it provides uniform access to these coefficients through a python interface. Together with the simplesimdb module this interface can then be used to setup and run Feltor simulations that require geometry coefficients on input.
Installation
We do not (yet) have an uploaded version on pypi. Install directly from github:
pip install git+https://github.com/feltor-dev/magneticfielddb
OR clone the repository and then use the package manager pip.
git clone https://github.com/feltor-dev/magneticfielddb
cd magneticfielddb
pip install . # local installation of the module
pip install .[test] # Install pytest
pytest --capture=tee-sys . # run the unittests
In order to locally run the included jupyter-notebooks you can use
pip install .[jupyter] # Install all necessary dependencies
jupyter-lab # run notebooks
Usage
Here is an example of how we iterate over all files in the data repository open them into a python dictionaries and display them on stdout.
### example.py ###
import magneticfielddb as mag
# list all files in the data repository
for f in mag.files() :
# read each file into a dictionary
coefficients = mag.select( f)
# print to stdout
print( coefficients)
Package Notes
- each file contains at least the "equilibrium", "R_0" and "description" fields
- "R_0" is given in units of meter
- "PP" and "PI" are 1 by default
- Files may contain a field "comment" that contains human readable information string
Additional Resources
polynomial_field.ipynbis an example notebook of how to fit polynomial coefficients to given equilibrium. Read the doxygen documentation ondg::geo::createMagneticFieldto find out about valid fields in yourjsonfilenormalize_params.cppis a C++ program that should be used on geometry input files (all files with X-points must be normalized such that the X-point closest to the O-point lies on the Psip=0 surface). Compile withmakeand run with./normalize_params your-params.json your-params.jsonto update parameters in-place.OneSizeFitsAllEquilbrium.nbis a Mathematica notebook that generates solovev coefficientsq-profiles.ipynbis a jupyter notebook that plots q-profiles and flux surfaces for all equilibria in the database usingpath/to/feltor/src/geometry_diag/geometry_diag.cppandsimplesimdbgeometry_diag.ipynbis a jupyter notebook that shows how newly made parameters behave in Feltor and how wall and sheath parameters should be setup for a 3d simulation usingpath/to/feltor/src/geometry_diag/geometry_diag.cppandsimplesimdb
Contributions
Contributions are welcome.
Authors
Matthias Wiesenberger and Markus Held
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file magneticfielddb-0.1.1.tar.gz.
File metadata
- Download URL: magneticfielddb-0.1.1.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bac15bd8f3569b4a89220e4a7501a9198aeca2809e15663e36b3cf9a24873276
|
|
| MD5 |
515bbc16e3c89127a85b4b953e9c7026
|
|
| BLAKE2b-256 |
5d01405371d52ab6b8e94461c018039374bd9953a571dc6864157762ba991ed6
|
Provenance
The following attestation bundles were made for magneticfielddb-0.1.1.tar.gz:
Publisher:
python_publish.yml on feltor-dev/magneticfielddb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
magneticfielddb-0.1.1.tar.gz -
Subject digest:
bac15bd8f3569b4a89220e4a7501a9198aeca2809e15663e36b3cf9a24873276 - Sigstore transparency entry: 253357127
- Sigstore integration time:
-
Permalink:
feltor-dev/magneticfielddb@8bb920bb7b813228bbf4902e88d7e347d7982c13 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/feltor-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python_publish.yml@8bb920bb7b813228bbf4902e88d7e347d7982c13 -
Trigger Event:
push
-
Statement type:
File details
Details for the file magneticfielddb-0.1.1-py3-none-any.whl.
File metadata
- Download URL: magneticfielddb-0.1.1-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a26bafd404d9c1eeed0c69e1d18ff3c09ad35ae9e0d52cb1708cb46feacba235
|
|
| MD5 |
50ce6a44b676abf88a057510f2c4d3d6
|
|
| BLAKE2b-256 |
6423ddd2c01490242d5366e87e6084607cce1c5b515fbf75ca3fdc40e827d15e
|
Provenance
The following attestation bundles were made for magneticfielddb-0.1.1-py3-none-any.whl:
Publisher:
python_publish.yml on feltor-dev/magneticfielddb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
magneticfielddb-0.1.1-py3-none-any.whl -
Subject digest:
a26bafd404d9c1eeed0c69e1d18ff3c09ad35ae9e0d52cb1708cb46feacba235 - Sigstore transparency entry: 253357130
- Sigstore integration time:
-
Permalink:
feltor-dev/magneticfielddb@8bb920bb7b813228bbf4902e88d7e347d7982c13 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/feltor-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python_publish.yml@8bb920bb7b813228bbf4902e88d7e347d7982c13 -
Trigger Event:
push
-
Statement type: