trident-project / trident

A Synthetic Spectral Generation Suite
Other
21 stars 25 forks source link

[WIP] Adding support for linetools line lists as default #174

Open chummels opened 3 years ago

chummels commented 3 years ago

This PR adds support for using the linetools package to populate our line lists used when generating spectral features. Up until now, trident has used a text file, lines.txt with information ~200 different lines including their rest wavelength, oscillator strength, and gamma values. lines.txt was created using data from the NIST database and follows lines that are largely in the COS low-z window. linetools is a package created and used by observers across all of UV and optical astronomy assembled from empirical data. While we will leave in the old interface for creating text files, like lines.txt, for users to populate their own line data, it's generally a better default to use linetools for line information since that is what observers are using to analyze these datasets.

Right now, this PR is a work in progress, so please do not merge it until I remove the [WIP] tag. I want to put out a new stable version of trident before merging the linetools stuff, and I need to vet it a bit better and add some documentation.

To change Trident's line list to use linetools, you simply have to create your SpectrumGenerator with a different kwarg:

sg_new = trident.SpectrumGenerator('COS', line_database=None)

as opposed to if you want the default lines.txt line list:

sg_old = trident.SpectrumGenerator('COS', line_database='lines.txt')
jzuhone commented 1 year ago

@chummels I'm going to play with this, I think.