LineList class and functions#

class specpolFlow.LineList(ion, wl, loggf, Elo, Jlo, Eup, Jup, landeLo, landeUp, landeEff, rad, stark, waals, depth, configLo, configUp, refs)#

Container for a set of spectral line data, usually from VALD.

This usually contains:

  • nLines - number of lines in the line list

  • ion - list of species identifiers (element or molecule and ionization)

  • wl - array of wavelengths

  • loggf - array of oscillator strengths (log gf)

  • Elo - array of excitation potentials for the lower level in the transition (in eV)

  • Jlo - array of J quantum numbers for the lower level

  • Eu - array of excitation potentials for the upper level in the transition (in eV)

  • Jup - array of J quantum numbers for the upper level

  • landeLo - array of Lande factors for the lower level

  • landeUp - array of Lande factors for the upper level

  • landeEff - array of effective Lande factors for the transition

  • rad - array of radiative damping coefficients

  • stark - array of quadratic Stark damping coefficients

  • waals - array of van der Waals damping coefficients

  • depth - depth at the centre of the spectral line, as estimated by VALD

  • configLo - list of strings with the electron configuration and term symbols for the lower level

  • configUp - list of strings with the electron configuration and term symbols for the upper level

  • refs - list of references for the sources of the line data (optional)

insert(i, newval)#

Insert lines from a LineList at a specific index. Returns a new LineList combining the two line lists (does not operate in place)

Parameters:
  • i – index to insert at

  • newval – LineList of new values to insert

Return type:

LineList

save(fname)#

Write a line list to a text file. This outputs using the VALD version 3 ‘extract stellar’ ‘long’ format.

A few details (e.g. references at the end of the file) are omitted since they are not saved in the LineList class.

Parameters:

fname – the file name to save the output to

specpolFlow.line_list_zeros(nLines)#

Generate a line list of zeros and blank text.

Used by read_VALD (It can be a bit faster to allocate all the array space at once.)

Parameters:

nLines – the number of lines in the LineList of zeros

Return type:

LineList

specpolFlow.read_VALD(fname)#

Read a list of spectral line data from VALD and return a LineList.

This expects VALD version 3 line list, in an ‘extract stellar’ ‘long’ format.

Parameters:

fname – the file name for the VALD line list.

Return type:

LineList

specpolFlow.getEffectiveLande(landeLo, landeUp, Jlo, Jup)#

Calculate an effective Lande factor for a transition.

This uses the upper and lower level Lande factors and J quantum numbers. The effective Lande factor is similar to an average weighted by the splitting pattern of the line. It parameterizes the displacement of the centre of gravity of the sigma components of a Zeeman split line.

Parameters:
  • landeLo – Lower level Lande factor

  • landeUp – Upper level Lande factor

  • Jlo – Lower level J quantum number

  • Jup – Upper level J quantum number

Returns:

Effective Lande factor for the transition

specpolFlow.estimateLande(J, config, verbose=False)#

Estimate a Lande factor for a level (if VALD doesn’t have one).

This supports levels in LS coupling, JJ coupling, and JK coupling. Levels in LK coupling are not supported. This relies on VALD3’s text format for electron term symbols and configurations.

Parameters:
  • J – The J quantum number for this level

  • config – The text string from VALD with the electron configuration and term symbol for the level

  • verbose – Report warnings for levels in unsupported coupling schemes if True

Returns:

The Lande factor estimated for this level. If the Lande factor can’t be estimated this will be 99.0.

specpolFlow.get_LS_numbers(config)#

Extract the L and S quantum numbers from a VALD term symbol text string, for a level in LS coupling.

Parameters:

config – the electron configuration and term symbol text string

Returns:

The L and S quantum numbers (if a parsing error occurs, negative values are returned)

specpolFlow.get_JJ_numbers(config)#

Extract the L1, S1, J1, L2, S2, and J2 quantum numbers for a level in JJ coupling from VALD’s electron configuration and term symbol text string.

This should cover the J1-J2 case (where two subgroups combine to produce J1 and J2, which combine to produce the total J), the J1-j case (where one subgroup makes J1, which combines with an additional electron with j to produce J), and it should work for the j-j case (for two equivalent electrons with their own j, which combine to make J).

Parameters:

config – the electron configuration and term symbol text string

Returns:

The L1, S1, J1, L2, S2, and J2 quantum numbers (if a parsing error occurs, negative values are returned)

specpolFlow.get_JK_numbers(config)#

Extract the L1, S1, J1, L2, S2, and K quantum numbers for a level in JK coupling from VALD’s electron configuration and term symbol text string.

This is sometimes called J1-l or J1-L2 coupling.

Parameters:

config – the electron configuration and term symbol text string

Returns:

The L1, S1, J1, L2, S2, and K quantum numbers (if a parsing error occurs, negative values are returned)