xlens.catalog.redshift
Attributes
Classes
Helper class that provides a standard way to create an ABC using |
|
Wraps a FlexZBoost-like predictor object with a uniform get_z API. |
|
Wraps BPZ template/prior configuration with a uniform get_z API. |
Functions
|
|
Compute point estimates from PDF samples on a redshift grid. |
|
|
|
|
Load BPZ template fluxes on Z_GRIDS for provided filter set. |
Module Contents
- get_point_estimates_from_pdfs(pdfs: numpy.ndarray)[source]
Compute point estimates from PDF samples on a redshift grid.
- Returns dict of arrays (shape (N,)):
zmode : z_grid[argmax p(z)]
z025, z160, z500, z840, z975 : CDF percentiles at [0.025, 0.16, 0.50, 0.84, 0.975]
zbest : argmin_zx ∫ p_norm(z) * loss(zx,z) dz (bounded to [z_grid[0], z_grid[-1]])
- get_color(src: numpy.ndarray, *, bands: str = 'grizy', ref_band: str = 'i', mag_zero: float = 30.0, comp: int = 1, dg: float = 0.0, flux_name: str = 'gauss2', include_mag_err: bool = False, extinction: numpy.ndarray | None = None) numpy.ndarray[source]
- Returns:
- If include_mag_err=False: shape (N, 1 + (len(bands)-1))
[ref_mag, (b0-b1), (b1-b2), …]
- If include_mag_err=True: shape (N, 1 + 2*(len(bands)-1))
[ref_mag, (b0-b1), err01, (b1-b2), err12, …]
- Return type:
np.ndarray
- class zEstimator[source]
Bases:
abc.ABCHelper class that provides a standard way to create an ABC using inheritance.
- abstract get_z(src: numpy.ndarray, *, mag_zero: float = 30.0, flux_name: str = 'gauss2', bands: str = 'grizy', ref_band: str = 'i', comp: int = 1, dg: float = 0.0, flux_name2: str | None = None, flux_name3: str | None = None, extinction: numpy.ndarray | None = None, **kwargs) dict[source]
Method to get redshift point estimates
- get_zsel(src: numpy.ndarray, *, mag_zero: float = 30.0, flux_name: str = 'gauss2', bands: str = 'grizy', ref_band: str = 'i', comp: int = 1, dg: float = 0.0, z_point_name: str = 'zmode', flux_name2: str | None = None, flux_name3: str | None = None, extinction: numpy.ndarray | None = None, **kwargs)[source]
- class flexzboostEstimator(pz_obj)[source]
Bases:
zEstimatorWraps a FlexZBoost-like predictor object with a uniform get_z API.
- get_z(src: numpy.ndarray, *, mag_zero: float = 30.0, flux_name: str = 'gauss2', bands: str = 'grizy', ref_band: str = 'i', comp: int = 1, dg: float = 0.0, flux_name2: str | None = None, flux_name3: str | None = None, include_mag_err: bool = False, return_pdfs: bool = False, extinction: numpy.ndarray | None = None, **kwargs) dict[source]
Method to get redshift point estimates
- load_bpz_templates(data_path: str, bands: str, filter_name: str = 'DC2LSST', spectra_name: str = 'cosmossedswdust136.list')[source]
Load BPZ template fluxes on Z_GRIDS for provided filter set.
- class bpzEstimator(flux_templates: numpy.ndarray, prior_dict: dict, zp_errors)[source]
Bases:
zEstimatorWraps BPZ template/prior configuration with a uniform get_z API.