Giter Site home page Giter Site logo

fsciortino / aurora Goto Github PK

View Code? Open in Web Editor NEW
29.0 6.0 19.0 27.96 MB

Modern toolbox for impurity transport, neutrals and radiation modeling in magnetically-confined plasmas

Home Page: https://aurora-fusion.readthedocs.io

License: MIT License

Python 88.37% Shell 0.01% Fortran 7.26% Julia 4.19% Makefile 0.18%
fusion radiation impurity-transport aurora magnetic stellarator tokamak modeling simulation julia

aurora's Introduction

Aurora: a modern toolbox for impurity transport, neutrals and radiation modeling

image

image

image

image

image

image

Aurora is a package to simulate heavy-ion transportm neutrals and radiation in magnetically-confined plasmas. It includes a 1.5D impurity transport forward model, thoroughly benchmarked with the widely-adopted STRAHL code. It also offers routines to analyze neutral states of hydrogen isotopes, both from the edge of fusion plasmas and from neutral beam injection. A simple interface to atomic data for fusion plasmas makes it a convenient tool for spectroscopy and integrated modeling. Aurora's code is mostly written in Python 3 and Fortran 90. An experimental Julia interface has also been added.

Documentation is available at https://aurora-fusion.readthedocs.io.

Development

The code is developed and maintained by F. Sciortino (MPI-IPP) in collaboration with T. Odstrcil (GA), D. Fajardo (MPI-IPP), A. Zito (MPI-IPP), A. Cavallaro (MIT) and R. Reksoatmodjo (W&M), with support from O. Linder (MPI-IPP), C. Johnson (U. Auburn), D. Stanczak (IPPLM) and S. Smith (GA). The STRAHL documentation provided by R.Dux (MPI-IPP) was extremely helpful to guide the initial development of Aurora.

New contributors are more than welcome! Please get in touch at francesco.sciortino-at-ipp.mpg.de or open a pull-request via Github.

Generally, we would appreciate if you could work with us to merge your features back into the main Aurora distribution if there is any chance that the changes that you made could be useful to others.

Installation

Aurora can be installed from PyPI using

pip install aurorafusion --user

You can omit the --user flag if you have write-access to the default package directory on your system and wish to install there.

Installing via conda is also possible using

conda install -c conda-forge aurorafusion

Both the PyPI and conda installation are automatically updated at every package release. Note that the conda installation does not currently install dependencies on omfit_classes, which users may need to install via pip (see the PyPI repo).

To look at the code and contribute to the Aurora repository, it is recommended to install from source, by git-cloning the Aurora repo from Github. This will ensure that you can access the latest version of the tools.

For compilation after git-cloning, users can make use of the setup.py file, e.g. using

python setup.py -e .

or use the makefile in the package directory to build the Fortran code using

make clean; make

Note that the makefile will not install any of the dependencies, listed in the requirements.txt file in the main directory. You can use this file to quickly install dependencies within a Python virtual environment, or install each dependency one at a time.

The Julia version of the code is not built by default. If you have Julia installed on your system, you can do

make julia

from the main package directory. This will build a Julia sysimage to speed up access of Julia source code from Python, but it is not strictly necessary. See the documentation to read about interfacing Python and Julia.

Atomic data

Aurora offers a simple interface to download, read, process and plot atomic data from the Atomic Data and Structure Analysis (ADAS) database, particularly through the OPEN-ADAS website: www.open-adas.ac.uk . ADAS data files can be fetched remotely and stored within the Aurora distribution directory, or users may choose to fetch ADAS files from a chosen, pre-existing directory by setting

export AURORA_ADAS_DIR=my_adas_directory

within their Linux environment (or analogous). If an ADAS files that is not available in AURORA_ADAS_DIR is requested by a user, Aurora attempts to download it and store it there. If you are using a public installation of Aurora and you do not have write-access to the directory where Aurora is installed, make sure to set AURORA_ADAS_DIR to a directory where you do have write-access before starting.

Several ADAS formats can currently be managed -- please see the docs. Please contact the authors to request and/or suggest expansions of current capabilities.

License

Aurora is distributed under the MIT License. The package is made open-source with the hope that this will speed up research on fusion energy and make further code development easier. However, we kindly ask that all users communicate to us their purposes, difficulties and successes with Aurora, so that we may support users as much as possible and grow the code further.

Citing Aurora

Please see the User Agreement.

aurora's People

Contributors

aarmros avatar ajcav avatar antonellozito avatar corvidcanine avatar danielfajardoj avatar didou09 avatar fsciortino avatar harryh5427 avatar odstrcilt avatar reksoatr avatar stanczakdominik avatar tgleiter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

aurora's Issues

Aurora processing of spectra

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:
drawing
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):

drawing

Here I also added some vertical dashed line that show the location and nomenclature of some standard lines (using Gabriel notation). See for example Sciortino et al RSI 92, 053508 (2021) (https://doi.org/10.1063/5.0043765) for a discussion of these components. The code above doesn't plot the vertical red-dashed lines, I only added them in my figure to help visualization.

Packaging issues

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:

  • Make pip install build an importable package just the way makefile aurora does (trial/error optimization and comparison of the two build processes, looks okay)
  • make sure pip install pulls the package dependencies (it didn't for me)
  • add basic CI for the build step
  • add basic tests through based on 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? :)

SOLPS-ITER impurity density plotting issue

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

Estimating line ratios

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:

drawing

FACIT -- Generalize ICRH effects

I can do this one too

Issue

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).

Plan of action

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.

Error running aurora inside of omfit

@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```

Variety in Line Shapes

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.

Issue

Currently, only Doppler broadening is available for the line shape. I would like to convolute other shape due to other physics.

Motivation

  • I would like to also include Natural broadening
    • On SPARC, we are considering Kr, Xe as seeded impurities for Ti measurements per XICS as the current workhorse, Ar, will burn through at the high electron temperatures in a fusion reactor environment
    • This comes with a drawback as the FWHM from Lorentzian Natural broadening scales ~Z^4
    • How important this effect is depends on the specific transition you're considering due to the specific population mechanisms, i.e. if we consider the He-like seqeuence this is still irrelevant for the z line, but can be comparable to the FWHM from Doppler broadening at lower ion temperatures for the w line (which is also brighter). Similar observations have been made for the Ne-like sequence.
    • We therefore wish to investigate how a Natural broadening component would impact Ti/vtor profile reconstructions on SPARC (per detector post-processing that will eventually be a dedicated module in ToFu)
  • I might also include Instrumental broadening
    • I use the ToFu synthetic diagnostic code (by D. Vezinet: https://github.com/ToFuProject/tofu, I understand you're familiar) which automatically convolutes instrumental broadening effects when performing the spectral-integration for the throughput to a pixel
    • Similar to Natural broadening, we wish to investigate an Instrumental broadening component and the impact on Ti/vtor profile reconstructions on SPARC (per detector post-processing that will eventually be a dedicated module in ToFu)
    • It may be useful for other users or for quick scoping to include a model for a Gaussian Instrumental broadening
  • I would like to also include super-Gaussian features due to suprathermal ions
    • On C-Mod, I am investigating potential observations of direct ICRF heating into the Ar impurity
    • I am in the process of calculating what the RF-accelerated Ar energy distributions are
    • We hypothesize that the energies reached are high enough to make a significant impact on the transport causing a significant drop in impurity density
    • This might have a noticeable effect on the line shapes measured from XICS
    • I would therefore like to explore this component when doing full spectra modeling, i.e. in ImpRad
    • I would also like to explore the impact of suprathermal ions on the inferred ion temperature on C-Mod

Plan of Action

  • The chunk of code in aurora.radiation.get_local_spectrum that calculates the Doppler broadening profile will be moved to a hidden sub-function
  • Similar hidden sub-functions will be created for other line spaces due to other physics
  • A task manager would therefore obtain profiles from user-requested physics (units 1/AA), convolute them together, and then multiply the relevant PEC at a wavelength (units ph/cm3/s) hence yielding the local spectrum (units ph/cm3/s/AA)
    • The default would be just do Doppler broadening to not perturb anyone else's workflows upon PR
  • For Natural broadening
    • I will be directly utilizing transition rates calculated by FAC and will likely use FAC's built-in file reading functions
    • Alternatively for a general user, they should be able to directly give transition rates per wavelength to avoid a FAC dependency
  • For Instrumental broadening
    • I will likely be inputting values into a Gaussian model that were informed via ray-tracing with ToFu
    • SPARC's XICS system is highly non-traditional as is evident in the spectral resolution maps so really ToFu ray-tracing is appropriate to properly model is effect
    • As such, a general user would interact with this the same extent I would here via inputting parameters from an average spectral resolution map
    • Maybe more sophistication would be implemented later, i.e. for C-Mod's XICS, as I am curious
  • For suprathermal ions
    • I am exploring calculating RF-acclerated ion energy distributions from a number of resources (ASCOT, TRANSP, TORIC+CQL3D via S. Frank's current work)
    • In all cases, a user would likely need to directly provide a data file of the distribution or input parameters into an RF-tail model

@fsciortino any opinions?

trouble installing 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

Use astropy.units and xarray

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.

Paths for downloading data from openadas seem to be out of date in some cases

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.

Identical wavelength for different transitions in the same file

Motivations:

  • In its current version, 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)
  • This breaks down if, unfortunately, several different transitions share the same wavelength.
  • A long-term fix would be to set a unique key to each transition, using something else than the wavelength.
  • This issue was encountered while following tutorial #46

Current behaviour:

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.

Example:

  • Interestingly, it happens for Ar16+, when ones looks for the k lines, it turns out a different transition with the same wavelength (3.9900 A) exists in the same file pec#ar15.dat:
    image

Questions to interpolation in computing the fractional density in ~aurora/atomic.py

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:

  1. In the following line:

if (abs(table-table[...,[0]]).all() < 0.05) or xprof is None:

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.

  1. For:

reg_interp = CartesianGrid((y, ),table[:,:,0]*np.log(10))

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?

  1. The interpolation with CartesianGrid requires an equally spaced grids in the table of adf11.
    """Fast linear interpolation for 1D and 2D vecctor data on equally spaced grids.
    Unfortunately the listed logne and logTe in acd96/scd96 for He are not uniformed (i.e https://open.adas.ac.uk/detail/adf11/acd96r/acd96r_he.dat). Is there any module can deal with that?

Looking forward to your reply!

Cheers,
Zhi

Inclusion of advanced recycling model and ELM-based transport model

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.

Obtain PECs directly from FAC

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.

Issue

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

Motivation

  • On C-Mod
    • @fsciortino you have already shared with me Ar FAC data files produced by A. Foster in the adf15 file format including all the physics I would want
    • As such, reproducing synthetic spectra for Ar would be a good benchmarking exercise for my edification
    • I would like to explore including information and hence PECs from metals that fall within the spectrum (Mo for C-Mod, W for WEST) to constrain ImpRad modeling. Data for these metals aren't satisfied within OpenADAS
  • On SPARC
    • @fsciortino you had calculated for me Kr, Xe adf15 PEC files using ADAS208. But, not all the physics I would want is included (satellites, magnetic transitions) so I need to rerun them. Not that I'm criticizing you here! I wasn't expert enough on He-, Ne-like sequences at the time to properly review. There was enough information for design work, but the team is beginning to transition to more advanced analysis
    • We are also imaging lines from W and other various metals that are not readily available (or data is present but doesn't include enough physics to get the intensity right) in OpenADAS
  • On WEST
    • I am beginning a collaboration with A. Da Ros & D. Vezinet where they are cross-validating electron temperatures inferred via XICS to ECE
    • Some shot are Lower Hybrid heated so a discrepancy could be due to suprathermal electrons modifying reaction rates
    • As such, non-Maxwellian collisional-radiative modeling is needed to calculate PECs

Plan of Action

  • Understand that when one calculates PECs utilizing FAC, there is two steps
    • The first (and computationally expensive) step is creating data files calculating atomic transition rates/cross-sections
      • This only really needs to be done once per species/charge state and entirely within a FAC workflow
      • This is also the most intense step (hard to automate) per all the physics options so should be handled entirely independent to Aurora
    • The second (and fast) step is then performing collisional-radiative modeling to calculate PECs at a specfic electron density and electron temperature
      • This step is also where you decide the electron energy distribution
      • This step is very short and simple to automate
  • As such, I propose that within 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
    • NOTE: This would unavoidably be using FAC within Aurora
    • This would probably amount to a function that completely runs the FAC collisional-radiative model (step 2) given that the user already took the time to run FAC step 1
    • Default would be OpenADAS/adf15 as normal to not perturb other's workflows
  • I would probably also integrate this into ImpRad later. Likely more important to transport inferences I want to do on WEST where there are a lot of polluting W lines imaged on the He-, H-like Ar systems
  • NOTE: I have had a discussion for C. Johnson to instead make an upgrade in ColRadPy to read FAC step 1 data files to then use the ColRadPy collisional-radiative modeling functions I know you've already implemented into Aurora. I feel like just sticking with FAC step 2 would be more direct. The FAC step 2 function would probably do about the same things as your ColRadPy function

@fsciortino any opinions?

Negative density in the last frame when I run aurora_sim

Hi Francesco,
Every time I run aurora_sim, I got results of negative density in the last frame.
Even the tutorial shows the same result with the same input. It appears only in the last frame, so I think it's just minor problem but I want to make sure. Could you check this out?

image002

Aurora Borealis

Photograph of the Aurora Borealis by Wikipedia User K. Pikner:

Virmalised_18 03 15_(4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.