trident.line_database.LineDatabase.parse_subset

LineDatabase.parse_subset(subsets='all')[source]

Select multiple 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. Preferred to use this method over select_lines.

Will return the unique union of all lines matching the specified subsets from the LineDatabase.

Parameters

Subsets:

list of strings, optional

List strings matching possible lines. Strings can be of the form: * Atom - Examples: “H”, “C”, “Mg” * Ion - Examples: “H I”, “H II”, “C IV”, “Mg II” * Line - Examples: “H I 1216”, “C II 1336”, “Mg II 1240” * Identifier - Examples: “Ly a”, “Ly b”

If set to None, selects all lines in LineDatabase. Default: None

Returns

Line subset:

list of trident.Line objects

A list of the Lines that were selected

Example

>>> # Get a list of all lines of Carbon, Mg II and Lyman alpha
>>> ldb = LineDatabase('lines.txt')
>>> lines = ldb.parse_subset(['C', 'Mg II', 'H I 1216'])
>>> print(lines)