SpectrumBuilder.
calculate_spectrum
(data_source=None, star_mass=None, star_creation_time=None, star_metallicity_fraction=None, star_metallicity_constant=None, min_age=0.0 yr)[source]¶For the set of stars, calculate the collective spectrum. Attached to the output are several useful objects: final_spec: The collective spectrum in units of flux binned in
wavelength.
wavelength: The wavelength for the spectrum bins, in Angstroms. total_mass: Total mass of all the stars. avg_mass: Average mass of all the stars. avg_metal: Average metallicity of all the stars.
Parameters: | data_source : AMRRegion object, optional
star_mass : Array or list of floats
star_creation_time : Array or list of floats
star_metallicity_fraction : Array or list of floats
star_metallicity_constant : Float
min_age : Float
|
---|
Examples
>>> import yt
>>> from yt.analysis_modules.star_analysis.api import SpectrumBuilder
>>> ds = yt.load("Enzo_64/RD0006/RedshiftOutput0006")
>>> spec = SpectrumBuilder(ds, "bc", model="salpeter")
>>> sp = ds.sphere([0.5, 0.5, 0.5], 0.1)
>>> spec.calculate_spectrum(data_source=sp, min_age=1.e6)