lfkit.photometry.magnitudes module#
Magnitude conversion utilities for LFKit.
This module provides helpers to translate between apparent m and
absolute magnitudes M using the cosmology utilities defined in LFKit.
The conversions follow the convention
M = m - mu - K + E m = M + mu + K - E
where mu is the distance modulus, K is the k-correction,
and E is the evolution correction.
All returned quantities are NumPy arrays of dtype float.
- lfkit.photometry.magnitudes.absolute_magnitude(cosmo_obj, z, apparent_mag, *, h=None, k_correction=None, e_correction=None)[source]#
Convert apparent magnitude m to absolute magnitude M.
The convention used is
M = m - mu - K + E.- Parameters:
cosmo_obj (Any) – Cosmology object passed to LFKit distance utilities.
z (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]) – Redshift value or array-like of redshift values.
apparent_mag (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]) – Apparent magnitude value(s).
h (float | None) – Optional dimensionless Hubble parameter. If provided, the distance modulus uses
mu = 5 log10(d_L * h) + 25.k_correction (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]] | None) – Optional k-correction term(s).
e_correction (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]] | None) – Optional evolution-correction term(s).
- Returns:
NumPy array of absolute magnitudes.
- Return type:
ndarray[tuple[Any, …], dtype[float64]]
- lfkit.photometry.magnitudes.absolute_magnitude_from_luminosity_distance(apparent_mag, luminosity_distance_mpc, *, k_correction=None, e_correction=None)[source]#
Convert apparent magnitude to absolute magnitude from luminosity distance.
The convention used is
M = m - mu - K + E,with
mu = 5 log10(d_L / Mpc) + 25.- Parameters:
apparent_mag (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]) – Apparent magnitude value(s).
luminosity_distance_mpc (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]) – Luminosity distance value(s) in Mpc.
k_correction (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]] | None) – Optional k-correction term(s).
e_correction (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]] | None) – Optional evolution-correction term(s).
- Returns:
NumPy array of absolute magnitudes.
- Return type:
ndarray[tuple[Any, …], dtype[float64]]
- lfkit.photometry.magnitudes.apparent_magnitude(cosmo_obj, z, absolute_mag, *, h=None, k_correction=None, e_correction=None)[source]#
Convert absolute magnitude M to apparent magnitude m.
The convention used is
m = M + mu + K - E.- Parameters:
cosmo_obj (Any) – Cosmology object passed to LFKit distance utilities.
z (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]) – Redshift value or array-like of redshift values.
absolute_mag (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]) – Absolute magnitude value(s).
h (float | None) – Optional dimensionless Hubble parameter. If provided, the distance modulus uses
mu = 5 log10(d_L * h) + 25.k_correction (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]] | None) – Optional k-correction term(s).
e_correction (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]] | None) – Optional evolution-correction term(s).
- Returns:
NumPy array of apparent magnitudes.
- Return type:
ndarray[tuple[Any, …], dtype[float64]]
- lfkit.photometry.magnitudes.apparent_magnitude_from_luminosity_distance(absolute_mag, luminosity_distance_mpc, *, k_correction=None, e_correction=None)[source]#
Convert absolute magnitude to apparent magnitude from luminosity distance.
The convention used is
m = M + mu + K - E,with
mu = 5 log10(d_L / Mpc) + 25.- Parameters:
absolute_mag (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]) – Absolute magnitude value(s).
luminosity_distance_mpc (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]) – Luminosity distance value(s) in Mpc.
k_correction (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]] | None) – Optional k-correction term(s).
e_correction (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]] | None) – Optional evolution-correction term(s).
- Returns:
NumPy array of apparent magnitudes.
- Return type:
ndarray[tuple[Any, …], dtype[float64]]
- lfkit.photometry.magnitudes.total_magnitude_correction(*, k_correction=None, e_correction=None)[source]#
Return the net correction added to apparent absolute conversion.
This combines optional k-correction and evolution-correction terms as
correction = K - Eso that
M = m - mu - correction.- Parameters:
k_correction (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]] | None) – Optional k-correction term(s).
e_correction (float | Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]] | None) – Optional evolution-correction term(s).
- Returns:
NumPy array of net correction values.
- Return type:
ndarray[tuple[Any, …], dtype[float64]]