Function adas.run_adas416
def run_adas416(file=None, logfile=None)
-
Runs the adas416 adf11-bundling code.
Parameters
file
:str
- instruction file
logfile
:str
- name of log file, defaults to no output file
Returns
frac_p
:dict
- parent fractional abundances
'te' : temperature array from adf11 file (eV) 'dens' : density arry from adf11 file (cm-3) 'stage' : array of ion/metastable/bundle descriptors 'ion' : fractional abundances of stages, dimensioned as (te, dens, stages/bundle)
frac_c
:dict
- bundled fractional abundances
'te' : temperature array from adf11 file (eV) 'dens' : density arry from adf11 file (cm-3) 'stage' : array of ion/metastable/bundle descriptors 'ion' : fractional abundances of stages, dimensioned as (te, dens, stages/bundle)
Notes
The adf11 files to be bundled and the scheme of bundling is specified in the instruction file. The names of the bundled adf11 files are also specified in the instruction file. This function also returns the equilibrium balance fractional abundances, over the temeperature and density range of the input adf11 files, as dictionaries to aid inspection of the bundling.
Calls a fortran executable code and communicates via a bi-directional pipe connected to stdout.
References
ADAS manual description of adas416 script file.
Version History
- Martin O'Mullane, 03-04-2019
- First version
Examples
Bundle neon adf11 data into 5 superstages. Note that this example places 8 bundled adf11 files in the calling directory.
>>> import adas as adas >>> frac_p, frac_c=adas.run_adas416(file='/home/adas/adas/scripts416/partition_02_ne96.dat') >>> frac_c['te'][10], frac_c['dens'][12] (10.004606230728402, 499999995007.97296) >>> frac_p['ion'][10,12,:] array([6.83212628e-008, 5.36470548e-004, 1.59325718e-001, 7.95711958e-001, 4.44054100e-002, 2.03749187e-005, 5.40973367e-011, 3.07104291e-018, 5.36396437e-027, 5.81722531e-075, 1.57934091e-132]) >>> frac_c['ion'][10,12,:] array([6.83212628e-08, 9.55574147e-01, 4.44257850e-02, 5.36396437e-27, 2.72386692e-90])