Function adas.adf04_bundle_levels

def adf04_bundle_levels(file=None, level_list=None, zero_s=False, zero_l=False, ndlev=4500, ndtrn=150000)

Bundles levels in an adf04 file according to a input map and returns an adf04 fulldata dictionary.

Parameters

file : str
full name of ADAS adf04 file
level_list : int, list or array
The map of levels to be bundled.
zero_s : bool
if True set 'isa' in output dictionary to 0.0.
zero_l : bool
if True set 'ila' in output dictionary to 0.0.
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

fulldata : dict
adf04 dictionary.

Notes

Pure python code but calls routines which are dependent on fortran.

Only excitation and ionisation data is retained. Also assume just one parent for ionisation.

Note that the configuration and transition indices start at 1, as in the adf04 definition, and not at 0 (python-like).

zero_s and zero_l may be used to set spin and angular momentum to zero if these are not meaningful, eg when bundling to a configuration or super-configuration.

Version History

  • Martin O'Mullane, 25-08-2023

    • First version
  • Martin O'Mullane, 25-09-2023

    • Fix issues with repeated bundles (over split levels).
    • Ensure upper index is always greater than lower.

Example

Produce an n-resolved Li0 dataset.

>>> import adas as adas
>>> file='/home/adas/adas/adf04/lilike/lilike_aug99#li0_t1.dat'
>>> level_list=[1, 1,2, 2, 2, 3, 3, 3]
>>> fd = adas.adf04_bundle_levels(file, level_list)
>>> fd['wa']