Without arguments, the LineDatabase will be empty, and you must manually add individual lines to it using the
add_linefunction. If LineDatabase is provided with an optional :input_file:, it will automatically add spectral lines for each corresponding line in the list.
Once created, you can select a subset of the total lines present in the database for further use. Use the
parse_subsetfunction to accomplish this.
An optional input_file can be provided to pre-store a list of Line objects. input_file should be a tab delimited text file of the format:
element, ion_state, wavelength, gamma, f_value, (name)
H, I, 1215.67, 4.69e8, 4.16e-1, Ly a
>>> # Create a LineDatabase using the lines present in lines.txt >>> ldb = LineDatabase('lines.txt')
>>> # Parse ldb and only select Lyman alpha, Mg II and Fe lines >>> lines = ldb.parse_subset(lines=['H I 1216', 'Mg II', 'Fe']) >>> print(lines)
||Manually add a line to the
||Load a line list from a file into the LineDatabase.|
||Select multiple lines based on atom, ion state, identifier, and/or wavelength.|
||Select ions based on those needed to create specific lines.|
||Select lines based on atom, ion state, identifier, and/or wavelength.|