Function adas.xxdata_21

def xxdata_21(file=None)

Reads an adf21 beam stopping coefficient (BMS) file and returns all of its contents in a dictionary.

Parameters

file : str
full name of ADAS adf21 file

Returns

fulldata : dict
contents of the adf21 file
    'file'    :  filename
    'itz'     :  target ion charge.
    'tsym'    :  target ion element symbol.
    'beref'   :  reference beam energy (eV/amu).
    'tdref'   :  reference target density (cm-3).
    'ttref'   :  reference target temperature (eV).
    'svref'   :  stopping coefficient at reference
                 beam energy, target density and
                 temperature (cm3 s-1).
    'be'      :  beam energies(eV/amu).
    'tdens'   :  target densities(cm-3).
    'ttemp'   :  target temperatures (eV).
    'svt'     :  stopping coefficient at reference beam
                 energy and target density (cm3 s-1)
    'sved'    :  stopping coefficient at reference target
                 temperature (cm3 s-1).
                   1st dimension : beam energy
                   2nd dimension : density

Notes

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

The adf22 beam emission (BME) and fractional population (BMP) files have the same format and this routine can be used to read these as well, although xxdata_22.py is also in the ADAS library.

References

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

Version History

  • Martin O'Mullane, 20-11-2012

    • First version
  • Martin O'Mullane, 17-04-2019

    • Do not cut off the last element of each array in fulldata.
  • Martin O'Mullane, 12-08-2020

    • Return tsym as a string rather than a bytes object.

Example

>>> import adas as adas
>>> file='/home/adas/adas/adf21/bms10#h/bms10#h_h1.dat'
>>> fulldata = adas.xxdata_21(file)
>>> fulldata['be']
array([  5000.,  10000.,  15000.,  20000.,  25000.,  30000.,  35000.,
        40000.,  45000.,  50000.,  55000.,  60000.,  65000.,  70000.,
        75000.,  80000.,  85000.,  90000.,  95000., 100000., 105000.,
       110000., 115000., 120000., 125000.])
>>> fulldata['tdens'][10]
30000000000000.0
>>> fulldata['sved'][:, 10]
array([1.266e-07, 1.293e-07, 1.284e-07, 1.261e-07, 1.231e-07, 1.198e-07,
       1.164e-07, 1.128e-07, 1.094e-07, 1.061e-07, 1.031e-07, 1.004e-07,
       9.802e-08, 9.592e-08, 9.411e-08, 9.256e-08, 9.117e-08, 8.996e-08,
       8.887e-08, 8.788e-08, 8.697e-08, 8.612e-08, 8.533e-08, 8.460e-08,
       8.392e-08])