yt.extensions.StarAnalysis.SpectrumBuilder.calculate_spectrum

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)

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

The region from which stars are extracted for analysis. If this is not specified, the next three parameters must be supplied.

star_mass : Array or list of floats

An array of star masses in Msun units.

star_creation_time : Array or list of floats

An array of star creation times in code units.

star_metallicity_fraction : Array or list of floats

An array of star metallicity fractions, in code

units (which is not Z/Zsun, rather just Z).

star_metallicity_constant : Float

If desired, override the star metallicity fraction of all the stars to the given value.

min_age : Float

Removes young stars younger than this number (in years) from the spectrum. Default: 0 (all stars).

Examples

>>> sp = pf.h.sphere([0.5,0.5,0.5], [.1])
>>> spec.calculate_spectrum(data_source=sp, min_age = 1.e6)

Previous topic

yt.extensions.StarAnalysis.SpectrumBuilder

Next topic

yt.extensions.StarAnalysis.SpectrumBuilder.read_bclib

This Page