Function adas.xxdata_40
def xxdata_40(file=None)
-
Reads an adf40 feature photon emissivity coefficient (fPEC) file and returns all of its contents in a dictionary.
Parameters
file
:str
- full name of ADAS adf40 file
Returns
fulldata
:dict
- contents of the adf40 file
'esym' : element (string) 'iz0' : atomic number 'iz' : ion charge 'iz1' : recombined ion charge 'nblock' : number of blocks, or fpecs 'npix' : number of pixels for each block (array) 'wave_min' : minimum wavelength (A) for each block (array) 'wave_max' : maximum wavelength (A) for each block (array) 'nte' : number of temperatures for each block (array) 'te' : electron temperatures (eV) array(max no. te, no. blocks) 'ndens' : number of densities for each block (array) 'dens' : electron density (cm**-3) array(max no. dens, no. blocks) 'fpec' : feature photon emissivities (ph cm**3 s**-1) array(pixel, te, dens, blocks) 'type' : excitation type 'comments' : array holding the comments 'filename' : name of adf40 file
Notes
Calls a fortran based shared object file - not pure python.
References
ADAS manual description of adf40: http://www.adas.ac.uk/man/appxa-40.pdf
Version History
-
Martin O'Mullane, 30-07-2018
- First version
-
Martin O'Mullane, 01-08-2018
- Allow up to 132 characters for filename.
- Correct the comment array.
-
Martin O'Mullane, 10-08-2018
- nte and ndens in fulldata were short by 1.
Example
An EEDF of the JET SOL from a kinetic code.
>>> import adas as adas >>> file='/home/adas/adas/adf40/JET_SOL_example.dat' >>> fulldata = adas.xxdata_40(file) >>> fulldata['wave_min'], fulldata['wave_max'], fulldata['npix'] (array([ 1., 10., 1.]), array([ 10., 100., 10000.]), array([128, 128, 512], dtype=int32)) >>> block=1 >>> fulldata['te'][8, block], fulldata['dens'][3, block] (3650.0, 10000000000000.0) >>> fulldata['fpec'][0:fulldata['npix'][1]:10, 8, 3, block] array([4.34e-15, 4.08e-12, 6.92e-13, 1.02e-12, 1.81e-15, 3.11e-13, 7.21e-16, 7.36e-14, 5.04e-13, 2.54e-12, 1.66e-14, 8.25e-15, 2.56e-17])