Function adas.read_adf13
def read_adf13(file=None, block=1, te=[0.0], dens=[0.0], all=False, unit_te='ev', return_info=False)
-
Interpolate/extrapolate ionisations per photon coefficients from adf13 files.
Parameters
file
:str
- full name of ADAS adf13 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
- sxb coefficient (dimensionless) as a 1D or 2D array depending on all.
info
:dict
- information from header line of the selected block in adf13 file
'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 adf13: http://www.adas.ac.uk/man/appxa-13.pdf
Version History
-
Martin O'Mullane, 21-08-2018
- First version
-
Martin O'Mullane, 19-08-2022
- Make returning the info dictionary optional.
Examples
Extract the SXB for C+ 658nm transition.
>>> import adas as adas >>> import numpy as np >>> file='/home/adas/adas/adf13/sxb96#c/sxb96#c_vsu#c1.dat' >>> te=np.geomspace(1, 20.0, 4) >>> dens=np.zeros(4)+1e13 >>> coeff, info=adas.read_adf13(file=file, block=1, te=te, dens=dens, return_info=True) >>> coeff array([8.56375077e-04, 1.14255247e-01, 1.43374304e+00, 5.67956810e+00]) >>> info {'wavelength': 6581.5, 'iz0': 6, 'iss': 1}