trident.line_database.LineDatabase.select_lines

LineDatabase.select_lines(element=None, ion_state=None, wavelength=None, identifier=None, source_list=None)[source]

Select lines based on atom, ion state, identifier, and/or wavelength. Once you’ve created a LineDatabase, you can subselect certain lines from it based on line characteristics. Recommended to use parse_subset instead which allows selecting of multiple sets of lines simultaneously.

Parameters

Element

string, optional

The element of the transition using element’s symbol on periodic table Example: ‘H’, ‘C’, ‘Mg’ Default: None

Ion_state

string, optional

The roman numeral representing the ionic state of the transition Example: ‘I’ for neutral species, ‘II’ for singly ionized, etc. Default: None

Wavelength

float, optional

The wavelength of the transition in angstroms Example: 1216 for Lyman alpha Default: None

Identifier

string, optional

An optional identifier for the transition Example: ‘Ly a’ for Lyman alpha Default: None

Source_list

list of Line objects, optional

The source list from which to select lines. If set to None, use the LineDatabase’s list ‘lines_all’. Default: None

Returns

Selected_lines

list

A list of which lines were selected.

Example

>>> ldb = LineDatabase('lines.txt')
>>> selected_lines = ldb.select_lines(element='Mg', ion_state='II')