Function adas.read_adf15

def read_adf15(file=None, block=1, te=[0.0], dens=[0.0], all=False, unit_te='ev', return_info=False)

Interpolate/extrapolate photon emissivity coefficients from adf15 files.

Parameters

file : str
full name of ADAS adf15 file
block : int
selected block
te : float, array
requested electron temperatures (eV)
dens : float, array
requested electron densities (cm**-3)
all : bool
if True return a 2D array, default is False with returned coefficient give for each te/dens pair
unit_te : str, optional
defaults to 'ev' but 'k' interprets the requested temperature are given in Kelvin units
return_info : bool
If True also return a dictionary of information on the transition. The default is False.

Returns

coeff : float, array
PEC coefficient (ph cm3 s-1) as a 1D or 2D array depending on all.
info : dict
information from header line of the selected block in adf15 file only return if return_info=True
'wavelength' : wavelength of transition in Angstrom
'iz0'        : nuclear charge
'iss'        : ion charge

Notes

Calls a fortran based shared object file - not pure python.

References

ADAS manual description of adf15: http://www.adas.ac.uk/man/appxa-15.pdf

Version History

  • Martin O'Mullane, 20-08-2018

    • First version
  • Martin O'Mullane, 19-08-2022

    • Make returning the info dictionary optional.

Examples

Extract the excitation, recombination and CX PECs for C2+ 977 transition.

>>> import adas as adas
>>> import numpy as np
>>> file='/home/adas/adas/adf15/pec96#c/pec96#c_pju#c2.dat'
>>> te=np.geomspace(5, 100.0, 4)
>>> dens=np.zeros(4)+1e13
>>> coeff_exc,info=adas.read_adf15(file=file, block=23, te=te, dens=dens, return_info=True)
>>> coeff_rec=adas.read_adf15(file=file, block=81, te=te, dens=dens)
>>> coeff_cx=adas.read_adf15(file=file, block=139, te=te, dens=dens)
>>> info
{'wavelength': 977.0, 'iz0': 6, 'iss': 2}
>>> coeff_exc
array([7.58884520e-09, 2.10864159e-08, 3.28172808e-08, 4.44850840e-08])
>>> coeff_rec
array([2.84801002e-12, 1.51222998e-12, 5.20765157e-13, 1.60558382e-13])
>>> coeff_cx
array([2.49581147e-09, 3.98780604e-09, 4.82365329e-09, 5.38140157e-09])