Function adas.read_adf11
def read_adf11(file=None, adf11type='xxx', is1=0, index_1=-1, index_2=-1, te=[0.0], dens=[0.0], all=False, skipzero=False, unit_te='ev')
-
Interpolate/extrapolate source or power coefficients from adf11 files.
Parameters
file
:str
- full name of ADAS adf11 file
adf11type
:str
, optional- type of adf11 file ('acd'/'scd' etc. see notes for full list)
te
:float, array
- requested electron temperatures (eV)
dens
:float, array
- requested electron densities (cm**-3)
is1
:int
- recombining ion stage
index_1
:int
- partition identifier for metastable resolved adf11 files (see notes)
index_2
:int
- partition identifier for metastable resolved adf11 files (see notes)
all
:bool
- if True return a 2D array, default is False with returned coefficient give for each te/dens pair
unit_te
:str
, optional- defaults to 'ev' but 'k' interprets the requested temperature are given in Kelvin units
skipzero
:bool
- if True exclude zero/effective zero values when splining, default is False
Returns
coeff
:float, array
- rate coefficient (cm3 s-1) or power coefficient (W cm**3) as a 1D or 2D array depending on all.
Notes
Calls a fortran based shared object file - not pure python.
The partition information differs according to the adf11 type and has also evolved over time. User index_1 and index_2 to choose with thei routine but the names in the adf11 are as detailed in the following table.
adf11 old names new names type (index_1 index_2) (index_1 index_2 ---- ---- ---- ---- ---- acd iprt igrd ispp ispb scd iprt igrd ispp ispb ccd iprt igrd ispp ispb prb iprt ispp prc iprt ispp qcd igrd jgrd ispb jspb xcd iprt jprt ispp jspp plt igrd ispb pls igrd ispb zcd igrd ispb ycd igrd ispb ecd igrd ispb
In partitioned nomenclature: s=superstage; p=partition; b=base (current superstage), p=parent (next up super-stage), c=child (next down superstage). Thus arrays 'iprtr' and 'igrd' in old notation are now substituted by 'isppr' and 'ispbr' respectively.
Note that index_1 (and index_2) only need to be specified when the adf11 dataset is resolved by metastable, also referred to as partial adf11 data.
References
ADAS manual description of adf11: http://www.adas.ac.uk/man/appxa-11.pdf
Version History
-
Martin O'Mullane, 31-10-2013
- First version
-
Martin O'Mullane, 06-10-2017
- Add skipzero option
-
Martin O'Mullane, 19-04-2021
- Pass file name as an array of (132) bytes
Examples
Extract the rate coefficient for Ne4+ -> Ne3+ unresolved recombination.
>>> import adas as adas >>> import numpy as np >>> file='/home/adas/adas/adf11/acd96/acd96_ne.dat' >>> te=np.geomspace(1, 100.0, 4) >>> dens=[1e10, 1e14] >>> adas.read_adf11(file=file, adf11type='acd', is1=4, te=te, dens=dens, all=True) array([[2.44762641e-11, 7.21333513e-11], [8.62383321e-12, 9.04896722e-12], [1.13316134e-11, 4.60749556e-12], [4.70086132e-12, 1.99696234e-12]])
and the ionization rate coefficient for Ne3+(mer=2) -> Ne4+(ground)
>>> file='/home/adas/adas/adf11/scd96r/scd96r_ne.dat' >>> dens=np.zeros(4)+1e13 >>> adas.read_adf11(file=file, adf11type='scd', is1=4, index_1=2, index_2=1, te=te, dens=dens) array([1.56187468e-58, 1.30469528e-25, 2.68347360e-18, 5.60105714e-17])