Function adas.write_adf42
def write_adf42(file=None, fulldata=None, comments=None)
-
Write an adf42 driver file for adas810/adas8#10.
Parameters
file
:str
- full name of adf12 file.
fulldata
:dict
- contents of the adf12 file
'dsn04' : str adf04 file for population analysis 'dsn18' : str adf18/a17_p208 expansion file 'dsn35' : str adf35 filter file for power data 'dsn15' : str adf15 file for traditional pec data 'dsn40' : str adf40 file for feature pec data 'dsn11' : str adf11 file for line power 'dsn11f' : str adf11 file for filtered line power 'dsn11e' : str adf11 file for energy-resolved line power 'element' : str element symbol 'z0' : int nuclear charge 'z1' : int recombining ion charge 'ip' : float ionisation potential (cm-1) of lowest parent 'lnorm' : str '.TRUE.' => identify and resolve metastables '.FALSE.' => do not resolve metastables 'nmet' : int number of metastables 'imetr' : int, array index of metastable in complete level list (ground=1) 'liosel' : str '.TRUE.' => include ionisation rates '.FALSE.' => do not include ionisation rates 'lhsel' : str '.TRUE.' => include charge transfer from neutral hydrogren. '.FALSE.' => do not include charge transfer from neutral hydrogren. 'lrsel' : str '.TRUE.' => include free electron recombination. '.FALSE.' => do not include free electron recombination. 'lisel' : str '.TRUE.' => include electron impact ionisation. '.FALSE.' => do not include free electron recombination. 'lnsel' : str '.TRUE.' => include projected bundle-n data from datafile '.FALSE.' => do not include projected bundle-n data 'lpsel' : str '.TRUE.' => include proton collisions '.FALSE.' => do not include proton collisions 'zeff' : float Effective Z when proton collisions are included 'lmetr' : str '.TRUE.' => identify and resolve metastables '.FALSE.' => do not resolve metastables 'lbelowip': str '.TRUE.' => exclude from PLT transition with energy levels above ionization potential '.FALSE.' => include all transitions in adf04 file 'ltscl' : str '.TRUE.' => input temperatures are z-scaled '.FALSE.' => input temperatures not z-scaled 'ldscl' : str '.TRUE.' => input densities are z-scaled '.FALSE.' => input densities not z-scaled 'lbrdi' : str '.TRUE.' => impose ion temperature broadening '.FALSE.' => input densities not z-scaled 'amin' : float Minimum A-value for adf15 and adf40 files 'numte' : int number of electron temperatures 'numtion' : int number of ion/proton temperatures 'numth' : int number of neutral hydrogen temperatures 'numdens' : int number of electron densities 'numdion' : int number of ion densities 'numwvl' : int number of wavelength intervals for adf40 'te' : float, array electron temperature (K) 'tion' : float, array ion temperature (K) 'th' : float, array neutral hydrogen temperature (K) 'dens' : float, array electron density (cm**-3) 'dion' : float, array ion density (cm**-3) 'npix' : int, array number of pixels in wavelength interval 'wvmin' : float, array lower limit of wavelength interval (Angstrom) 'wvmax' : float, array upper limit of wavelength interval (Angstrom)
comments
:list
- comments for the end of the file as a list of strings.
Notes
Pure python implementation.
References
ADAS manual description of adf12: http://www.adas.ac.uk/man/appxa-42.pdf
Version History
-
Martin O'Mullane, 10-05-2021
- First version
-
Martin O'Mullane, 28-11-2021
- Adjust format statements due to change in array2strlist.
-
Martin O'Mullane, 30-01-2024
- Fix example so that cut&paste works.
- Add dsn11e for energy resolved adf11 output to &files namelist.
- Add lbelowip field to &outputs namelist.
Example
Make an adf42 driver file to generate C2+ PECs between 100-3000A.
>>> import adas as adas >>> import numpy as np >>> full42 = { 'dsn04' : '/home/adas/adas/adf04/adas#6/mom97_ls#c2.dat', >>> 'dsn15' : 'c2_pec.dat', >>> 'element' : 'C', >>> 'z0' : 6, >>> 'z1' : 2, >>> 'ip' : 386241.0, >>> 'te' : np.geomspace(1, 200, 8), >>> 'tion' : np.geomspace(1, 200, 8), >>> 'dens' : np.geomspace(1e8, 1e15, 4) } >>> adas.write_adf42(file='c2_adf42.dat', fulldata=full42)