Function adas.run_adas308
def run_adas308(adf01=None, mass=0.0, te=0.0, tion=0.0, dens=0.0, dion=0.0, zeff=1.0, bmag=3.0, energy=[0.0], frac=[0.0], n1in=1, n2in=2, emiss=1000000000000.0, n1req=8, n2req=7, elec=False, logfile=None)
-
Runs the adas308 CX coefficient generation code.
Parameters
adf01
:str
- full name of ADAS adf01 charge exchange cross section file
mass
:float
, optional- atomic mass of the receiver - default taken from xxeiam.
te
:float
- requested electron temperatures
tion
:float
- requested ion temperatures
dens
:float, array
- requested electron densities
dion
:float, array
- requested ion densities
zeff
:float
- for re-scaling ion densities, defaults to 1.0
bmag
:float
- magnetic field (note that it is not used in model)
energy
:float, array
- beam energy components(eV/amu)
frac
:float, array
- fraction in each beam component (normalized to 1.0)
n1in
:int
, optional- lower level of observed line
n2in
:int
, optional- upper level of observed line
emiss
:float
, optional- emission measure of observed line
n1req
:int
, optional- upper level of transition of requested emission coefficient
n2req
:int
, optional- lower level of transition of requested emission coefficient
elec
:boolean
- if True use electron impact rather than CX to evaluate coefficient, default is False
logfile
:str
- name of log file, defaults to no output file
Returns
res
:dict
- results of the population model
'qeff' : effective rate coefficient 'ncomp' : number in nl-n'l' complex 'wave' : nl-n'l' air wavelengths 'emiss' : nl-n'l' column emissivities 'pop' : nl-n'l' column populations 'nu' : nl-n'l' complex : n 'lu' : nl-n'l' complex : n' 'nl' : nl-n'l' complex : l 'll' : nl-n'l' complex : l' 'aval' : nl-n'l' A-values
Notes
The mass of the receiver need not be supplied since the value is given by a call to xxeiam. Use for unusual isotopes.
adas308 has a mode whereby athe emission measure of a set of observed lines (n1in, n2in and emiss) can be used to adjust the adf01 cross sections. This mode is not used here but the inputs remain for future re-activation of this feature.
Calls a fortran executable code and communicates via a bi-directional pipe connected to stdout.
References
ADAS manual description of adas308: http://www.adas.ac.uk/man/chap3-08.pdf
Version History
-
Martin O'Mullane, 29-03-2019
- First version
-
Martin O'Mullane, 09-04-2019
- Alter the termination sequence when a log file is not requested.
Examples
Calculate the components of the C5+ n=8-7 feature for a 50keV/amu beam.
>>> import adas as adas >>> adf01='/home/adas/adas/adf01/qcx#h0/qcx#h0_old#c6.dat' >>> data = adas.run_adas308(adf01=adf01, te=1000.0, tion=1000.0, ... dens=1e13, dion=1e13, ... energy=50.0e3, frac=1.0, ... n1req=8, n2req=7) >>> data['ncomp'], data['qeff'] (13, 1.63532380228989e-08) >>> data['lu'], data['ll'], data['wave'] (array([0., 1., 1., 2., 2., 3., 3., 4., 4., 5., 5., 6., 7.]), array([1., 2., 0., 3., 1., 4., 2., 5., 3., 6., 4., 5., 6.]), array([5291.05598219, 5291.4308686 , 5287.88241377, 5291.0329222 , 5288.67867266, 5290.95211342, 5289.85323642, 5290.93894058, 5290.2966875 , 5290.94453246, 5290.52183465, 5290.6557592 , 5290.74372757]))