Function adas.run_adas312

def run_adas312(adf26=None, nlow=None, nup=None, outfile=None)

Runs the adas312 adf21/adf22 extraction code.

Parameters

adf26 : str
full name of ADAS adf26 population tabulation file
nlow : int, optional
lower n-level for beam emission transition
nup : int, optional
upper n-level for beam emission transition or n value for the excited n-level population if mlow is not specified
izimp : int, array
impurity atomic number
outfile : str
full name of output adf21 or adf22 file

Returns

code : int
success code

Notes

If nlow and nup are specified a beam emission file is produced (adf22/bme). If nup only is specified a beam density file is produced (adf22/bmp). If neither is specified a beam stopping file is produced (adf21/bms).

Calls a fortran executable code and communicates via a bi-directional pipe connected to stdout.

References

ADAS manual description of adas312: http://www.adas.ac.uk/man/chap3-12.pdf

Version History

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

Examples

Make a file with the n=5 population of the beam and print the first line.

>>> import adas as adas
>>> adf26='/home/adas/adas/adf26/bdn10#h/bdn10#h_h1.dat'
>>> adas.run_adas312(adf26=adf26, nup=5, outfile='bmp#h_5_h1.dat')
>>> with open('bmp#h_5_h1.dat') as f: first_line = f.readline()
>>> first_line.strip()
'    1 /ECREF=4.184E-04 /SPEC=H  /DATE=02/07/20 /CODE=ADAS312'