lfkit.corrections.poggianti1997 module#

Poggianti (1997) k- and e-correction tables and interpolators.

Loads Poggianti (1997) k- and e-correction curves from CSV tables, builds interpolators for those curves (PCHIP, Akima, or linear), and optionally remaps the e-correction redshift grid to a target cosmology by matching lookback time.

Table I/O and parsing live in lfkit.utils.io. Interpolation utilities live in lfkit.utils.interpolation. Unit conversions live in lfkit.utils.units.

lfkit.corrections.poggianti1997.available_pairs(tab, *, min_points=5)[source]#

List usable (band -> SEDs) pairs in a Poggianti-style table.

Parameters:
  • tab (ndarray) – Structured array for a single correction table (k-corr or e-corr).

  • min_points (int) – Minimum number of samples required per extracted series.

Returns:

Mapping from band label to a list of SED labels that have usable data.

Return type:

dict[str, list[str]]

lfkit.corrections.poggianti1997.describe_poggianti1997_available(*, kcorr_path=None, ecorr_path=None)[source]#

Summarize available bands and SED columns in Poggianti CSV tables.

Parameters:
  • kcorr_path (str | Path | None) – Optional path to kcorr.csv. If not provided, the packaged file is used.

  • ecorr_path (str | Path | None) – Optional path to ecorr.csv. If not provided, the packaged file is used.

Returns:

  • "bands": list of available band labels

  • "seds": list of available SED column labels

Return type:

A dictionary with keys "kcorr" and "ecorr". Each contains

lfkit.corrections.poggianti1997.extract_sed_spectrum(sed_tab, sed_col)[source]#

Extract a Poggianti sed.csv column as (wave_A, flux) in rest frame.

Parameters:
  • sed_tab (ndarray) – Table returned by lfkit.utils.io.load_vizier_csv for sed.csv.

  • sed_col (str) – Column name in sed.csv, e.g. “logF03”.

Returns:

Wavelength grid in Å (sorted ascending). flux: Linear flux values (10**logF) on the same grid.

Return type:

wave_A

Raises:

ValueError – If required columns are missing or sed_col not present.

lfkit.corrections.poggianti1997.load_poggianti1997_tables(*, band='r', sed='E', kcorr_path=None, ecorr_path=None)[source]#

Load Poggianti (1997) k- and e-correction curves for a band and SED.

Parameters:
  • band (str) – Band/filter label in the tables (e.g. "r", "B", "V").

  • sed (str) – SED column label (e.g. "E", "Sa", "Sc").

  • kcorr_path (str | Path | None) – Optional path to kcorr.csv. If not provided, the packaged file is used.

  • ecorr_path (str | Path | None) – Optional path to ecorr.csv. If not provided, the packaged file is used.

Returns:

  • z_k and kcorr are the k-correction curve.

  • z_e and ecorr are the e-correction curve.

Return type:

Tuple (z_k, kcorr, z_e, ecorr)

Raises:

ValueError – If the requested (band, sed) is not available or contains insufficient usable samples.

lfkit.corrections.poggianti1997.make_ecorr_interpolator(z_e, ecorr, *, original_z, cosmo=None, zmap_zmax=20.0, zmap_nz=4096, method='pchip', extrapolate=True)[source]#

Create an interpolator for a Poggianti e-correction curve.

Parameters:
  • z_e (ndarray) – Redshift samples for the e-correction table.

  • ecorr (ndarray) – E-correction values at z_e.

  • original_z (bool) – If True, interpret z_e as Poggianti (1997) redshifts. If False, remap z_e to the target cosmology via lookback time.

  • cosmo – Target cosmology used for the remapping when original_z=False. If not provided, lfkit’s default cosmology is used.

  • zmap_zmax (float) – Maximum redshift used to build the remapping inversion grid.

  • zmap_nz (int) – Number of samples used to build the remapping inversion grid.

  • method (Literal['pchip', 'akima', 'linear']) – Interpolation method ("pchip", "akima", or "linear").

  • extrapolate (bool) – Whether to extrapolate beyond the tabulated domain.

Returns:

An interpolator callable E(z).

Return type:

PchipInterpolator | Akima1DInterpolator | Callable[[ndarray], ndarray]

lfkit.corrections.poggianti1997.make_kcorr_interpolator(z_k, kcorr, *, method='pchip', extrapolate=True, z_end=20.0, tail=True)[source]#

Create an interpolator for a Poggianti k-correction curve.

Parameters:
  • z_k (ndarray) – Redshift samples for the k-correction table.

  • kcorr (ndarray) – K-correction values at z_k.

  • method (Literal['pchip', 'akima', 'linear']) – Interpolation method ("pchip", "akima", or "linear").

  • extrapolate (bool) – Whether to allow evaluation outside the tabulated range.

  • z_end (float) – Redshift endpoint for the optional high-z tail.

  • tail (bool) – Whether to append a linear high-z tail out to z_end.

Returns:

An interpolator callable K(z).

Return type:

PchipInterpolator | Akima1DInterpolator | Callable[[ndarray], ndarray]

lfkit.corrections.poggianti1997.poggianti1997_lookback_time_gyr(z)[source]#

Return lookback time in the Poggianti (1997) cosmology.

Parameters:

z (ndarray | float) – Redshift value(s).

Returns:

Lookback time to each redshift (relative to z=0), in Gyr.

Return type:

ndarray

lfkit.corrections.poggianti1997.poggianti1997_time_since_bb_gyr(z)[source]#

Return cosmic time since the Big Bang in the Poggianti (1997) cosmology.

Parameters:

z (ndarray | float) – Redshift value(s).

Returns:

Cosmic time since the Big Bang at each redshift, in Gyr.

Return type:

ndarray

Notes

This uses the decelerating cosmology assumed by Poggianti (1997) (q0 = 0.225, H0 = 50 km/s/Mpc). It is intended for lookback-time matching when remapping e-about to a different cosmology.

lfkit.corrections.poggianti1997.poggianti1997_to_accelerating_redshift(z_dec, *, cosmo_obj, zmax=20.0, nz=4096)[source]#

Map Poggianti (1997) redshifts to a target cosmology via lookback time.

Parameters:
  • z_dec (ndarray | float) – Redshift value(s) in the Poggianti (1997) cosmology.

  • cosmo_obj – Target cosmology used to compute lookback times.

  • zmax (float) – Maximum redshift used to build the inversion grid.

  • nz (int) – Number of samples used to build the inversion grid.

Returns:

Redshift value(s) in the target cosmology with matched lookback time.

Return type:

ndarray

lfkit.corrections.poggianti1997.z_from_lookback_time(cosmo_obj, t_lb_gyr, *, zmax=20.0, nz=4096)[source]#

Invert lookback time to redshift using a precomputed interpolation grid.

Parameters:
  • cosmo_obj – Cosmology object accepted by lookback_time_gyr.

  • t_lb_gyr (ndarray | float) – Lookback time value(s) in Gyr.

  • zmax (float) – Maximum redshift used to build the inversion grid.

  • nz (int) – Number of samples used to build the inversion grid.

Returns:

Redshift value(s) corresponding to t_lb_gyr.

Raises:

ValueError – If requested lookback times fall outside the grid range.

Return type:

ndarray