uvex_transients.dust.attenuation_callable#
- uvex_transients.dust.attenuation_callable(Ebv: float | Quantity | NDArray[float64], dust_law: str | None = None) Callable[[Quantity], NDArray[float64]][source]#
Bind log_attenuation to a fixed E(B-V)/dust law, as a plain
nu -> ln(transmission)callable.This is what ~uvex_transients.models.core.base.SpectralModel.as_source_spectrum and ~uvex_transients.models.core.base.SpectralModel.simulate_photometry call internally, themselves, whenever their own
ebvkeyword is given – callers of those methods just passebv=...directly and never see this function, a callable, or functools.partial at all. It’s exposed here only for the rare case of building a bespokeModel/SourceSpectrumby hand, outside of as_source_spectrum, that still wants this module’s already-resolved-\(E(B-V)\)-to-callable contract (log_attenuation(wave) -> ln(transmission), evaluated against a wavelength grid unknown untilsynphotsamples it).- Parameters:
Ebv (
float,Quantity, ornumpy.ndarray) – Already-resolved E(B-V) – see resolve_ebv.dust_law (
str, optional) – Passed through to log_attenuation/get_dust_law. The configured default is almost always the right choice; this is here mainly so the resulting callable stays a pure function of its inputs.
- Returns:
nu -> log_attenuation(nu, Ebv, dust_law).- Return type:
Callable[[~astropy.units.Quantity],numpy.ndarray]