Function adas.xxdata_13

def xxdata_13(file=None)

Reads an adf13 ionisations per photon coefficients (SXB) file and returns all of its contents in a dictionary.

Parameters

file : str
full name of ADAS adf13 file

Returns

fulldata : dict
contents of the adf13 file
    'filename' :  adf13 filename
    'nblock'   :  number of ionisation rates in file
    'esym'     :  element Symbol
    'iz0'      :  nuclear charge
    'iz'       :  number of ionisation rates
    'iz1'      :  initial charge
                    int array(nblock)
    'cwavel'   :  wavelength
                    string array(nblock)
    'wave'     :  wavelength in Angstroms
                    float array(nblock)
    'cindm'    :  driving metastable, T for unresolved
                    string array(nblock)
    'nte'      :  number of temperatures in each block
                     float array(nblock)
    'te'       :  temperatures (eV)
                     float array(max(nte), nblock)
    'ndens'    :  number of temperatures in each block
                     float array(nblock)
    'dens'     :  density (cm-3)
                     float array(max(ndens), nblock)
    'sxb'      :  ionizations per photon (number)
                     float array(max(nte), max(ndens), nblock)

Notes

As different dimensions per block are possible, the multi-dimension arrays use the max value for pixels, number of temperatures and number of densities.

Calls a fortran based shared object file - not pure python.

References

ADAS manual description of adf13: http://www.adas.ac.uk/man/appxa-13.pdf

Version History

  • Martin O'Mullane, 22-08-2018

    • First version
  • Martin O'Mullane, 07-05-2019

    • Fix documentation of fulldata entries.
  • Martin O'Mullane, 15-04-2021

    • Increase the number of allowed densities to 35.
    • Length of 'dens' in the dictionary was wrongly set by the length of te.

Example

Show the transition wavelengths for Li+ and output some of the SXB values for the 10th transition in the file.

>>> import adas as adas
>>> file = '/home/adas/adas/adf13/sxb96#li/sxb96#li_pju#li1.dat'
>>> fulldata = adas.xxdata_13(file)
>>> fulldata['wave']
array([ 199.3,  178.2,  178. ,  171.6,  171.6, 5486.1, 1198.1,  944.7,
       1420.9, 1093.4, 1653.1, 1493. , 1492.3, 1166.6, 1131.9, 1755.3,
       1682.5, 1681.7, 1253.3, 1237.3, 3685.7, 4157.6, 4882.8, 4326.7,
       4844.4, 4673.1, 4672.8, 4679.4, 4639. , 5039.3, 4789.7])
>>> fulldata['sxb'][0:fulldata['nte'][9]:5, 0:fulldata['ndens'][9]:5, 9]
array([[1.00e-74, 1.00e-74, 1.00e-74, 1.00e-74, 1.00e-74],
       [1.00e-74, 8.40e+00, 2.04e+01, 3.91e+01, 1.38e+02],
       [5.25e+02, 5.31e+02, 5.82e+02, 5.92e+02, 5.95e+03],
       [7.55e+02, 7.41e+02, 7.48e+02, 7.19e+02, 3.62e+03],
       [7.60e+02, 7.47e+02, 7.49e+02, 7.36e+02, 2.47e+03]])