Function adas.read_adf12
def read_adf12(file=None, block=1, ein=[0.0], tion=[0.0], dion=[0.0], zeff=[0.0], bmag=[0.0])
-
Interpolate/extrapolate CX effective emissivity coefficients (QEF) from adf12 files.
Parameters
file
:str
- full name of ADAS adf12 file
block
:int
- selected block
ein
:float, array
- requested beam energies (eV/amu)
tion
:float, array
- requested ion temperatures (eV)
dion
:float, array
- requested ion densities (cm**-3)
zeff
:float, array
- requested effective charge of plasma (dimensionless)
bmag
:float, array
- local magnetic field (T)
Returns
coeff
:float, array
- QEF coefficient (ph cm3 s-1)
Notes
Either all of ein/tion/dion/zeff/bmag have the same length or just one is allowed to be a 1D vector. In this case the others are kept constant.
The local magnetic field is not used and has one value in the adf12 files.
Calls a fortran based shared object file - not pure python.
Repeated calls using the same adf12 file will not re-open the file within the fortran module. If the content changes between calls, this may be unexpected behaviour.
References
ADAS manual description of adf12: http://www.adas.ac.uk/man/appxa-12.pdf
Version History
-
Martin O'Mullane, 20-08-2012
- First version
-
Martin O'Mullane, 09-01-2023
- Add docstring warning about repeated calls with the same file name.
Examples
C6+ 8-7 transition over beam energies of 1-100keV/amu in a fixed plasma of 2keV/6e13cm-3/Zeff=1.2. B is set as 3.0 but there is no variation with magnetic field in the model.
>>> import adas as adas >>> file='/home/adas/adas/adf12/qef93#h/qef93#h_c6.dat' >>> ein=np.geomspace(1e3, 100.0e3, 4) >>> tion=2.0e3 >>> dion=6.0e13 >>> zeff=1.2 >>> bmag=3.0 >>> adas.read_adf12(file=file, block=5, ein=ein, tion=tion, ... dion=dion, zeff=zeff, bmag=bmag) array([1.08254333e-11, 5.53714396e-11, 1.69076202e-09, 6.60442398e-09])