lfkit.api.luminosity_function module#
Public luminosity function interface.
This module provides the user-facing LuminosityFunction API for
evaluating luminosity functions in absolute- or apparent magnitude space.
The class stores luminosity function model state and exposes grouped API
namespaces for related calculations. Low-level numerical and photometric
work remains in the function-based lfkit.photometry modules.
- class lfkit.api.luminosity_function.LuminosityFunction(*, model, parameters, meta=None)[source]#
Bases:
objectUser-facing wrapper for luminosity function evaluation.
- Parameters:
model (str) – Name of the luminosity function model.
parameters (Mapping[str, object]) – Model parameters passed to the underlying LF function.
meta (Mapping[str, object] | None) – Optional metadata describing the LF source or calibration.
- static available_from_m_models()[source]#
Return models that support apparent magnitude evaluation.
- Return type:
list[str]
- static available_models()[source]#
Return luminosity function model names available through the API.
- Return type:
list[str]
- static available_parameter_models()[source]#
Return available LF parameter evolution models.
- Return type:
dict[str, list[str]]
- classmethod double_schechter(*, phi_star, m_star, alpha, beta, m_transition, meta=None)[source]#
Create a double-power-law Schechter luminosity function.
- Parameters:
phi_star (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]) – Normalization of the luminosity function.
m_star (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]) – Characteristic absolute magnitude.
alpha (float) – Bright-end or main Schechter slope.
beta (float) – Additional slope controlling the second power-law component.
m_transition (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]) – Transition magnitude for the second component.
meta (Mapping[str, object] | None) – Optional metadata describing the LF source or calibration.
- Returns:
Luminosity-function API object using the double Schechter model.
- Return type:
- classmethod evolving_schechter(*, phi_model='linear_p', phi_kwargs=None, m_star_model='linear_q', m_star_kwargs=None, alpha_model='constant', alpha_kwargs=None, meta=None)[source]#
Create a redshift-evolving Schechter luminosity function.
- Parameters:
phi_model (str) – Parameter model used for the normalization evolution.
phi_kwargs (Mapping[str, float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]] | None) – Keyword arguments for the normalization model.
m_star_model (str) – Parameter model used for characteristic-magnitude evolution.
m_star_kwargs (Mapping[str, float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]] | None) – Keyword arguments for the characteristic-magnitude model.
alpha_model (str) – Parameter model used for faint-end-slope evolution.
alpha_kwargs (Mapping[str, float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]] | None) – Keyword arguments for the faint-end-slope model.
meta (Mapping[str, object] | None) – Optional metadata describing the LF source or calibration.
- Returns:
Luminosity-function API object using an evolving Schechter model.
- Return type:
- parameters(z)[source]#
Evaluate evolving Schechter parameters at redshift.
- Parameters:
z (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]) – Redshift values where the evolving LF parameters are evaluated.
- Returns:
Tuple containing
phi_star(z),m_star(z), andalpha(z).- Return type:
tuple[ndarray[tuple[Any, …], dtype[float64]], ndarray[tuple[Any, …], dtype[float64]], ndarray[tuple[Any, …], dtype[float64]]]
- phi(absolute_mag, z=None)[source]#
Evaluate the luminosity function in absolute magnitude space.
- Parameters:
absolute_mag (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]) – Absolute magnitude values where the LF is evaluated.
z (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]] | None) – Redshift or conditional-coordinate values. Required for evolving and conditional models.
- Returns:
Luminosity-function values evaluated at the input magnitudes.
- Return type:
ndarray[tuple[Any, …], dtype[float64]]
- phi_from_m(cosmo_obj, z, apparent_mag, *, h=None, corrections=None)[source]#
Evaluate the luminosity function from apparent magnitudes.
Apparent magnitudes are converted to absolute magnitudes using the supplied cosmology, optional reduced Hubble parameter, and optional k- and e-correction model.
- Parameters:
cosmo_obj (Any) – Cosmology object used for distance-modulus conversion.
z (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]) – Redshift values.
apparent_mag (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]) – Apparent magnitude values.
h (float | None) – Optional reduced Hubble parameter used in the magnitude conversion.
corrections (object | None) – Optional object providing k-correction and e-correction values.
- Returns:
Luminosity-function values evaluated from apparent magnitudes.
- Return type:
ndarray[tuple[Any, …], dtype[float64]]
- static register_alpha_model(name, model, *, overwrite=False)[source]#
Register an alpha evolution model.
- Parameters:
name (str) – Name used to identify the model.
model (Callable[[...], ndarray[tuple[Any, ...], dtype[float64]]]) – Callable evaluating
alpha(z).overwrite (bool) – If True, replace an existing model with the same name.
- Return type:
None
- static register_m_star_model(name, model, *, overwrite=False)[source]#
Register an M-star evolution model.
- Parameters:
name (str) – Name used to identify the model.
model (Callable[[...], ndarray[tuple[Any, ...], dtype[float64]]]) – Callable evaluating
M_star(z).overwrite (bool) – If True, replace an existing model with the same name.
- Return type:
None
- static register_phi_star_model(name, model, *, overwrite=False)[source]#
Register a phi-star evolution model.
- Parameters:
name (str) – Name used to identify the model.
model (Callable[[...], ndarray[tuple[Any, ...], dtype[float64]]]) – Callable evaluating
phi_star(z).overwrite (bool) – If True, replace an existing model with the same name.
- Return type:
None
- classmethod schechter(*, phi_star, m_star, alpha, meta=None)[source]#
Create a standard Schechter luminosity function.
- Parameters:
phi_star (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]) – Normalization of the luminosity function.
m_star (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]) – Characteristic absolute magnitude.
alpha (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]) – Faint-end slope.
meta (Mapping[str, object] | None) – Optional metadata describing the LF source or calibration.
- Returns:
Luminosity-function API object using the standard Schechter model.
- Return type: