SED¶
-
simcado.source.
SED
(spec_type, filter_name='V', magnitude=0.0)[source]¶ Return a scaled SED for a star or type of galaxy
The SED can be for stellar spectra of galacty spectra. It is best not to mix the two types when calling
SED()
. Either provide a list of stellar types, e.g. [“G2V”, “A0V”], of a list of galaxy types, e.g. [“elliptical”, “starburst”]To get the list of galaxy types that are installed, call get_SED_names(). All stellar types from the Pickles (1998) catalogue are available.
- Parameters
- spec_typestr, list
The spectral type of the star(s) - from the Pickles 1998 catalogue The names of a galaxy spectrum - see get_SED_names()
- filter_namestr, optional
Default is “V”. Any filter in the simcado/data directory can be used, or the user can specify a file path to an ASCII file for the filter
- magnitudefloat, list, optional
Apparent magnitude of the star. Default is 0.
- Returns
- lamnp.ndarray
[um] The centre of each 5 Ang bin along the spectral axis
- valnp.ndarray
[ph/s/m2/bin] The photon flux of the star in each bin
Notes
Original flux units for the stellar spectra are in [ph/s/m2/AA], so we multiply the flux by 5 to get [ph/s/m2/bin]. Therefore divide by 5*1E4 if you need the flux in [ph/s/cm2/Angstrom]
Examples
Get the SED and the wavelength bins for a J=0 A0V star
>>> from simcado.source import SED >>> lam, spec = SED("A0V", "J", 0)
Get the SED for a generic starburst galaxy
>>> lam, spec = SED("starburst")
Get the SEDs for several spectral types with different magnitudes
import matplotlib.pyplot as plt from simcado.source import SED lam, spec = SED(spec_type=["A0V", "G2V"], filter_name="Pa-beta", magnitude=[15, 20]) plt.plot(lam, spec[0], "blue", label="Vega") plt.plot(lam, spec[1], "orange", label="G2V") plt.semilogy(); plt.legend(); plt.show()
(Source code, png, hires.png, pdf)