Function adas.read_adf04

def read_adf04(file=None, lower=None, upper=None, te=None, unit_te='ev', rate=True, dex_rate=False, plines=False, slines=False, rlines=False, hlines=False)

Interpolate/extrapolate coefficients from adf04 specific ion files.

Parameters

file : str
full name of ADAS adf04 file
lower : int, or list
lower index of transition(s)
upper : int, or list
upper index of transition(s)
te : float, array
requested electron temperatures (default is eV). If not supplied use the temperatures in the adf04 file.
rate : bool
If True return the excitation rate, otherwise return the effective collision strength. Default is True.
dex_rate : bool
If True return the de-excitation rate. rate must be set to True. Default is True.
plines : bool
If True return the rate for ion-impact.
slines : bool
If True return the ionization rate for a requested S-line.
rlines : bool
If True return the recombination rate for a requested R-line.
hlines : bool
If True return the charge exchange rate for a requested H-line.
unit_te : str, optional
defaults to 'ev' but 'kelvin' interprets the requested temperatures are given in Kelvin units.

Returns

coeff : float, array
if rate == True, excitation rate coefficient (cm3 s-1) == False, effective collision strength if dex_rate == True, de-excitation rate

Notes

This version will only work with type 3 adf04 files.

A single transition, or a list of transitions, may be selected. If slines, rlines or hlines is set, the upper array/list is the level and lower is the parent metastable.

For P-lines the mass coefficient used to calculate the ion-impact effective collision strength is not stored in the adf04 file. Data from adf06 files will include this factor and adas208 also expects it to be applied. However the rate from this routine may need to be scaled by (reduced mass**1.5) if this is not the case.

Pure python but calls xxdata_04 which depends on a compiled library.

References

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

Version History

  • Martin O'Mullane, 24-01-2024

    • First version
  • Martin O'Mullane, 10-03-2024

    • Adjust to the change in transition_index() where a single transition returns an integer rather tan a 1-element list.
  • Martin O'Mullane, 03-04-2024

    • Add heavy-particle transitions (P-lines) option.

Examples

Tabulate the excitation rate coefficient for the Be0 332.1nm line, 2s 2p 3P2 - 2s 3s 3S1, transition 2-4 in the adf04 file.

>>> import adas as adas
>>> import numpy as np
>>> file='/home/adas/adas/adf04/adas#4/cpb03_ls#be0.dat'
>>> te=np.geomspace(1, 200.0, 5)
>>> adas.read_adf04(file=file, lower=2, upper=4, te=te)
array([3.96105831e-10, 4.63349725e-09, 1.18045078e-08, 1.73898550e-08,
       1.66755382e-08])