lephare._plot_utils
Classes
Utility class for generating diagnostic plots and statistical summaries |
Module Contents
- class PlotUtils(t, sel_filt=0, pos_filt=None, range_z=None, range_mag=None, pdf_col=None)[source]
Utility class for generating diagnostic plots and statistical summaries from LePHARE output tables.
This class provides a suite of methods for analyzing photometric redshift and physical parameters catalogs generated by LePHARE, including comparisons between photometric and spectroscopic redshifts, redshift error distributions, chi-squared diagnostics, magnitude and color relations, and other common validation plots.
Examples
Typical usage example:
from astropy.table import Table import lp t = Table.read("outputphotoz.fits") utils = lp.PlotUtils( t, sel_filt=3, pos_filt=[0, 1, 2, 4, 5, 5], range_z=[0, 0.5, 1, 1.5, 3], range_mag=[19, 20.5, 21.5, 22.5, 25] ) utils.zml_zs() utils.zp_zs() utils.zml_zp() utils.dist_z() utils.dist_chi2() utils.dist_filt() utils.dist_model() utils.dist_ebv() utils.secondpeak() utils.bzk() utils.cumulative68() utils.check_error() utils.errormag() utils.errorz() utils.pit_qq() utils.absmag_z() utils.rf_color() utils.william() utils.dist_mass() utils.dist_sfr() utils.dist_ssfr() utils.mass_med_best() utils.sfr_med_best() utils.mass_sfr() utils.mass_z() utils.sfr_z() utils.lnuv_sfr() utils.absmagu_sfr() utils.absmagk_mass() utils.masstolight_z() utils.save_all_plots_pdf()
- Parameters:
t (astropy.table.Table) – Table containing the output from a LePHARE run. Must include columns such as
Z_BEST,Z_MED,MAG_OBS(),MAG_ABS(),CHI_BEST, etc.sel_filt (int, optional) – Index (starting at 0) of the filter used to select objects by observed magnitude. Default is 0.
pos_filt (list of int, optional) – Indices (starting at 0) of the filters corresponding to u, g, r, z, J, and Ks bands. Used to generate color-based plots. Default is
[0, 0, 0, 0, 0, 0].range_z (list of float, optional) – Redshift bin edges to use in diagnostics. If not provided, quartiles of the spectroscopic redshift distribution (0, 0.25, 0.5, 0.75, 1 quantiles) are used.
range_mag (list of float, optional) – Observed magnitude bin edges to use in diagnostics. If not provided, quartiles of the selected-band magnitude distribution (0, 0.25, 0.5, 0.75, 1 quantiles) are used.
- zp, zml, zs
Best-fit, median, and spectroscopic redshifts, respectively.
- Type:
ndarray
- chi, chi2
Chi-squared values for best-fit and secondary models.
- Type:
ndarray
- mag, magu, magb, magr, magz, magj, magk
Observed magnitudes in various filters.
- Type:
ndarray
- mabsu, mabsb, mabsr, mabsz, mabsj, mabsk
Absolute magnitudes in various filters.
- Type:
ndarray
- range_z, range_mag
Bin edges used for redshift and magnitude-based diagnostics.
- Type:
ndarray
- cond, condgal, condstar, condspec
Boolean selection masks for general, galaxy, star, and spectroscopic subsets.
- Type:
ndarray of bool
- z_min, z_max, mag_min, mag_max
Minimum and maximum values for redshift and magnitude selection.
- Type:
float
- nbRowM, nbColM, nbRowZ, nbColZ
Number of subplot rows and columns used in magnitude and redshift binnings.
- Type:
int
Notes
The filter numbering starts at 0.
The table must contain all expected columns from a LePHARE output table.
The class methods produce a variety of plots to assess photometric redshift performance and SED fitting reliability.
- save_photoz_plots_pdf(filename='all_plots.pdf', **kwargs)[source]
Generate all photoz plotting methods in the class and save them in a single PDF.
- Parameters:
filename (str, optional) – The output PDF filename (default “all_photoz_plots.pdf”).
**kwargs (dict, optional) –
Keyword arguments to pass to the plotting methods. Common keys include: - bins : int
Number of bins for histograms.
- show_pitbool
Whether to include PIT histogram in applicable plots.
- show_qqbool
Whether to include QQ plots in applicable methods.
- savefigbool
Whether to save individual plots.
Any method that does not accept a particular key will ignore it.
- save_phys_plots_pdf(filename='all_phys_plots.pdf', **kwargs)[source]
Generate all physical parameter plots in the class and save them in a single PDF.
- Parameters:
filename (str, optional) – The output PDF filename (default “all_phys_plots.pdf”).
**kwargs (dict, optional) –
Keyword arguments to pass to the plotting methods. Common keys include: - bins : int
Number of bins for histograms.
- show_pitbool
Whether to include PIT histogram in applicable plots.
- show_qqbool
Whether to include QQ plots in applicable methods.
- savefigbool
Whether to save individual plots.
Any method that does not accept a particular key will ignore it.
- title_page()[source]
Create a title page for diagnostic plots.
This method generates a simple title page summarizing the LePHARE diagnostic plots. It includes the LePHARE version and the current date. The information is displayed centered on the page.
The axes are retained (not hidden) so that further annotations or plot elements can be added later if needed.
- zml_zs()[source]
Plot photometric redshifts (median of the PDF) versus spectroscopic redshifts.
This diagnostic compares the median of PDF(z) (Z_MED) derived by LePHARE with the spectroscopic redshifts (ZSPEC) for all objects meeting the selection criteria. It is commonly used to assess the accuracy, scatter, and presence of catastrophic outliers in photometric redshift estimates.
The plot is divided into subpanels based on magnitude bins defined in range_mag. Each panel displays Z_MED versus ZSPEC, with reference lines indicating the 1:1 relation and typical deviation thresholds.
Notes
Only objects with valid spectroscopic redshifts (0 < ZSPEC < 9) and within the defined redshift and magnitude ranges are included.
The number and layout of subpanels depend on the magnitude binning.
This plot is typically one of the first diagnostics used to check the performance of photometric redshift estimation.
See also
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.zml_zs() # Produces a Z_MED vs ZSPEC scatter plot by magnitude bin.
- zp_zs()[source]
Plot photometric redshifts (minimum chi-squared value) versus spectroscopic redshifts.
This diagnostic compares the best-fit photometric redshifts (Z_BEST) obtained from the minimum χ² solution in LePHARE with the spectroscopic redshifts (ZSPEC). It is useful for assessing the quality and bias of the primary redshift solution and identifying catastrophic outliers.
The figure is divided into subpanels according to the magnitude bins defined in range_mag. Each panel shows Z_BEST versus ZSPEC along with reference lines for the one-to-one relation and typical redshift deviation thresholds (e.g., Δz / (1 + z) = ±0.05).
Notes
Only sources with valid spectroscopic redshifts (0 < ZSPEC < 9) and within the defined redshift and magnitude ranges are included.
The panel layout is determined by the number of magnitude bins.
This plot complements
zml_zs()by using the minimum χ² redshift rather than the PDF median.
See also
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.zp_zs() # Produces a Z_BEST vs ZSPEC scatter plot by magnitude bin.
- zml_zp()[source]
Plot photometric redshifts (median of the PDF) versus photometric redshifts (minimum χ²).
This diagnostic compares the two photometric redshift estimates produced by LePHARE: the median of the posterior probability distribution (Z_MED) and the best-fit value from the minimum χ² solution (Z_BEST). The comparison helps identify systematic biases between the two estimators and assess the stability of redshift determinations.
The figure is divided into subpanels based on magnitude bins defined in range_mag. Each subpanel shows Z_MED versus Z_BEST with a 1:1 reference line and scatter indicating consistency between the two measures.
Notes
Only sources within the defined redshift and magnitude ranges are included.
The plot can reveal populations where the PDF and best-fit solutions diverge, such as multi-peaked PDFs or poor fits.
Strong deviations from the 1:1 line indicate inconsistency between the χ²-based and PDF-based estimates.
See also
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.zml_zp() # Produces a Z_MED vs Z_BEST comparison plot by magnitude bin.
- dist_z(nstep=20)[source]
Plot the redshift distribution of the spectroscopic and photometric samples.
This diagnostic shows histograms of the spectroscopic redshifts (ZSPEC), the photometric redshifts from the minimum χ² solution (Z_BEST), and the median of the PDF (Z_MED). It provides an overview of the redshift coverage and potential biases between the photometric and spectroscopic distributions.
- Parameters:
nstep (int, optional) – Number of bins to use in the redshift histograms. Default is 20.
Notes
Only objects satisfying the redshift and magnitude selection criteria are used.
Overlaid histograms allow direct comparison of the redshift distributions.
Discrepancies between spectroscopic and photometric distributions may indicate systematic shifts or incomplete coverage in certain redshift ranges.
See also
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.dist_z(nstep=30) # Produces histograms of ZSPEC, Z_BEST, and Z_MED distributions.
- dist_chi2(nstep=20)[source]
Plot the reduced χ² distribution as a function of observed magnitude.
This diagnostic shows the distribution of the minimum χ² values (CHI_BEST) for different magnitude bins, helping to assess the quality of SED fits across brightness ranges. Poorer fits at faint magnitudes may indicate increased photometric noise or template limitations.
We estimate the reduced χ² by dividing the minimum χ² by the number of filters used minus 1
- Parameters:
nstep (int, optional) – Number of bins to use in the χ² histograms. Default is 20.
Notes
The figure is typically divided into subpanels according to range_mag.
Only objects meeting the redshift and magnitude selection criteria are included.
A broad or asymmetric χ² distribution at a given magnitude may suggest underestimated photometric errors or mismatched templates.
See also
dist_zShow redshift distributions.
dist_modelShow distribution of best-fit SED model identifiers.
dist_ebvShow distribution of dust extinction values.
check_errorVerify internal photometric error estimates.
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.dist_chi2(nstep=30) # Produces χ² histograms by magnitude bin.
- dist_filt(nstep=10)[source]
Plot the distribution of the number of filters used in each fit.
This diagnostic shows how many photometric bands were included by LePHARE when fitting each object. It helps assess data completeness and detect cases where limited filter coverage may affect the reliability of photometric redshifts or SED parameters.
- Parameters:
nstep (int, optional) – Number of bins to use in the histogram of NBAND_USED. Default is 10.
Notes
Uses the NBAND_USED column from the LePHARE output table.
Only sources satisfying the redshift and magnitude selection criteria are included.
A concentration of objects with a low number of filters may indicate missing photometry or incomplete coverage in certain bands.
See also
dist_chi2Show χ² distribution by magnitude bin.
dist_modelShow distribution of best-fit model identifiers.
dist_ebvShow distribution of dust extinction values.
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.dist_filt(nstep=15) # Produces a histogram of the NBAND_USED distribution.
- dist_model(nstep=20)[source]
Plot the distribution of best-fit SED model identifiers.
This diagnostic displays the frequency of SED templates (MOD_BEST) selected by LePHARE as the best-fitting models across the sample. It helps visualize which galaxy, AGN, or stellar templates dominate the fits and can reveal biases toward certain template types.
- Parameters:
nstep (int, optional) – Number of bins to use in the histogram of model identifiers. Default is 20.
Notes
Uses the MOD_BEST column from the LePHARE output table.
Only sources satisfying the redshift and magnitude selection criteria are included.
The model identifiers correspond to entries in the LePHARE template library.
A dominance of certain templates may indicate population trends or a lack of diversity in the input SED library.
See also
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.dist_model(nstep=25) # Produces a histogram of MOD_BEST template identifiers.
- dist_ebv(nstep=10)[source]
Plot the distribution of best-fit dust extinction values (E(B-V)).
This diagnostic shows the range and frequency of dust extinction (EBV_BEST) values derived by LePHARE for the sample. It helps assess typical dust content and the effects of extinction on photometric redshift or SED fitting results.
- Parameters:
nstep (int, optional) – Number of bins to use in the histogram of E(B-V) values. Default is 10.
Notes
Uses the EBV_BEST column from the LePHARE output table.
Only sources meeting the redshift and magnitude selection criteria are included.
Peaks or concentrations in E(B-V) may indicate preferred extinction values in the template set or the typical dust content of the population.
See also
dist_modelShow distribution of best-fit SED model identifiers.
dist_chi2Show χ² distribution by magnitude bin.
dist_filtShow number of filters used in each fit.
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.dist_ebv(nstep=15) # Produces a histogram of EBV_BEST values.
- secondpeak(nstep=20)[source]
Plot the redshift distribution of the secondary photometric redshift peak.
This diagnostic examines objects where LePHARE identifies a secondary photometric redshift solution (Z_SEC) and compares it with the primary solutions (Z_BEST and Z_MED). It helps identify multi-modal PDFs and potential catastrophic redshift outliers.
- Parameters:
nstep (int, optional) – Number of bins to use in the histogram of secondary peak redshifts. Default is 20.
Notes
Only sources with a valid secondary peak (Z_SEC) are included.
The figure may be divided into subpanels based on magnitude bins.
Comparison of primary and secondary peaks can reveal degeneracies in SED fitting and ambiguous photometric redshift solutions.
Useful for assessing the reliability of photometric redshift catalogs and flagging objects with uncertain redshifts.
See also
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.secondpeak(nstep=25) # Produces a histogram of secondary peak redshifts compared with primary solutions.
- bzk()[source]
Plot BzK diagram for galaxy/star classification per redshift bin.
This diagnostic produces BzK color-color diagrams to separate star-forming galaxies, passive galaxies, and stars based on the observed B, z, and K magnitudes. The plots are generated for different redshift bins defined in range_z, allowing assessment of population segregation at different epochs.
Notes
Uses the observed magnitudes in B (magb), z (magz), and K (magk) filters.
Only sources meeting the redshift and magnitude selection criteria are included.
Overlaid regions indicate typical BzK selection areas for star-forming galaxies, passive galaxies, and stars.
Helps identify misclassified objects or potential contamination by stars in galaxy samples.
See also
dist_filtShow number of filters used in each fit.
dist_modelShow distribution of best-fit SED model identifiers.
secondpeakExamine secondary photometric redshift peaks.
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.bzk() # Produces BzK color-color diagrams per redshift bin.
- absmag_z()[source]
Plot B-band absolute magnitude versus redshift for the sample.
This diagnostic shows the relation between absolute magnitudes and redshift, providing insight into luminosity evolution, selection effects, and completeness limits of the survey.
Notes
Uses the B-band absolute magnitudes
Only objects within the redshift and magnitude selection ranges are included.
The figure can be divided into subpanels based on magnitude or redshift bins.
Helps identify trends such as brightening or dimming with redshift and the distribution of galaxies in the luminosity-redshift plane.
See also
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.absmag_z() # Produces plots of absolute magnitude versus redshift.
- rf_color()[source]
Plot rest-frame colors U-R versus absolute magnitude R.
This diagnostic shows the relation between rest-frame colors and absolute magnitudes in different bands, allowing analysis of galaxy populations, color bimodality, and stellar population trends.
Notes
Uses absolute magnitudes (MAG_ABS()) and rest-frame colors derived from the best-fit templates.
Only objects within the redshift and magnitude selection ranges are included.
Can reveal red sequence and blue cloud populations in the color–magnitude diagram.
Subpanels can be used to separate objects by magnitude or redshift bins.
See also
absmag_zAbsolute magnitude versus redshift.
bzkBzK color-color diagram for star/galaxy classification.
dist_modelDistribution of best-fit SED models.
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.rf_color() # Produces rest-frame color versus absolute magnitude plots.
- william()[source]
Create a rest-frame U-R, R-J color-color plot.
This diagnostic reproduces the rest-frame color-color diagrams of ‘’William’’, which are commonly used to separate galaxy populations (e.g., quiescent vs star-forming) and study stellar population properties.
Notes
Uses rest-frame magnitudes or colors derived from the best-fit templates.
Only objects within the redshift and magnitude selection ranges are included.
Subpanels can be applied based on redshift or magnitude bins to study evolution with cosmic time.
Helps visualize the bimodality of galaxy populations in rest-frame color space.
See also
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.william() # Produces a William style rest-frame color-color plot.
- cumulative68(nstep=20)[source]
Check that 68% of spectroscopic redshifts fall within the 68% photometric error interval.
This diagnostic evaluates the accuracy of photometric redshift uncertainties by computing the fraction of objects for which the spectroscopic redshift (ZSPEC) lies within the 68% confidence interval of the photometric redshift PDF (Z_MED68_LOW to Z_MED68_HIGH or Z_BEST68_LOW to Z_BEST68_HIGH). It helps validate the reliability of the estimated errors.
- Parameters:
nstep (int, optional) – Number of bins to use when plotting cumulative distributions. Default is 20.
Notes
Only objects with valid spectroscopic redshifts are considered.
A well-calibrated photometric redshift error distribution should contain ~68% of spectroscopic redshifts within the 68% interval.
Deviations from 68% indicate under- or overestimated photometric uncertainties.
See also
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.cumulative68(nstep=30) # Evaluates the fraction of spectroscopic redshifts within the 68% photometric error interval.
- check_error()[source]
Check photometric redshift errors as a function of magnitude.
This diagnostic evaluates how the estimated photometric redshift uncertainties change as a function of observed magnitude.
Notes
Uses the columns Z_BEST68_LOW, Z_BEST68_HIGH, Z_MED68_LOW, Z_MED68_HIGH, and ZSPEC.
The plot shows error distributions as a function of the selected magnitude band.
Can reveal trends where photometric errors are underestimated at faint magnitudes or overestimated at bright magnitudes.
See also
cumulative68Check fraction of spectroscopic redshifts within the 68% photometric error.
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.check_error() # Produces a plot of photometric redshift errors versus observed magnitude.
- errormag()[source]
Plot photometric redshift errors as a function of observed magnitude.
This diagnostic shows how the estimated photometric redshift errors (e.g., derived from the PDF width or χ² fitting) vary with object brightness. It is useful for assessing the reliability of redshift estimates across the magnitude range.
Notes
Uses the selected magnitude (mag) and corresponding photometric redshift errors from the LePHARE output.
Only objects within the redshift and magnitude selection criteria are included.
Typically, errors increase for fainter objects due to lower signal-to-noise.
See also
check_errorEvaluate 68% error coverage as a function of magnitude.
errorzCompare photometric redshift errors as a function of redshift.
cumulative68Check fraction of spectroscopic redshifts within the 68% photometric error.
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.errormag() # Produces a plot of photometric redshift errors versus magnitude.
- errorz()[source]
Plot photometric redshift errors as a function of redshift.
This diagnostic shows how the estimated photometric redshift uncertainties (e.g., derived from the PDF width or χ² fitting) vary with redshift. It is useful for identifying redshift ranges where photometric redshifts may be less reliable or exhibit larger scatter.
Notes
Uses the photometric redshifts (Z_BEST or Z_MED) and their associated uncertainties from the LePHARE output.
Only objects within the redshift and magnitude selection criteria are included.
Errors often increase at high redshift due to fainter magnitudes and fewer spectral features in the observed bands.
See also
errormagPhotometric redshift errors versus observed magnitude.
check_errorEvaluate 68% error coverage as a function of magnitude.
cumulative68Check fraction of spectroscopic redshifts within the 68% photometric error.
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.errorz() # Produces a plot of photometric redshift errors versus redshift.
- pit_qq(pdfs=None, zgrid=None, ztrue=None, bins=None, title=None, show_pit=True, show_qq=True, savefig=False) str[source]
Generate a PIT and QQ quantile-quantile plot for photometric redshift PDFs.
This function creates a visualization to assess the calibration of predicted PDFs against true redshifts. It can display a Probability Integral Transform (PIT) histogram and/or a QQ plot, optionally saving the figure.
- Parameters:
pdfs (np.ndarray, shape (m, n), optional) – Array of PDFs for m objects over n z-grid points. If None, use the PDFs from the class Metrics object.
zgrid (np.ndarray, shape (n,), optional) – The z-axis corresponding to the PDF bins. Required if pdfs is provided.
ztrue (np.ndarray, shape (m,), optional) – True redshift values for the m objects. Required if pdfs is provided.
bins (int, optional) – Number of bins for the PIT histogram. If None, use the default number of quantiles defined in the sample (sample.n_quant).
title (str, optional) – Title for the plot. If None, a formatted sample name will be used.
show_pit (bool, default=True) – Whether to include the PIT histogram in the figure.
show_qq (bool, default=True) – Whether to include the QQ plot in the figure.
savefig (bool, default=False) – Whether to save the plot to a PNG file. If True, the filename will be automatically generated.
- Returns:
Path to the saved figure if savefig=True; otherwise an empty string.
- Return type:
str
Notes
PIT (Probability Integral Transform) values should be uniformly
distributed if the PDFs are well-calibrated. - QQ plot compares the quantiles of the PIT distribution against a uniform distribution to visually assess calibration.
- dist_mass(nstep=10)[source]
Plot the distribution of stellar mass
This diagnostic shows the range and frequency of stellar mass values derived by LePHARE for the sample.
- Parameters:
nstep (int, optional) – Number of bins to use in the histogram of mass values. Default is 10.
Notes
Uses the MASS_BEST and ‘MASS_MED’ column from the LePHARE output table.
Only sources meeting the redshift and magnitude selection criteria are included.
See also
dist_modelShow distribution of best-fit SED model identifiers.
dist_filtShow number of filters used in each fit.
dist_SFRSFR distribution
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.dist_mass(nstep=15) # Produces a histogram of MASS_BEST and MASS_MED values.
- dist_sfr(nstep=10)[source]
Plot the distribution of SFR
This diagnostic shows the range and frequency of SFR values derived by LePHARE for the sample.
- Parameters:
nstep (int, optional) – Number of bins to use in the histogram of mass values. Default is 10.
Notes
Uses the SFR_BEST and ‘SFR_MED’ column from the LePHARE output table.
Only sources meeting the redshift and magnitude selection criteria are included.
See also
dist_modelShow distribution of best-fit SED model identifiers.
dist_filtShow number of filters used in each fit.
dist_massMass distribution
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.dist_sfr(nstep=15) # Produces a histogram of SFR_BEST and SFR_MED values.
- dist_ssfr(nstep=10)[source]
Plot the distribution of specific SFR
This diagnostic shows the range and frequency of sSFR values derived by LePHARE for the sample.
- Parameters:
nstep (int, optional) – Number of bins to use in the histogram of mass values. Default is 10.
Notes
Uses the SSFR_BEST and ‘SSFR_MED’ column from the LePHARE output table.
Only sources meeting the redshift and magnitude selection criteria are included.
See also
dist_modelShow distribution of best-fit SED model identifiers.
dist_filtShow number of filters used in each fit.
dist_massMass distribution
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.dist_ssfr(nstep=15) # Produces a histogram of SSFR_BEST and SSFR_MED values.
- mass_med_best()[source]
Plot stellar mass median of the PDF versus minimum χ²
This diagnostic compares the two mass estimates produced by LePHARE: the median of the posterior probability distribution (MASS_MED) and the best-fit value from the minimum χ² solution (MASS_BEST). The comparison helps identify systematic biases between the two estimators and assess the stability of mass determinations.
The figure is divided into subpanels based on magnitude bins defined in range_mag. Each subpanel shows MASS_MED versus MASS_BEST with a 1:1 reference line and scatter indicating consistency between the two measures.
Notes
Only sources within the defined redshift and magnitude ranges are included.
The plot can reveal populations where the PDF and best-fit solutions diverge, such as multi-peaked PDFs or poor fits.
Strong deviations from the 1:1 line indicate inconsistency between the χ²-based and PDF-based estimates.
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.mass_med_best() # Produces a MASS_MED vs MASS_BEST comparison plot by magnitude bin.
- sfr_med_best()[source]
Plot SFR median of the PDF versus minimum χ²
This diagnostic compares the two mass estimates produced by LePHARE: the median of the posterior probability distribution (SFR_MED) and the best-fit value from the minimum χ² solution (SFR_BEST). The comparison helps identify systematic biases between the two estimators and assess the stability of mass determinations.
The figure is divided into subpanels based on magnitude bins defined in range_mag. Each subpanel shows SFR_MED versus SFR_BEST with a 1:1 reference line and scatter indicating consistency between the two measures.
Notes
Only sources within the defined redshift and magnitude ranges are included.
The plot can reveal populations where the PDF and best-fit solutions diverge, such as multi-peaked PDFs or poor fits.
Strong deviations from the 1:1 line indicate inconsistency between the χ²-based and PDF-based estimates.
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.sfr_med_best() # Produces a SFR_MED vs SFR_BEST comparison plot by magnitude bin.
- mass_z()[source]
Plot stellar mass versus redshift for the sample.
This diagnostic shows the relation between stellar masses and redshift, providing insight into mass evolution, selection effects, and completeness limits of the survey.
Notes
Uses the stellar mass
Only objects within the redshift and magnitude selection ranges are included.
The figure can be divided into subpanels based on magnitude or redshift bins.
Helps identify trends such as brightening or dimming with redshift and the distribution of galaxies in the mass-redshift plane.
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.mass_z() # Produces plots of mass versus redshift
- sfr_z()[source]
Plot SFR versus redshift for the sample.
This diagnostic shows the relation between SFR and redshift, providing insight into mass evolution, selection effects, and completeness limits of the survey.
Notes
Uses the SFR
Only objects within the redshift and magnitude selection ranges are included.
The figure can be divided into subpanels based on magnitude or redshift bins.
Helps identify trends such as brightening or dimming with redshift and the distribution of galaxies in the mass-redshift plane.
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.sfr_z() # Produces plots of mass versus redshift
- mass_sfr()[source]
Plot stellar mass versus SFR for the sample.
This diagnostic shows the main sequence
Notes
Uses the stellar mass and SFR
Only objects within the redshift and magnitude selection ranges are included.
The figure can be divided into subpanels based on magnitude or redshift bins.
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.mass_sfr() # Produces plots of mass versus SFR
- lnuv_sfr()[source]
Plot dust-corrected L(NUV) versus SFR for the sample.
Notes
Uses the Lnuv and SFR
Only objects within the redshift and magnitude selection ranges are included.
The figure can be divided into subpanels based on magnitude or redshift bins.
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.lnuv_sfr() # Produces plots of L(NUV) versus SFR
- masstolight_z()[source]
Plot mass-to-light ratio versus redshift for the sample.
This diagnostic shows the relation between mass-to-light ratio and redshift, providing insight into SED fitting
Notes
Uses the L(K) and massb
Only objects within the redshift and magnitude selection ranges are included.
The figure can be divided into subpanels based on magnitude or redshift bins.
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.masstolight_z() # Produces plots of mass-to-light versus redshift
- absmagk_mass()[source]
Plot M(Ks) versus mass for the sample.
Notes
Uses the M(Ks) and mass
Only objects within the redshift and magnitude selection ranges are included.
The figure can be divided into subpanels based on magnitude or redshift bins.
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.absmagk_mass() # Produces plots of M(K) versus mass
- absmagu_sfr()[source]
Plot M(U) versus SFR for the sample.
Notes
Uses the M(U) and SFR
Only objects within the redshift and magnitude selection ranges are included.
The figure can be divided into subpanels based on magnitude or redshift bins.
Examples
>>> utils = lp.PlotUtils(t, sel_filt=3) >>> utils.absmagu_sfr() # Produces plots of M(U) versus SFR