trident.spectrum_generator.SpectrumGenerator.add_milky_way_foreground
- SpectrumGenerator.add_milky_way_foreground(flux_field=None, filename=None)[source]
Postprocess a spectrum to add a Milky Way foreground. Data from Charles Danforth. Median-filter of 92 normalized COS/G130M+G160M AGN spectra spanning the wavelength range of 1130 to 1800 Angstroms in 0.07 Angstrom bin size.
Parameters
- Flux_field
optional, array
Array of flux values to which the Milky Way foreground is applied. Default: None
- Filename
string
Filename where the Milky Way foreground values used to modify the flux are stored. Default: None
Example
Make a one zone ray and generate a COS spectrum for it. Add MW foreground to it, and save it.
>>> import trident >>> ray = trident.make_onezone_ray() >>> sg = trident.SpectrumGenerator('COS') >>> sg.make_spectrum(ray) >>> sg.add_milky_way_foreground() >>> sg.plot_spectrum('spec_mw_corrected.png')
Plot a naked MW spectrum.
>>> import trident >>> sg = trident.SpectrumGenerator('COS') >>> sg.add_milky_way_foreground() >>> sg.plot_spectrum('spec_mw.png')