fsciortino / aurora Goto Github PK
View Code? Open in Web Editor NEWModern toolbox for impurity transport, neutrals and radiation modeling in magnetically-confined plasmas
Home Page: https://aurora-fusion.readthedocs.io
License: MIT License
Modern toolbox for impurity transport, neutrals and radiation modeling in magnetically-confined plasmas
Home Page: https://aurora-fusion.readthedocs.io
License: MIT License
On the to-do list: improve automatic testing via github workflow
As suggested at the plasma hack week (https://hack.plasmapy.org/), it would be nice for Aurora to use astropy.units to ensure consistent use of units.
More widespread use of xarrays would also be valuable.
This would be a great project for anyone hoping to begin contributing to Aurora.
I get the following error trying to import aurora from python:
Python 3.7.9 (default, Sep 6 2020, 13:20:25)
[Clang 11.0.3 (clang-1103.0.32.62)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import aurora
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/aurorafusion-1.0.11-py3.7-macosx-10.15-x86_64.egg/aurora/__init__.py", line 5, in <module>
__version__ = pkgutil.get_data("aurora", "version").decode()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/pkgutil.py", line 637, in get_data
return loader.get_data(resource_name)
File "<frozen importlib._bootstrap_external>", line 916, in get_data
FileNotFoundError: [Errno 2] No such file or directory: '/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/aurorafusion-1.0.11-py3.7-macosx-10.15-x86_64.egg/aurora/version'
>>>
My attempt to install aurora is:
Password:
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building extension "aurora._aurora" sources
f2py options: []
adding 'build/src.macosx-10.15-x86_64-3.7/build/src.macosx-10.15-x86_64-3.7/aurora/fortranobject.c' to sources.
adding 'build/src.macosx-10.15-x86_64-3.7/build/src.macosx-10.15-x86_64-3.7/aurora' to include_dirs.
build_src: building npy-pkg config files
running build_py
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize Gnu95FCompiler
Found executable /usr/local/bin/gfortran
customize Gnu95FCompiler using build_ext
mcclenaghan@F-C02Z321ML Aurora % sudo python setup.py install
running install
running bdist_egg
running egg_info
running build_src
build_src
building extension "aurora._aurora" sources
f2py options: []
adding 'build/src.macosx-10.15-x86_64-3.7/build/src.macosx-10.15-x86_64-3.7/aurora/fortranobject.c' to sources.
adding 'build/src.macosx-10.15-x86_64-3.7/build/src.macosx-10.15-x86_64-3.7/aurora' to include_dirs.
build_src: building npy-pkg config files
writing aurorafusion.egg-info/PKG-INFO
writing dependency_links to aurorafusion.egg-info/dependency_links.txt
writing requirements to aurorafusion.egg-info/requires.txt
writing top-level names to aurorafusion.egg-info/top_level.txt
reading manifest template 'MANIFEST.in'
writing manifest file 'aurorafusion.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.15-x86_64/egg
running install_lib
running build_py
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
get_default_fcompiler: matching types: '['gnu95', 'nag', 'absoft', 'ibm', 'intel', 'gnu', 'pg']'
customize Gnu95FCompiler
Found executable /usr/local/bin/gfortran
customize Gnu95FCompiler
customize Gnu95FCompiler using build_ext
creating build/bdist.macosx-10.15-x86_64/egg
creating build/bdist.macosx-10.15-x86_64/egg/aurora
copying build/lib.macosx-10.15-x86_64-3.7/aurora/animate.py -> build/bdist.macosx-10.15-x86_64/egg/aurora
copying build/lib.macosx-10.15-x86_64-3.7/aurora/coords.py -> build/bdist.macosx-10.15-x86_64/egg/aurora
copying build/lib.macosx-10.15-x86_64-3.7/aurora/source_utils.py -> build/bdist.macosx-10.15-x86_64/egg/aurora
copying build/lib.macosx-10.15-x86_64-3.7/aurora/particle_conserv.py -> build/bdist.macosx-10.15-x86_64/egg/aurora
copying build/lib.macosx-10.15-x86_64-3.7/aurora/nbi_neutrals.py -> build/bdist.macosx-10.15-x86_64/egg/aurora
copying build/lib.macosx-10.15-x86_64-3.7/aurora/adas_files.py -> build/bdist.macosx-10.15-x86_64/egg/aurora
copying build/lib.macosx-10.15-x86_64-3.7/aurora/__init__.py -> build/bdist.macosx-10.15-x86_64/egg/aurora
copying build/lib.macosx-10.15-x86_64-3.7/aurora/core.py -> build/bdist.macosx-10.15-x86_64/egg/aurora
copying build/lib.macosx-10.15-x86_64-3.7/aurora/plot_tools.py -> build/bdist.macosx-10.15-x86_64/egg/aurora
copying build/lib.macosx-10.15-x86_64-3.7/aurora/_aurora.cpython-37m-darwin.so -> build/bdist.macosx-10.15-x86_64/egg/aurora
copying build/lib.macosx-10.15-x86_64-3.7/aurora/default_nml.py -> build/bdist.macosx-10.15-x86_64/egg/aurora
copying build/lib.macosx-10.15-x86_64-3.7/aurora/synth_diags.py -> build/bdist.macosx-10.15-x86_64/egg/aurora
copying build/lib.macosx-10.15-x86_64-3.7/aurora/radiation.py -> build/bdist.macosx-10.15-x86_64/egg/aurora
copying build/lib.macosx-10.15-x86_64-3.7/aurora/interp.py -> build/bdist.macosx-10.15-x86_64/egg/aurora
copying build/lib.macosx-10.15-x86_64-3.7/aurora/janev_smith_rates.py -> build/bdist.macosx-10.15-x86_64/egg/aurora
copying build/lib.macosx-10.15-x86_64-3.7/aurora/atomic.py -> build/bdist.macosx-10.15-x86_64/egg/aurora
copying build/lib.macosx-10.15-x86_64-3.7/aurora/grids_utils.py -> build/bdist.macosx-10.15-x86_64/egg/aurora
byte-compiling build/bdist.macosx-10.15-x86_64/egg/aurora/animate.py to animate.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/aurora/coords.py to coords.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/aurora/source_utils.py to source_utils.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/aurora/particle_conserv.py to particle_conserv.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/aurora/nbi_neutrals.py to nbi_neutrals.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/aurora/adas_files.py to adas_files.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/aurora/__init__.py to __init__.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/aurora/core.py to core.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/aurora/plot_tools.py to plot_tools.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/aurora/default_nml.py to default_nml.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/aurora/synth_diags.py to synth_diags.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/aurora/radiation.py to radiation.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/aurora/interp.py to interp.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/aurora/janev_smith_rates.py to janev_smith_rates.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/aurora/atomic.py to atomic.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/aurora/grids_utils.py to grids_utils.cpython-37.pyc
creating stub loader for aurora/_aurora.cpython-37m-darwin.so
byte-compiling build/bdist.macosx-10.15-x86_64/egg/aurora/_aurora.py to _aurora.cpython-37.pyc
creating build/bdist.macosx-10.15-x86_64/egg/EGG-INFO
copying aurorafusion.egg-info/PKG-INFO -> build/bdist.macosx-10.15-x86_64/egg/EGG-INFO
copying aurorafusion.egg-info/SOURCES.txt -> build/bdist.macosx-10.15-x86_64/egg/EGG-INFO
copying aurorafusion.egg-info/dependency_links.txt -> build/bdist.macosx-10.15-x86_64/egg/EGG-INFO
copying aurorafusion.egg-info/requires.txt -> build/bdist.macosx-10.15-x86_64/egg/EGG-INFO
copying aurorafusion.egg-info/top_level.txt -> build/bdist.macosx-10.15-x86_64/egg/EGG-INFO
writing build/bdist.macosx-10.15-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
aurora.__pycache__._aurora.cpython-37: module references __file__
aurora.__pycache__.adas_files.cpython-37: module references __file__
aurora.__pycache__.core.cpython-37: module references __file__
creating 'dist/aurorafusion-1.0.11-py3.7-macosx-10.15-x86_64.egg' and adding 'build/bdist.macosx-10.15-x86_64/egg' to it
removing 'build/bdist.macosx-10.15-x86_64/egg' (and everything under it)
Processing aurorafusion-1.0.11-py3.7-macosx-10.15-x86_64.egg
removing '/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/aurorafusion-1.0.11-py3.7-macosx-10.15-x86_64.egg' (and everything under it)
creating /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/aurorafusion-1.0.11-py3.7-macosx-10.15-x86_64.egg
Extracting aurorafusion-1.0.11-py3.7-macosx-10.15-x86_64.egg to /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
aurorafusion 1.0.11 is already the active version in easy-install.pth
Installed /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/aurorafusion-1.0.11-py3.7-macosx-10.15-x86_64.egg
Processing dependencies for aurorafusion==1.0.11
Searching for omfit-gapy==2020.11.2.20.1
Best match: omfit-gapy 2020.11.2.20.1
Processing omfit_gapy-2020.11.2.20.1-py3.7.egg
omfit-gapy 2020.11.2.20.1 is already the active version in easy-install.pth
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/omfit_gapy-2020.11.2.20.1-py3.7.egg
Searching for omfit-eqdsk==2020.11.2.20.1
Best match: omfit-eqdsk 2020.11.2.20.1
Processing omfit_eqdsk-2020.11.2.20.1-py3.7.egg
omfit-eqdsk 2020.11.2.20.1 is already the active version in easy-install.pth
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/omfit_eqdsk-2020.11.2.20.1-py3.7.egg
Searching for xarray==0.16.1
Best match: xarray 0.16.1
Adding xarray 0.16.1 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for matplotlib==3.3.0
Best match: matplotlib 3.3.0
Adding matplotlib 3.3.0 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for scipy==1.5.4
Best match: scipy 1.5.4
Adding scipy 1.5.4 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for numpy==1.19.4
Best match: numpy 1.19.4
Adding numpy 1.19.4 to easy-install.pth file
Installing f2py script to /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin
Installing f2py3 script to /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin
Installing f2py3.7 script to /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for omfit-commonclasses==2020.11.2.20.1
Best match: omfit-commonclasses 2020.11.2.20.1
Processing omfit_commonclasses-2020.11.2.20.1-py3.7.egg
omfit-commonclasses 2020.11.2.20.1 is already the active version in easy-install.pth
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/omfit_commonclasses-2020.11.2.20.1-py3.7.egg
Searching for omfit-path==2020.11.2.20.1
Best match: omfit-path 2020.11.2.20.1
Processing omfit_path-2020.11.2.20.1-py3.7.egg
omfit-path 2020.11.2.20.1 is already the active version in easy-install.pth
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/omfit_path-2020.11.2.20.1-py3.7.egg
Searching for omfit-ascii==2020.11.2.20.1
Best match: omfit-ascii 2020.11.2.20.1
Processing omfit_ascii-2020.11.2.20.1-py3.7.egg
omfit-ascii 2020.11.2.20.1 is already the active version in easy-install.pth
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/omfit_ascii-2020.11.2.20.1-py3.7.egg
Searching for uncertainties==3.1.5
Best match: uncertainties 3.1.5
Adding uncertainties 3.1.5 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for omas==0.67.0
Best match: omas 0.67.0
Adding omas 0.67.0 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for omfit-error==2020.11.2.20.1
Best match: omfit-error 2020.11.2.20.1
Processing omfit_error-2020.11.2.20.1-py3.7.egg
omfit-error 2020.11.2.20.1 is already the active version in easy-install.pth
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/omfit_error-2020.11.2.20.1-py3.7.egg
Searching for omfit-data==2020.11.2.20.1
Best match: omfit-data 2020.11.2.20.1
Processing omfit_data-2020.11.2.20.1-py3.7.egg
omfit-data 2020.11.2.20.1 is already the active version in easy-install.pth
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/omfit_data-2020.11.2.20.1-py3.7.egg
Searching for omfit-mds==2020.11.2.20.1
Best match: omfit-mds 2020.11.2.20.1
Processing omfit_mds-2020.11.2.20.1-py3.7.egg
omfit-mds 2020.11.2.20.1 is already the active version in easy-install.pth
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/omfit_mds-2020.11.2.20.1-py3.7.egg
Searching for omfit-namelist==2020.11.2.20.1
Best match: omfit-namelist 2020.11.2.20.1
Processing omfit_namelist-2020.11.2.20.1-py3.7.egg
omfit-namelist 2020.11.2.20.1 is already the active version in easy-install.pth
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/omfit_namelist-2020.11.2.20.1-py3.7.egg
Searching for omfit-nc==2020.11.2.20.1
Best match: omfit-nc 2020.11.2.20.1
Processing omfit_nc-2020.11.2.20.1-py3.7.egg
omfit-nc 2020.11.2.20.1 is already the active version in easy-install.pth
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/omfit_nc-2020.11.2.20.1-py3.7.egg
Searching for fortranformat==0.2.5
Best match: fortranformat 0.2.5
Processing fortranformat-0.2.5-py3.7.egg
fortranformat 0.2.5 is already the active version in easy-install.pth
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/fortranformat-0.2.5-py3.7.egg
Searching for setuptools==50.3.1
Best match: setuptools 50.3.1
Adding setuptools 50.3.1 to easy-install.pth file
Installing easy_install script to /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin
Installing easy_install-3.7 script to /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for pandas==1.1.2
Best match: pandas 1.1.2
Adding pandas 1.1.2 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for python-dateutil==2.8.1
Best match: python-dateutil 2.8.1
Adding python-dateutil 2.8.1 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for pyparsing==2.4.7
Best match: pyparsing 2.4.7
Adding pyparsing 2.4.7 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for Pillow==8.0.1
Best match: Pillow 8.0.1
Adding Pillow 8.0.1 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for kiwisolver==1.2.0
Best match: kiwisolver 1.2.0
Adding kiwisolver 1.2.0 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for cycler==0.10.0
Best match: cycler 0.10.0
Adding cycler 0.10.0 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for future==0.18.2
Best match: future 0.18.2
Adding future 0.18.2 to easy-install.pth file
Installing futurize script to /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin
Installing pasteurize script to /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for tqdm==4.53.0
Best match: tqdm 4.53.0
Adding tqdm 4.53.0 to easy-install.pth file
Installing tqdm script to /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for pymongo==3.11.0
Best match: pymongo 3.11.0
Adding pymongo 3.11.0 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for xmltodict==0.12.0
Best match: xmltodict 0.12.0
Adding xmltodict 0.12.0 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for netCDF4==1.5.4
Best match: netCDF4 1.5.4
Adding netCDF4 1.5.4 to easy-install.pth file
Installing nc3tonc4 script to /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin
Installing nc4tonc3 script to /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin
Installing ncinfo script to /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for Pyro5==5.11
Best match: Pyro5 5.11
Adding Pyro5 5.11 to easy-install.pth file
Installing pyro5-check-config script to /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin
Installing pyro5-echoserver script to /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin
Installing pyro5-httpgateway script to /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin
Installing pyro5-ns script to /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin
Installing pyro5-nsc script to /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for dnspython==2.0.0
Best match: dnspython 2.0.0
Adding dnspython 2.0.0 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for Pint==0.15
Best match: Pint 0.15
Adding Pint 0.15 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for boto3==1.16.23
Best match: boto3 1.16.23
Adding boto3 1.16.23 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for h5py==3.1.0
Best match: h5py 3.1.0
Adding h5py 3.1.0 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for pytz==2020.1
Best match: pytz 2020.1
Adding pytz 2020.1 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for six==1.15.0
Best match: six 1.15.0
Adding six 1.15.0 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for cftime==1.2.1
Best match: cftime 1.2.1
Adding cftime 1.2.1 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for serpent==1.30.2
Best match: serpent 1.30.2
Adding serpent 1.30.2 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for packaging==20.4
Best match: packaging 20.4
Adding packaging 20.4 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for importlib-metadata==1.7.0
Best match: importlib-metadata 1.7.0
Adding importlib-metadata 1.7.0 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for jmespath==0.10.0
Best match: jmespath 0.10.0
Adding jmespath 0.10.0 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for s3transfer==0.3.3
Best match: s3transfer 0.3.3
Adding s3transfer 0.3.3 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for botocore==1.19.23
Best match: botocore 1.19.23
Adding botocore 1.19.23 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for cached-property==1.5.1
Best match: cached-property 1.5.1
Adding cached-property 1.5.1 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for zipp==3.1.0
Best match: zipp 3.1.0
Adding zipp 3.1.0 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Searching for urllib3==1.25.10
Best match: urllib3 1.25.10
Adding urllib3 1.25.10 to easy-install.pth file
Using /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Finished processing dependencies for aurorafusion==1.0.11
I like to keep things up to date on issues (I forget stuff a lot), so I'll add what we discussed today (and some other minor issues I forgot to raise) as todo items:
makefile aurora
does (trial/error optimization and comparison of the two build processes, looks okay)examples/basic.py
Hey, great talk yesterday! :)
I'm 90% sure I'd be able to automate the installation process into a single conda install -c conda-forge aurora
(assuming the name is not taken). The reason why it'd be conda forge is because that's where community built packages generally live, and the main Anaconda repo (the big default) does not really accept contributions.
Would you like me to try? :)
As a senior to the Aurora, I have a few (maybe naive) questions as following in computing the fractional density of He ionization/recombination (~aurora/atomic.py) with this GREAT framework:
Line 864 in b64a8ca
I guess abs(table-table[...,[0]]).all() aims to test if the dimension of X is nontrival, thus a 1D interpolation could work instead of the 2D. However the function of .all() always returns a bool with true=1 and false=0 which is in the opposite of the original expectation.
Line 867 in b64a8ca
Iâm a bit comfused with this scale: *np.log(10). Since x, y, and table here are all the indeces of 10. Does it really mean 10**np.log(10) which seems make no sense?
Line 690 in b64a8ca
Looking forward to your reply!
Cheers,
Zhi
aurora
load spectral lines from ADAS
adf15
files into a dictionary where they are sorted by wavelength (i.e.: the wavelentgth, as a float, is the key of the dictionary)On python 3.7.11
, the behaviour when fed several times the same key is that the dict
will only retain the last provided value:
In [1]: {0: 1, 0: 2}
Out[1]: {0: 2}
It means that in its current version, aurora
, when confronted with several transitions of identical wavelengths, will only provide the one it encounters last in the file.
It is currently broken, as per #96, because of issues with the deprecated numpy.distutils.
@fsciortino please assign this issue to me :)
The current calculation of synchrotron radiation in AURORA is based on an old paper by Trubnikov. A more recent calculation by Albajar, Johner and Granata should be implemented (Eqs. 12-15 and the one after):
https://iopscience.iop.org/article/10.1088/0029-5515/41/6/301
User contributions would be welcome.
I can do this one too
The formula used in FACIT for the ICRH effects on poloidal asymmetry assumes just D(H) minority heating. Future fusion devices (SPARC) will use other schemes such as D(He3), D/T(He3).
In the original derivation by M. Reinke, they obtained a general expression and then specified it to D(H) which was grabbed for use it FACIT. Pretty straight forward to change that to account for other schemes.
@fsciortino @orso82 I get this error trying to import aurora inside of omfit:
import aurora
NameError: name 'SortedDict' is not defined
Press <F6> to see full error report...
Error in "OMFIT command box #2" at line 1
import aurora
NameError: name 'SortedDict' is not defined
Press <F6> to see full error report...
Traceback (most recent call last):
File "/Users/mcclenaghan/programming/OMFIT-source/omfit/classes/OMFITx.py", line 4071, in manage_user_errors
tmp=command(**kw)
File "/Users/mcclenaghan/programming/OMFIT-source/omfit/utils_tk.py", line 1060, in GlobLoc_tk
return py.run(_relLoc=self.namespace, _OMFITscriptsDict=False, _OMFITconsoleDict=True, noGUI=None)
File "/Users/mcclenaghan/programming/OMFIT-source/omfit/classes/omfit_python.py", line 1082, in run
result = self.__run__(**kw)
File "/Users/mcclenaghan/programming/OMFIT-source/omfit/classes/omfit_python.py", line 931, in __run__
self, userDict=kw, inputDict=_relLoc, persistentDict=OMFITconsoleDict, runDict={}, prerun=prerun, postrun=postrun
File "/Users/mcclenaghan/programming/OMFIT-source/omfit/classes/omfit_python.py", line 129, in f_locked
return f(*args, **kw)
File "/Users/mcclenaghan/programming/OMFIT-source/omfit/classes/omfit_python.py", line 362, in execGlobLoc
exec(compile(execString, filename, "exec"), GlobLoc)
File "/tmp/mcclenaghan/OMFIT/OMFIT_2020-11-24_08_53_06_787689/project/OMFIT command box #2", line 1, in <module>
import aurora
File "/Users/mcclenaghan/programming/Aurora/aurora/__init__.py", line 11, in <module>
from .core import *
File "/Users/mcclenaghan/programming/Aurora/aurora/core.py", line 13, in <module>
import omfit_eqdsk
File "/Users/mcclenaghan/programming/OMFIT-source/omfit/classes/omfit_eqdsk.py", line 227, in <module>
class OMFITgeqdsk(SortedDict, OMFITascii):
NameError: name 'SortedDict' is not defined```
I was attempting
aurora.atomic.get_atom_data('C', ['pls'])
, which failed because it attempted to download https://open.adas.ac.uk/download/adf11//pls/pls_C_14.dat
, which doesn't exist. I looked up PLS for carbon manually at open.adas.ac.uk and found that the filename is pls96_c.dat
.
I changed
files["C"]["pls"] = "pls_C_14.dat"
to
files["C"]["pls"] = "pls96_c.dat"
on line 229 of adas_files.py
and then aurora.atomic.get_atom_data('C', **['pls'])
completed without an error.
It would be helpful to include neoclassical calculations for cross-field particle transport coefficients in Aurora.
Since I am currently into the productive mood, @fsciortino @odstrcilt, I mention another issue of the code caused by problems in OMFIT. I already mentioned this here, and I think it is also mentioned in this Aurora PR.
Basically, the OMFIT utility which creates gEQDSK files is broken, following the update to Matplotlib 3.6. This issue is present and known since roughly one year (!!!), but yet not solved. Consquently, if one uses Python 3.11 and the latest Matplotlib, it is not possible to create an Aurora equilibrium starting from some experimental data (e.g. from AUG shotfiles).
IMHO this is a good example which tells why, sometimes, it might be better to be as self-consistent as possible, even at the cost of "re-inventing the wheel" a little bit :) I would suggest that some new functions might be written to create the necessary equilibrium structures for Aurora (starting from data other experimental packages such as, in the case of my interest, aug_sfutils), instead of relying on external packages, especially if they are huge (so inherently slow in solving their own issues). This would definitely make easier solving compatibility issues like the current one.
I might also assign myself as voluntary to do it, but I wanted to hear your opinion first.
EDIT: reading more thoroughly your comments here, I understand that you @odstrcilt are already well aware of this issue... so yes, I assume that you also already have an opinion about whether to possibly detach from the OMFIT ecosystem.
This is a short tutorial intended to answer questions from @Didou09, but posted here publicly hoping that it may be useful to other users in the future.
Here we demonstrate how to plot the He-like Ar x-ray spectrum using Aurora. We will make use of some photon emissivity coefficients (PECs) that are not distributed by ADAS (it is originally from atomDB, another database), but that can be requested by emailing me. Here we focus on the He-like Ar spectrum, discussed for example in J E Rice et al 2015 J. Phys. B: At. Mol. Opt. Phys. 48 144013 (https://iopscience.iop.org/article/10.1088/0953-4075/48/14/144013), which is analogous to the He-like Ca spectrum discussed in F. Sciortino et al 2021 Nucl. Fusion 61 126060 (https://iopscience.iop.org/article/10.1088/1741-4326/ac32f2). The same Aurora functionality can be used for any spectra for which ADAS data is available. Important: it is up to the user to assess the atomic data quality. Ask an expert for help if you're in doubt.
Let's begin with a few basic setup tasks, run in IPython:
import numpy as np, sys, os
import matplotlib.pyplot as plt
plt.ion()
from scipy.interpolate import interp1d
import aurora
# just some preferences to better see the spectra later, but not necessary
import matplotlib as mpl
mpl.rcParams['axes.titlesize'] = 24
mpl.rcParams['axes.labelsize'] = 20
mpl.rcParams['lines.linewidth'] = 1.5
mpl.rcParams['lines.markersize'] = 10
mpl.rcParams['xtick.labelsize'] = 16
mpl.rcParams['ytick.labelsize'] = 16
mpl.rcParams['legend.fontsize'] = 16
Next, we specify the PEC files of interest -- modify these appropriately to point to your files of interest. These must be in an ADF15 ADAS format.
Z_ion=18
filepath_h = 'pec#ar17.dat'
filepath_he = 'pec#ar16.dat'
filepath_li = 'pec#ar15.dat'
Here we referred to each file as "_h", "_he" and "_li" because these files correspond to the H-like, He-like and Li-like states of Ar ions. We then specify values of electron density and temperatures at which we want to compute the spectrum. We are going to pick the following values here, with units clearly specified in the variables' names:
Te_eV = 3.5e3
ne_cm3 = 1e14
To balance the abundance of Li-like, He-like and H-like Ar charge states, we must choose a model. In general, the density of these charge states will depend on both atomic physics (ionization and recombination balance) and transport physics. Here we are going to ignore the latter component for simplicity (although Aurora can simulate impurity transport in 1.5D) and just consider fractional abundances at ionization equilibrium, computed from ADAS data as follows:
# first load atomic data for Ar:
atom_data = aurora.get_atom_data('Ar',['scd','acd']) # accounting for effective ionization and recombination rates (ignore CX for simplicity)
# now compute fractional abundances -- this can be done for arrays of ne and Te (also including neutrals, if useful),
# but we are going to do it only for single values of ne and Te here
logTe, fz = aurora.get_frac_abundances(atom_data, np.array([ne_cm3,]), np.array([Te_eV,]), plot=False)
Then, we set up a figure and add the contributions to our spectrum of interest from each charge state:
fig, ax = plt.figure()
fig.set_size_inches(9,6, forward=True)
# value of Doppler shift -- here set to 0.15 mA for example
dlam_A = 0.00015
# now add spectra for each charge state -- see `get_local_spectrum` docs for details
out = aurora.get_local_spectrum(filepath_li, ion, ne_cm3, Te_eV, n0_cm3=0.0,
ion_exc_rec_dens=[fz[0,-5], fz[0,-4], fz[0,-3]], # Be-like, Li-like, He-like
dlam_A = dlam_A, plot_spec_tot=False, no_leg=True, plot_all_lines=True, ax=ax)
wave_final_li, spec_ion_li, spec_exc_li, spec_rec_li, spec_dr_li, spec_cx_li, ax = out
out= aurora.get_local_spectrum(filepath_he, ion, ne_cm3, Te_eV, n0_cm3=0.0,
ion_exc_rec_dens=[fz[0,-4], fz[0,-3], fz[0,-2]], # Li-like, He-like, H-like
dlam_A = dlam_A, plot_spec_tot=False, no_leg=True, plot_all_lines=True, ax=ax)
wave_final_he, spec_ion_he, spec_exc_he, spec_rec_he, spec_dr_he, spec_cx_he, ax = out
out = aurora.get_local_spectrum(filepath_h, ion, ne_cm3, Te_eV, n0_cm3=0.0,
ion_exc_rec_dens=[fz[0,-3], fz[0,-2], fz[0,-1]], # He-like, H-like, fully stripped
dlam_A = dlam_A, plot_spec_tot=False, no_leg=True, plot_all_lines=True, ax=ax)
wave_final_h, spec_ion_h, spec_exc_h, spec_rec_h, spec_dr_h, spec_cx_h, ax = out
# total spectra from all ions
spec_tot_li = spec_ion_li + spec_exc_li + spec_rec_li + spec_dr_li + spec_cx_li
spec_tot_he = spec_ion_he + spec_exc_he + spec_rec_he + spec_dr_he + spec_cx_he
spec_tot_h = spec_ion_h + spec_exc_h + spec_rec_h + spec_dr_h + spec_cx_h
# add plot of total spectrum
wave_all = np.linspace(plt.gca().get_xlim()[0], plt.gca().get_xlim()[1], 10000) #A
spec_all = interp1d(wave_final_li, spec_tot_li, bounds_error=False, fill_value=0.0)(wave_all)
spec_all += interp1d(wave_final_he, spec_tot_he, bounds_error=False, fill_value=0.0)(wave_all)
spec_all += interp1d(wave_final_h, spec_tot_h, bounds_error=False, fill_value=0.0)(wave_all)
plt.gca().plot(wave_all, spec_all, 'k', label='total')
# just to have nice legends:
ax2.plot([], [], c='r', ls='--', label='ionization')
ax2.plot([], [], c='b', ls='--', label='excitation')
ax2.plot([], [], c='g', ls='--', label='radiative recomb')
ax2.plot([], [], c='m', ls='--', label='dielectronic recomb')
This gives us a busy image like this:
Zooming into the region near 3.95 A, we see the familiar K-alpha spectrum of Ar (other spectral regions are also interesting, e.g. one can find the Ly-alpha lines using these files):
Hi,
I'm encountering an issue with Aurora when trying to plot the density of nitrogen charge state (say, Nâş) from a SOLPS-ITER run using plot2d_b2:
import numpy as np
import matplotlib.pyplot as plt
import aurora
case = aurora.solps_case(
b2fstate_path="./b2fstate",
b2fgmtry_path="./b2fgmtry",
)
fig, axis = plt.subplots()
# B2 fluid species are D, D+, N, N+ -> plot the third species, i.e. N+
data = case.data("na")[3]
case.plot2d_b2(data, ax=axis, scale="log", lb = 1e13, ub = 1e19, label="Density [$m^{-3}$]")
plt.show(block=True)
I attached two figures, one which shows the issue where one row of cells is missing from the PFR and instead extends into the main plasma. The other shows how I would expect the density distribution to appear (from solpspy).
plotting_issue_with_aurora
reference_plot_from_solpspy
I also attached the code and the b2-files I used:
aurora_plotting_issue.zip
I'm using aurora(fusion) 2.2.0.
Br,
Roni
This is a short demo aimed at answering questions by @Didou09, related to the issue/post in #45.
Here we demonstrate how to get line ratios, particularly focusing on the k and w ratios of the K-alpha Ar spectrum. We will show here how to reproduce Fig. 8 in J E Rice et al 2015 J. Phys. B: At. Mol. Opt. Phys. 48 144013 (https://iopscience.iop.org/article/10.1088/0953-4075/48/14/144013) using theoretical Photon Emissivity Coefficients (PECs). We will make use of PECs that are not distributed by ADAS (taken originally from atomDB), but that can be requested by emailing me. The same Aurora functionality can be used for any spectra for which ADAS data is available. Important: it is up to the user to assess the atomic data quality. Ask an expert for help if you're in doubt.
We first identify the k and w lines from the PEC files. We will only consider the dominant processes that populate upper levels of these lines: dielectronic recombination from the Li-like state of Ar for the k line, and excitation from the He-like state of Ar for the w line. Looking through the ADF15 (PEC) files mentioned above, we can identify the 2 lines of interest as the following
lam_Ar_k = 3.990000 # A, 1s 2p^2 {}^2D_{3/2} - 1s^2 2p {}^2P_{1/2} -- ISEL=1107 (DRSAT)
lam_Ar_w = 3.949075 # A, 1s 2p {}^1P_1 - 1s^2 {}^1S_0 -- ISEL=30 (EXCIT)
We next load all the PECs in the chosen files
# the k-like is only populated via dielectronic recombination from Li-like Ar, the w line mostly by excitation from He-like Ar
# PEC files also contain other minor contributions, which could be summed for completeness
filepath_he = 'pec#ar16.dat'
filepath_li = 'pec#ar15.dat'
log10pec_dict_he = aurora.read_adf15(filepath_he)
log10pec_dict_li = aurora.read_adf15(filepath_li)
After looking either at the ADF15 files or the Aurora log10pec_dict_* keys, you can plots the rates for excitation and recombination components using the plot_lines
argument. The following, for example, will show that the Li-like 3.99A line is much stronger than the 3.9877A one:
log10pec_dict_li = aurora.read_adf15(filepath_li, plot_lines=[3.99,3.9877])
To look at line ratios, one can either identify specific lines of interest (typically, looking at the spectral notation at the bottom of ADF15 files), or add all lines within a central wavelength range near the line of interest. If most lines except the one of interest are actually very weak, then only the strong one will matter.
Here, we plot only the ratio of the 2 lines identified above. Let's load the interpolanting functions specifically for the 2 lines of interest:
log10pec_k_interp = aurora.read_adf15(filepath_li)[lam_Ar_k]['drsat']
log10pec_w_interp = aurora.read_adf15(filepath_he)[lam_Ar_w]['excit']
We then create Te grid of interest, to reproduce the Te range of Rice et al. J. Phys. B: At. Mol. Opt. Phys. 48 (2015) 144013:
Te_grid = np.linspace(1e3, 3e3, 1000)
and we evaluate the intensity of the 2 lines at a single value of ne:
ne_cm3 = 1e14
k_intens = log10pec_k_interp(np.log10(ne_cm3), np.log10(Te_grid))[0,:]
w_intens = log10pec_w_interp(np.log10(ne_cm3), np.log10(Te_grid))[0,:]
Finally, we can plot the results and compare to Fig. 8 in the aforementioned paper:
fig,ax = plt.subplots()
ax.plot(Te_grid/1e3, 10**k_intens/10**w_intens)
ax.set_xlabel(r'$T_e$ [keV]')
ax.set_ylabel(r'k/w emissivity ratio')
plt.tight_layout()
This will give the following plot:
The file loaded by neutral.py is not there anymore.
Line 52 in f20a9c0
@fsciortino do you have a copy of this file somewhere?
Work has been started in order to include a more advanced recycling model which includes:
A more realistic (and optionally device-specific) pumping specification,
A treatment of wall retention which involves physics-based plasma-wall interaction models (including reflection, long term retention and release by ion sputtering), and
The possibility to impose semi-automatically a time-dependent transport model which mimics the ELM behavior.
Changes are being currently committed to the branch recycling_model.
Due to my various needs, I would like there to be more flexibility available in aurora.radiation.get_local_spectrum()
. I nominate myself to address these needs on appropriate branches to be reviewed by @fsciortino .
NOTE: In my efforts, I will be heavily relying on functions and data files from the Flexible Atomic Code (FAC, https://github.com/flexible-atomic-code/fac). This is because it can satisfy missing components to my needs not covered under OpenADAS. FAC may therefore become a hidden dependency when utilizing specific upgrades I need. Care would be taken for a more general user to have options to avoid this when possible.
Currently, only Doppler broadening is available for the line shape. I would like to convolute other shape due to other physics.
aurora.radiation.get_local_spectrum
that calculates the Doppler broadening profile will be moved to a hidden sub-function@fsciortino any opinions?
Due to my various needs, I would like there to be more flexibility available in aurora.radiation.get_local_spectrum()
. I nominate myself to address these needs on appropriate branches to be reviewed by @fsciortino .
NOTE: In my efforts, I will be heavily relying on functions and data files from the Flexible Atomic Code (FAC, https://github.com/flexible-atomic-code/fac). This is because it can satisfy missing components to my needs not covered under OpenADAS. FAC may therefore become a hidden dependency when utilizing specific upgrades I need. Care would be taken for a more general user to have options to avoid this when possible.
Aurora currently obtains data files available on OpenADAS or local files in the adf15 format. I am beginning heavy reliance on FAC to calculate photon emissivity coefficients (PECs) under various conditions so would like to integrate the two
aurora.radiation.get_local_spectrum()
a user gets to have a choice of using OpenADAS/adf15 files as normal or perform collisional-radiative modeling with FAC
@fsciortino any opinions?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
đ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. đđđ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google â¤ď¸ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.