Function adas.write_adf25
def write_adf25(file=None, fulldata=None, comments=None)
-
Write an adf25 bundle-n population driver file from a user supplied fulldata dictionary.
Parameters
file
:str
- full name of adf25 file.
fulldata
:dict
- contents of the adf25 file
'file' : adf25 filename 'iz0' : nuclear charge of bundle-n ion 'iz1' : recombining ion charge of bundle-n ion 'a25fmt' : subdirectory type of adf25 to be read. 'outfmt' : format of output ADAS data format for final results 'cxfile' : file name for charge exchange data input 'exfile' : file name for map of proj. matrix output 'ndens' : number of electron densities 'id_ref' : reference electron density 'densa' : plasma electron density vector (cm-3) 1st dim: index of electron density 'denpa' : plasma H+ density vector (cm-3) 1st dim: index of electron density 'denimpa' : plasma mean impurity ion density (cm-3) 1st dim: index of electron density 'ntemp' : number of electron temperatures 'id_ref' : reference electron temperature 'tea' plasma electron temperature array (K) 1st dim: index of electron temperature 'denpa' : plasma H+ temperature array (K) 1st dim: index of electron temperature 'denimpa' : plasma mean impurity ion temperature (K) 1st dim: index of electron temperature 'nzef' : number of plasma zeff 'iz_ref' : reference zeff 'zefa' : plasma zeff array 1st dim: index of zeff 'nbeam' : number of beam energies 'ib_ref' : reference beam energy 'bmena' : beam energy array (ev/amu) 1st dim: index of beam energies 'denha' : beam H+ density array (cm-3) 1st dim: index of beam energies 'bmfra' : fractions of beam at each energy 1st dim: index of beam energies 'nimp' : number of plasma impurities (excl.H+) 'im_ref' : reference impurity 'zimpa' : impurity species charge 1st dim: index of impurity 'amimpa' : atomic mass number of impurity species 1st dim: index of impurity 'frimpa' : fraction of impurity (normalised to 1) 1st dim: index of impurity 'ts' : external radiation field temperature (K) 'w' : general radiation dilution factor 'w1' : external radiation field dilution factor for photo-ionisation form the ground level. 'cion' : adjustment multiplier for ground ionis. 'cpy' : adjustment multiplier for VR cross sections 'nip' : range of delta n for IP cross sections (<=4) 'intd' : order of Maxwell quadrupole for IP cross sections (l<=3) 'iprs' : 0 => default to VR cross sections beyond nip range 1 => use PR cross sections beyond nip range 'ilow' : 0 => no special low level data accessed 1 => special low level data accessed 'ionip' : 0 => no ion impact collisions included 1 => ion impact excit. and ionis. included 'nionip' : range of delta n for ion impact excitation cross sections 'ilprs' : 0 => default to Vainshtein cross sections 1 => use lodge-percival-richards cross sections 'ivdisp' : 0 => ion impact at thermal Maxw. energies 1 => ion impact at displaced thermal energies according to the neutral beam energy parameter * if (ivdisp==0 then special low level data for ion impact is not substituted - only Vainshtein and Lodge et al. options are open. Electron impact data substitution does occur. 'nmin' : lowest n-shell for population structure 'nmax' : highest n-shell for population structure 'imax' : number of representative n-shells 'nrep' : representative n-shells 1st dim: index of representative n-shell 'wbrep' : dilution factors for nmin->nrep() trans. 1st dim: index of representative n-shell 'jdef' : number of n-shell quantum defects 'def' : quantum defects for n-shells 1st dim: index of n-shell quantum defects upwards from nmin 'jcor' : number of DR Bethe correction factors 'cor' : DR Bethe correction factors 1st dim: index of correction factor 'jmax' : number of DR core transitions 'epsil' : reduced energy of core transition note that delta Eij/I_H=(z+1)**2*epsil() 1st dim: index of DR core transition 'fij' : absorption oscillator strength for DR core transition 1st dim: index of DR core transition 'wij' : dilution factor for DR core transition 1st dim: index of DR core transition
comments
:list
, optional- comments for the end of the file as a list of strings.
Notes
The type of adf25 file (adas204 or adas316) to write is determined from the 'a25fmt' key in the fulldata dictionary.
References
ADAS manual description of adf25: http://www.adas.ac.uk/man/appxa-25.pdf
Version History
-
Martin O'Mullane, 07-06-2021
- First version
-
Martin O'Mullane, 28-11-2021
- Adjust format statements due to change in array2strlist.
- Fix example.
Example
Round trip of He-like carbon file.
>>> import adas as adas >>> file='/home/adas/adas/adf25/p316_a25/bn_cxs_c5_example.dat' >>> fulldata=adas.xxdata_25(file) >>> my_comments=['C Testing write_adf25', 'C By me, today'] >>> my_file='/tmp/test_write_adf25.dat' >>> adas.write_adf25(file=my_file, fulldata=fulldata, ... comments=my_comments)