Function adas.adf04_remove_levels
def adf04_remove_levels(file=None, level_list=None, remove_untied=False, ndlev=4500, ndtrn=150000)
-
Removes the user supplied levels from an adf04 file. The result is returned as an adf04 fulldata dictionary.
Parameters
file
:str
- full name of ADAS adf04 file
level_list
:int, list
orarray
- The list of levels to be purged. Not needed if remove_untied is True.
remove_untied
:bool
- if set to True, remove untied levels.
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 data is retained - R, S and H levels are dropped for this first version.
Note that the configuration and transition indices start at 1, as in the adf04 definition, and not at 0 (python-like).
Version History
-
Martin O'Mullane, 01-06-2022
- First version
-
Martin O'Mullane, 04-10-2022
- Indexing problem with remove_untied=True option for adf04 files with a single untied level.
-
Martin O'Mullane, 09-05-2023
- Add ndlev and ndtrn for pass-through to xxdata_04.
Example
Produce a cut-down Li0 file with just 3 levels.
>>> import adas as adas >>> file='/home/adas/adas/adf04/adas#3/cpb02_ls#li0.dat' >>> level_list=[4,5,6,7,8,9] >>> fd = adas.adf04_remove_levels(file, level_list) >>> fd['cstrga'] array(['1S2 2S1', '1S2 2P1', '1S2 3S1'], dtype='<U7')