Function adas.xxdata_04
def xxdata_04(file=None, ndlev=4500, ndtrn=150000, ndmet=4, ndqdn=8, nvmax=50, itieactn=True)
-
Reads an adf04 specific ion file and returns all of its contents in a dictionary.
Parameters
file
:str
- full name of ADAS adf04 file
ndlev
:int
, optional- maximum number of levels - defaults is 4500
ndtrn
:int
, optional- maximum number of transitions - default is 150000
ndmet
:int
, optional- maximum number of metastables - default is 4
ndqdn
:int
, optional- maximum principal quantum number of orbitals - default is 8
nvmax
:int
, optional- maximum number of temperatures/energies - default is 50
itieactn
:bool
- When set to False terminate if any levels are untied. The default is to to continue.
Returns
fulldata
:dict
- contents of the adf04 file
'file' : adf04 filename 'adf04_type' : variant of the adf04 file 1 = collision strengths vs E/delta_E 2 = unused 3 = effective collision strengths 4 = non-Maxwellian 5 = collision strengths vs E-delta_E (Ryd) 6 = specific for BBGP 'resolution' : coupling scheme 0 = unknown 1 = LS 2 = intermediate coupling 3 = configuration average 4 = n-resolved 'iz0' : nuclear charge 'iz' : recombined ion charge 'ia' : energy level index number (array) 'cstrga' : nomenclature/configuration for level (array) 'isa' : multiplicity for level (array) note: (isa-1)/2 = quantum number (s) 'ila' : quantum number (l) for level (array) 'xja' : quantum number (j-value) for level (array) note: (2*xja)+1 = statistical weight 'wa' : energy relative to level 1 (cm-1) for level (array) 'npla' : number of parent/zeta contributions to ionisation of level (array) 'ipla' : parent index of contributions to ionisation of level (array[parent index, level index]) 'zpla' : effective zeta parameter of contributions to ionisation of level (array[parent index, level index]) 'ltied' : indicates whether a level is tied (True ) or not (False). (array) 'bwno' : ionisation potential (cm-1) of lowest parent 'bwnoa' : ionisation potential (cm-1) of parents (array) 'cprta' : parent name in brackets (array) 'prtwta' : parent weight for parents in bwnoa array 'eorb' : orbital energies (Rydberg) of occupied orbitals in the configuration present (array) 'qdn' : quantum defect for n-shells (array) 'qdorb' : quantum defects for nl-orbitals (array) indexed by ADAS i4idfl routine. 'lqdorb' : indication whether source data available for quantum defect (True) (array) 'te' : electron temperatures (K) or energy parameter (array) 'lower' : lower energy level index for excitation (array) 'upper' : upper energy level index for excitation (array) 'aval' : transition probability (s-1) (array) 'gamma' : gamma (array [transition, te] - effective collision strength for type 3 adf04 - collision strength for type 1 and 5 'bt_type' : Burgess Tully classification of transition (1-4) 'beth' : Bethe coefficient 'level_rec' : capturing level index for recombination (array) 'parent_rec' : parent level index for recombination (array) 'rec' : recombination rate (cm3 s-1) (array[te, transition]) 'level_ion' : ionising level index for ionisation (array) 'parent_ion' : parent level index for ionisation (array) 'ion' : scaled ionisation rate (cm3 s-1) (array[te, transition]) 'level_cx' : capturing level index for charge exchange (array) 'parent_cx' : parent level index for cx (array) 'cx' : cx rate (cm3 s-1) (array[te, transition])
Notes
Calls a fortran based shared object file - not pure python.
For type 1 and type 5 files the 'te' and 'gamma' dictionary keys are retained even though the quantities are (scaled) energy and collision strength. Note that 'gamma' is incorrect for type 3 files since the appropriate Greek symbols should be capitalized omega for collision strength and capitalized upsilon for the effective collision strength. This faux pas may be corrected in a later version.
References
ADAS manual description of adf04: http://www.adas.ac.uk/man/appxa-04.pdf Definitions of collision and effective collision strenghts are in, http://www.adas.ac.uk/man/chap1-01.pdf
Version History
-
Martin O'Mullane, 01-07-2018
- First version
-
Martin O'Mullane, 06-07-2018
- Add standard configurations, Bethe coefficient, Burgess-Tully types and adf04 file type to the output dictionary.
-
Martin O'Mullane, 10-07-2018
- Return boolean values for ltied and lqdorb rather than rely on interpreting the int value returned from fortran.
-
Martin O'Mullane, 25-02-2020
- Add coupling scheme resolution to the output dictionary.
-
Martin O'Mullane, 16-07-2020
- Extra ouptut from xxdtes.
-
Martin O'Mullane, 05-07-2022
- Clarify the definitions of some of the fulldata dictionary entries.
-
Martin O'Mullane, 03-04-2024
- Add heavy-particle transitions (P-lines) to fulldata.
Example
Show first 3 configurations and the effective collision strength for the 24th transition in the adf04 file.
>>> import adas as adas >>> file='/home/adas/adas/adf04/belike/belike_cpb03#be0.dat' >>> fulldata = adas.xxdata_04(file) >>> fulldata['cstrga_std'][0:3] array(['1S2 2S2', '1S2 2S1 2P1', '1S2 2S1 2P1'], dtype='<U11') >>> fulldata['te'] array([ 1000., 2000., 5000., 10000., 20000., 50000., 100000., 200000.]) >>> print('Effective collison strength for transition ', ... fulldata['upper'][23], '-', fulldata['lower'][23], 'is ',fulldata['gamma'][23,:]) Effective collison strength for transition 8 - 2 is [ 0.276 0.906 2.56 5.04 9.72 21.4 35.9 55.3 ]