Function adas.read_adf40

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

Interpolate/extrapolate feature photon emissivity coefficients from adf40 files.

Parameters

file : str
full name of ADAS adf40 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

Returns

coeff : float, array
fPEC coefficient (ph cm3 s-1) as a 1D or 2D array depending on all.
wave : float, array
1D vector of wavelengths in Angstrom - not interpolable.

Notes

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

References

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

Version History

  • Martin O'Mullane, 31-07-2018
    • First version

Examples

The feature PEC for Ar10+ over 10-100A.

>>> import adas as adas
>>> import numpy as np
>>> file='/home/adas/adas/adf40/fpec40#ar/fpec40#ar_ls#ar10.dat'
>>> te=np.geomspace(5, 300.0, 4)
>>> dens=np.zeros(4)+1e13
>>> coeff,wave=adas.read_adf40(file=file, block=2, te=te, dens=dens)
>>> wave[0::20]
array([10.        , 24.17322835, 38.34645669, 52.51968504, 66.69291339,
       80.86614173, 95.03937008])
>>> coeff[0::20,:]
array([[1.00000000e-70, 1.00000000e-70, 1.00000000e-70, 1.00000000e-70],
       [9.63834770e-72, 4.42407097e-21, 2.34083208e-13, 1.13040220e-11],
       [1.59334633e-39, 1.21634342e-17, 2.97553276e-12, 5.52517141e-11],
       [4.39764989e-46, 1.79559813e-24, 6.93828997e-19, 1.76203314e-17],
       [1.19157328e-71, 2.74342728e-24, 2.26484458e-16, 1.22449082e-14],
       [2.44382926e-31, 4.70918389e-22, 3.17399384e-15, 1.72290974e-13],
       [1.05158053e-71, 2.82483712e-23, 5.74180102e-16, 2.20220265e-14]])