synthesizer.emission_models.generators.dust.dust_emission_base¶
A submodule containing base classes for dust emission generators.
This includes generic base classes for energy-balance and scaled dust emission emissions, as well as a utility function for calculating CMB heating effects.
These base classes are not intended to be used directly, but rather to be inherited by specific dust emission models that implement the wrapper methods that generate the actual dust emission spectra and then scale them appropriately.
Functions
- synthesizer.emission_models.generators.dust.dust_emission_base.get_cmb_heating_factor(temperature, emissivity, redshift)[source]¶
Return the factor by which the CMB boosts the infrared luminosity.
This will also update the temperature of the dust at redshift z.
(See implementation in da Cunha+2013)
- Parameters:
temperature (unyt_array) – The temperature of the dust.
emissivity (float) – The emissivity index in the FIR (no unit)
redshift (float) – The redshift of the galaxy
- Return type:
tuple[float,unyt_quantity]
- synthesizer.emission_models.generators.dust.dust_emission_base.integrate_over_all_frequencies(lnu_func, temperature)[source]¶
Integrate a thermal dust spectrum over all frequencies.
This is used where the integral has no closed form. The spectrum is integrated on a fixed grid in x = h nu / k T from 1e-6 to 100, which holds all of the emission of a thermal spectrum at this temperature, so the result does not depend on the grid the spectrum is evaluated on.
- Parameters:
lnu_func (callable) – A function returning lnu (erg/s/Hz) for frequencies nu.
temperature (unyt_quantity) – The dust temperature.
- Returns:
The bolometric luminosity in the luminosity unit of Sed.bolometric_luminosity.
- Return type:
float
- synthesizer.emission_models.generators.dust.dust_emission_base.optically_thin_luminosity(temperature, emissivity=0.0)[source]¶
Return the integral of nu**emissivity * planck(nu, T) over all nu.
This is the bolometric luminosity of an optically thin greybody (or a blackbody when emissivity is 0), with nu in Hz as in the greybody, so dust spectra can be normalised without integrating over the (possibly truncated) wavelength grid they are evaluated on. The integral is
- 8 pi h (10 pc)^2 / c^2 (k T / h)^(4 + beta)
Gamma(4 + beta) zeta(4 + beta).
- Parameters:
temperature (unyt_quantity) – The dust temperature.
emissivity (float) – The emissivity (beta).
- Returns:
The bolometric luminosity in the luminosity unit of Sed.bolometric_luminosity.
- Return type:
float
Classes
- class synthesizer.emission_models.generators.dust.dust_emission_base.DustEmission(intrinsic=None, attenuated=None, scaler=None, do_cmb_heating=False, required_params=())[source]¶
Dust emission base class.
This is a base class for dust emission models and defines common methods and attributes.
Dust emission comes in two main flavours: energy-balance and scaled dust emission. The former of these requires an intrinsic and attenuated emission to derive the energy absorbed by dust, while the latter requires a scaler emission to scale the dust emission by. These can also be used in isolation without defining the intrinsic, attenuated or scaler emissions, in which case normalised emissions are returned.
- apply_cmb_heating(temperature, emissivity, redshift)[source]¶
Compute the cmb heating factor and modify the temperature.
Nothing is stored on the generator, since one generator can be shared by several models and emitters. Use the returned values to get the effective temperature and heating factor for a particular call.
- Parameters:
temperature (unyt_quantity) – The dust temperature without CMB heating.
emissivity (float) – The emissivity of the dust.
redshift (float) – The redshift at which to evaluate the CMB heating.
- Returns:
The CMB heating factor and the effective dust temperature.
- Return type:
tuple
- get_scaled_emission(normalised, scaling, emitter, model, out_dtype=None, cmb_factor=1.0)[source]¶
Get the normalised emission scaled by the scaling luminosity.
The normalised emission (per unit luminosity, on the wavelength or line grid) is multiplied by the scaling from get_scaling, one per particle for per-particle models, and by the CMB heating factor. The product is written straight into an array at the output precision.
- Parameters:
normalised (np.ndarray) – The emission per unit scaling luminosity.
scaling (float/unyt_quantity/unyt_array) – The scaling luminosity (from get_scaling).
emitter (Stars/Gas/BlackHole) – The object emitting the emission.
model (EmissionModel) – The emission model generating the emission.
out_dtype (np.dtype) – The output precision. Defaults to the global default output dtype.
cmb_factor (float) – The CMB heating factor.
- Returns:
The scaled emission, (nparticles, n) for per-particle models and (n,) otherwise.
- Return type:
np.ndarray
- get_scaling(emitter, model, emissions)[source]¶
Get the bolometric luminosity to scale the dust emission by.
- Parameters:
emitter (Stars/Gas/BlackHole) – The object emitting the emission.
model (EmissionModel) – The emission model generating the emission.
emissions (dict) – Dictionary containing all emissions generated so far.
- Returns:
The bolometric luminosity to scale the dust emission by.
- Return type:
unyt_quantity
- set_energy_balance(intrinsic, attenuated)[source]¶
Set the dust emission to be energy-balance.
- Parameters:
intrinsic (EmissionModel) – The name of the intrinsic emission defining the unattenuated emission for energy balance.
attenuated (EmissionModel) – The name of the attenuated emission defining the attenuated emission for energy balance.
- Return type:
None
- set_scaler(scaler)[source]¶
Set the dust emission to be scaled.
- Parameters:
scaler (EmissionModel) – The name of the emission to use to scale the dust emission by.
- Return type:
None