Function adas.adf04_wave

def adf04_wave(file=None, wave_min=0.01, wave_max=10000.0, a_min=100.0, energy=False, sort=True, air=True, onscreen=True, outfile=None, ndlev=4500, ndtrn=150000)

Interrogates an adf04 file and returns tables of permitted wavelengths with configuration, energy and quantum numbers, which can be sent to a file, screen (default) or returned as a dictionary.

Parameters

file : str
full name of ADAS adf04 file
wave_min : float
minimum wavelength to select transition for display default is 0.01A
wave_max : float
maximum wavelength to select transition for display default is 10000.0A
a_max : float
minimum transition probability to select transition for display default is 100.0 s-1
energy : bool
if set to True, display (and sort) based on the energy rather than the wavelenght of the tranition. default is False
sort : bool
if set to True sort the transitions in ascending wavelength (or energy) order. default is True
air : bool
if set to True correct the wavelength for the refraction of air. default is True
onscreen : bool
if set to True display the results on screen default is True
outfile : str
full name of file to keep the tabular information.
ndlev : int, optional
maximum number of levels in adf04 file - defaults is 4500
ndtrn : int, optional
maximum number of transitions in adf04 file - default is 150000

Returns

info : dict
information extracted
 'number'      :  number of transitions
 'wave'        :  wavelength (A)
 'delta_e'     :  transition energy (eV)
 'aval'        :  transition probability (s-1)
 'fval'        :  oscillator strength
 'gval'        :  Gaunt factor
 'cfg_lower'   :  lower configuration
 'index_lower' :        adf04 level index
 'is_lower'    :        spin
 'il_lower'    :        angular momentumn
 'xj_lower'    :        statistical weight
 'eng_lower'   :        energy (cm-1)
 'cfg_upper'   :  upper configuration
 'index_upper' :        adf04 level index
 'is_upper'    :        spin
 'il_upper'    :        angular momentumn
 'xj_upper'    :        statistical weight
 'eng_upper'   :        energy (cm-1)
 'header'      :  header string for table
 'table'       :  list of strings formatted for table

Notes

Pure python code but relies on xxdata_04 which calls a compiled fortran routine.

The default behaviour is to output results to the screen but this can be changed with setting onscreen=False. Output to a file and/or a dictionary depends on whether a filename retunrn_dict is set.

A Gaunt factor is calculated for the closest temperature (in eV) corresponding to the ionisation potential (in eV).

For type 0 adf04 files with no transition data, such as the NIST files, assemble possible transitions according to the selection rules. These are dipole-only. For n-resolved use any combination.

ndlev and ndtrn are sizing options to read adf04 files which may be needed if these are larger than usual.

Version History

  • Martin O'Mullane, 28-12-2022

    • First version
  • Martin O'Mullane, 04-05-2023

    • Add the adf04 level indices to the fulldata dictionary.

Example

Prints information on transitions between 35-100A in the C4+ adf04 file to screen and returns the information in a dictionary. There are 4 lines.

>>> import adas as adas
>>> file='/home/adas/adas/adf04/adas#6/mom97_ls#c4.dat'
>>> res=adas.adf04_wave(file, wave_min=35.0, wave_max=100.0)
>>>> res['wave']
array([35.0680519 , 40.26527489, 40.72688157, 40.73019942])