yaw.core.cosmology.BinFactory#

class yaw.core.cosmology.BinFactory(zmin: float, zmax: float, nbins: int, cosmology: FLRW | CustomCosmology | None = None)[source]#

Bases: object

Class used to generate redshift bins.

Create a new bin generator.

Parameters:
  • zmin (float) – Minimum redshift, lowest redshift bin edges.

  • zmax (float) – Maximum redshift, lowest redshift bin edges.

  • nbins (int) – Number of bins to generate.

  • cosmology (astropy.cosmology.FLRW, CustomCosmology) – Cosmological model used for calculations.

Methods

__init__(zmin, zmax, nbins[, cosmology])

Create a new bin generator.

check(zbins)

Check if a list of bin edges in monotonicaly increasing.

comoving()

Generate a binning with equal width in radial comoving distance.

get(method)

Call one of the generation methods based on its name.

linear()

Generate a binning with equal width in redshift.

logspace()

Generate a binning with equal width in logarithmic redshift \(\log(1+z)\).

static check(zbins: NDArray[np.float64]) None[source]#

Check if a list of bin edges in monotonicaly increasing.

Raises a ValueError if the condition is not met.

Parameters:

zbins (NDArray) – Redshift bin edges to check.

comoving() NDArray[np.float64][source]#

Generate a binning with equal width in radial comoving distance.

get(method: str) NDArray[np.float64][source]#

Call one of the generation methods based on its name.

Parameters:

method (str) – Name of the generation method.

linear() NDArray[np.float64][source]#

Generate a binning with equal width in redshift.

logspace() NDArray[np.float64][source]#

Generate a binning with equal width in logarithmic redshift \(\log(1+z)\).