Function adas.run_adas404
def run_adas404(root=None, year=None, prefix=None, adf11types=['acd', 'scd'], iz0=None, zlow=None, zhigh=None, resolved=False, te=None, dens=None, logfile=None, files=None)
-
Runs the ADAS404 adf10->adf11 file generator code.
Parameters
root
:str
- directory of adf10 files
year
:int
- year of adf10 data
prefix
:str
- prefix of adf10 set (usually 'pj' but must be set)
adf11types
:str, list
- the required adf11 classes to be produced
'acd' : recombination 'scd' : ionisation 'qcd' : metastable cross coupling 'xcd' : parent cross coupling 'ccd' : charge exchange recomb. 'prb' : recomb. + bremss. power 'plt' : total line power 'prc' : charge exchange power
iz0
:int
- atomic number
zlow
:int
- lowest Z required in adf11 file (0=neutral)
zhigh
:int
- highest Z required in adf11 file
resolved
:bool
- if True generate a metastable-resolved adf11 file the default is False
te
:float, array
- requested electron temperatures (eV)
dens
:float, array
- requested electron densities (cm-3)
logfile
:str
- name of log file, defaults to no output file
files
:str array
- the set of adf10 file name templates may be supplied as a numpy string array of dimension (zhigh - zlow + 2, 10)
Returns
nothing - the output is file written to disk
Notes
Calls a fortran executable code and communicates via a bi-directional pipe connected to stdout.
A set of adf10 template filenames can be generated from a call to adas404_get_adf10. The fortran code expects names such as pj#acd96_be##.dat where the ## will be peplace by the appropriate ground and parent indices.
References
ADAS manual description of adas404: http://www.adas.ac.uk/man/chap4-04.pdf
Version History
- Martin O'Mullane, 21-04-2021
- First version
Examples
Produce 96 style GCR files for carbon over a different Te/dens range
>>> import adas as adas >>> import numpy as np >>> te = np.geomspace(1.0, 1e4, 10) >>> dens = np.geomspace(1.0e10, 1.0e22, 6) >>> adas.run_adas404(root='/home/adas/adas/adf10/', year=96, prefix='pj', adf11types=['acd', 'prb'], iz0=6, zlow=0, zhigh=5, te=te, dens=dens)
acd404.pass and prb404.pass will be written to the directory the routine was called from.