Function adas.transition_index

def transition_index(lower, upper, req_lower, req_upper)

Return the index in lower and upper list corresponding to a requested set of transitions.

Parameters

lower : int, array
lower level index
upper : int, array
upper level index
req_lower : int, optional array
lower level for which index is required
req_upper : int, optional array
upper level for which index is required

Returns

itran : int, may be an array
index of requested transition in lower and upper arrays.

Notes

An index of -1 is returned if there is no match or if there is more than one match. The value should be checked before using to extract values from an array.

upper and lower lists follow ADAS convention of starting at 1 but the returned index follows python convention of starting at 0.

Version History

  • Martin O'Mullane, 24-01-2024

    • First version
  • Martin O'Mullane, 27-02-2024

    • If only one transition is requested return an integer and not a 1 element array.

Examples

Find the A-values of the 2s 2p 1P (transition 5-1) and 2s 3p 1P transition 11-1) in Li+.

>>> import adas as adas
>>> import numpy as np
>>> file='/home/adas/adas/adf04/adas#3/cpb02_ls#li1.dat'
>>> fd=adas.xxdata_04(file)
>>> index=adas.transition_index(fd['lower'], fd['upper'], [1, 1], [5, 11])
>>> print(index)
[3 9]
>>> print(fd['aval'][index])
[2.65e+10 8.57e+09]