firecrown.generators.inferred_galaxy_zdist

Generation of inferred galaxy redshift distributions.

Attributes

BinsType

Y1_LENS_ALPHA

Y1_LENS_BETA

Y1_LENS_Z0

Y1_SOURCE_ALPHA

Y1_SOURCE_BETA

Y1_SOURCE_Z0

Y10_LENS_ALPHA

Y10_LENS_BETA

Y10_LENS_Z0

Y10_SOURCE_ALPHA

Y10_SOURCE_BETA

Y10_SOURCE_Z0

Grid1D

Y1_LENS_BINS

Y1_SOURCE_BINS

Y10_LENS_BINS

Y10_SOURCE_BINS

LSST_Y1_LENS_BIN_COLLECTION

LSST_Y1_SOURCE_BIN_COLLECTION

LSST_Y10_LENS_BIN_COLLECTION

LSST_Y10_SOURCE_BIN_COLLECTION

Classes

ZDistLSSTSRDOpt

Optional parameters for the LSST Inferred galaxy redshift distribution.

ZDistLSSTSRD

LSST Inferred galaxy redshift distributions.

LinearGrid1D

A 1D linear grid.

RawGrid1D

A 1D grid.

ZDistLSSTSRDBin

LSST Inferred galaxy redshift distributions in bins.

ZDistLSSTSRDBinCollection

LSST Inferred galaxy redshift distributions in bins.

Functions

get_y1_lens_bins()

Get the Year 1 lens bins.

get_y1_source_bins()

Get the Year 1 source bins.

get_y10_lens_bins()

Get the Year 10 lens bins.

get_y10_source_bins()

Get the Year 10 source bins.

get_lsst_y1_lens_bin_collection()

Get the LSST Year 1 lens bin collection.

get_lsst_y1_source_bin_collection()

Get the LSST Year 1 source bin collection.

get_lsst_y10_lens_bin_collection()

Get the LSST Year 10 lens bin collection.

get_lsst_y10_source_bin_collection()

Get the LSST Year 10 source bin collection.

__getattr__(name)

Lazy evaluation of the bins.

Module Contents

firecrown.generators.inferred_galaxy_zdist.BinsType
firecrown.generators.inferred_galaxy_zdist.Y1_LENS_ALPHA = 0.94
firecrown.generators.inferred_galaxy_zdist.Y1_LENS_BETA = 2.0
firecrown.generators.inferred_galaxy_zdist.Y1_LENS_Z0 = 0.26
firecrown.generators.inferred_galaxy_zdist.Y1_SOURCE_ALPHA = 0.78
firecrown.generators.inferred_galaxy_zdist.Y1_SOURCE_BETA = 2.0
firecrown.generators.inferred_galaxy_zdist.Y1_SOURCE_Z0 = 0.13
firecrown.generators.inferred_galaxy_zdist.Y10_LENS_ALPHA = 0.9
firecrown.generators.inferred_galaxy_zdist.Y10_LENS_BETA = 2.0
firecrown.generators.inferred_galaxy_zdist.Y10_LENS_Z0 = 0.28
firecrown.generators.inferred_galaxy_zdist.Y10_SOURCE_ALPHA = 0.68
firecrown.generators.inferred_galaxy_zdist.Y10_SOURCE_BETA = 2.0
firecrown.generators.inferred_galaxy_zdist.Y10_SOURCE_Z0 = 0.11
class firecrown.generators.inferred_galaxy_zdist.ZDistLSSTSRDOpt[source]

Bases: TypedDict

Inheritance diagram of firecrown.generators.inferred_galaxy_zdist.ZDistLSSTSRDOpt

Optional parameters for the LSST Inferred galaxy redshift distribution.

max_z: float
use_autoknot: bool
autoknots_reltol: float
autoknots_abstol: float
class firecrown.generators.inferred_galaxy_zdist.ZDistLSSTSRD(alpha, beta, z0, max_z=5.0, use_autoknot=False, autoknots_reltol=0.0001, autoknots_abstol=1e-15)[source]

LSST Inferred galaxy redshift distributions.

Inferred galaxy redshift distribution is based on the LSST Science Requirements Document (SRD), equation 5. Note that the SRD fixes \(\beta = 2\).

The values of \(\alpha\) and \(z_0\) are different for Year 1 and Year 10. ZDistLLSTSRD provides these values as defaults and allows for greater flexibility when desired.

Parameters:
  • alpha (float)

  • beta (float)

  • z0 (float)

  • max_z (float)

  • use_autoknot (bool)

  • autoknots_reltol (float)

  • autoknots_abstol (float)

alpha
beta
z0
max_z = 5.0
use_autoknot = False
autoknots_reltol = 0.0001
autoknots_abstol = 1e-15
classmethod year_1_lens(alpha=Y1_LENS_ALPHA, beta=Y1_LENS_BETA, z0=Y1_LENS_Z0, **kwargs)[source]

Create a ZDistLSSTSRD object for the first year of LSST.

It uses the default values of the alpha, beta and z0 parameters from the LSST SRD Year 1 for the lens distribution.

Parameters:
  • alpha (float) – The alpha parameter of the distribution

  • beta (float) – The beta parameter of the distribution

  • z0 (float) – The z0 parameter of the distribution

  • kwargs (Unpack[ZDistLSSTSRDOpt])

Returns:

A ZDistLSSTSRD object.

Return type:

ZDistLSSTSRD

classmethod year_1_source(alpha=Y1_SOURCE_ALPHA, beta=Y1_SOURCE_BETA, z0=Y1_SOURCE_Z0, **kwargs)[source]

Create a ZDistLSSTSRD object for the first year of LSST.

It uses the default values of the alpha, beta and z0 parameters from the LSST SRD Year 1 for the source distribution.

Parameters:
  • alpha (float) – The alpha parameter of the distribution

  • beta (float) – The beta parameter of the distribution

  • z0 (float) – The z0 parameter of the distribution

  • kwargs (Unpack[ZDistLSSTSRDOpt])

Returns:

A ZDistLSSTSRD object.

Return type:

ZDistLSSTSRD

classmethod year_10_lens(alpha=Y10_LENS_ALPHA, beta=Y10_LENS_BETA, z0=Y10_LENS_Z0, **kwargs)[source]

Create a ZDistLSSTSRD object for the tenth year of LSST.

It uses the default values of the alpha, beta and z0 parameters from the LSST SRD Year 10 for the lens distribution.

Parameters:
  • alpha (float) – The alpha parameter of the distribution

  • beta (float) – The beta parameter of the distribution

  • z0 (float) – The z0 parameter of the distribution

  • kwargs (Unpack[ZDistLSSTSRDOpt])

Returns:

A ZDistLSSTSRD object.

Return type:

ZDistLSSTSRD

classmethod year_10_source(alpha=Y10_SOURCE_ALPHA, beta=Y10_SOURCE_BETA, z0=Y10_SOURCE_Z0, **kwargs)[source]

Create a ZDistLSSTSRD object for the tenth year of LSST.

It uses the default values of the alpha, beta and z0 parameters from the LSST SRD Year 10 for the source distribution.

Parameters:
  • alpha (float) – The alpha parameter of the distribution

  • beta (float) – The beta parameter of the distribution

  • z0 (float) – The z0 parameter of the distribution

  • kwargs (Unpack[ZDistLSSTSRDOpt])

Returns:

A ZDistLSSTSRD object.

Return type:

ZDistLSSTSRD

distribution(z)[source]

Generate the inferred galaxy redshift distribution.

Parameters:

z (numpy.typing.NDArray) – The redshifts at which to evaluate the distribution

Returns:

The inferred galaxy redshift distribution

Return type:

numpy.typing.NDArray

distribution_zp(zp, sigma_z)[source]

Generate the Gaussian convolution of the distribution.

Parameters:
  • sigma_z (float) – The resolution parameter

  • zp (float) – The photometric redshift

Returns:

The Gaussian distribution

Return type:

float

compute_distribution(sigma_z)[source]

Generate the inferred galaxy redshift distribution.

Computes the distribution by convolving the true distribution with a Gaussian. The convolution is computed using the AutoKnots algorithm of NumCosmo.

Parameters:

sigma_z (float) – The resolution parameter

Returns:

The inferred galaxy redshift distribution

Return type:

numcosmo_py.Ncm.StatsDist1d

compute_true_distribution()[source]

Generate the inferred galaxy redshift distribution.

Computes the distribution without the convolution with the Gaussian. That is, the true redshift distribution.

Returns:

The inferred galaxy redshift distribution

Return type:

numcosmo_py.Ncm.StatsDist1d

equal_area_bins(n_bins, sigma_z, last_z, use_true_distribution=False)[source]

Generate equal area bins for the distribution.

In order to compute the bin edges, the convolution of the distribution with a Gaussian is computed. The bin edges are then computed by inverting the cumulative distribution function of the convolution.

If the true distribution is used, the convolution is not computed. This provides a faster way to compute the bin edges.

Parameters:
  • n_bins (int) – The number of bins

  • sigma_z (float) – The resolution parameter

  • last_z (float) – The last redshift to consider

  • use_true_distribution (bool) – Whether to use the true distribution

Returns:

The bin edges

Return type:

numpy.typing.NDArray

binned_distribution(*, zpl, zpu, sigma_z, z, name, measurements)[source]

Generate the inferred galaxy redshift distribution in bins.

Parameters:
  • zpl (float) – The lower bound of the integration

  • zpu (float) – The upper bound of the integration

  • sigma_z (float) – The resolution parameter

  • z (numpy.typing.NDArray) – The redshifts at which to evaluate the distribution

  • name (str) – The name of the distribution

  • measurements (set[firecrown.metadata_functions.Measurement]) – The set of measurements of the distribution

Returns:

The inferred galaxy redshift distribution

Return type:

firecrown.metadata_types.InferredGalaxyZDist

class firecrown.generators.inferred_galaxy_zdist.LinearGrid1D(/, **data)[source]

Bases: pydantic.BaseModel

Inheritance diagram of firecrown.generators.inferred_galaxy_zdist.LinearGrid1D

A 1D linear grid.

Parameters:

data (Any)

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

start: float
end: float
num: int
generate()[source]

Generate the 1D linear grid.

Return type:

numpy.typing.NDArray

class firecrown.generators.inferred_galaxy_zdist.RawGrid1D(/, **data)[source]

Bases: pydantic.BaseModel

Inheritance diagram of firecrown.generators.inferred_galaxy_zdist.RawGrid1D

A 1D grid.

Parameters:

data (Any)

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

values: list[float]
generate()[source]

Generate the 1D grid.

Return type:

numpy.typing.NDArray

firecrown.generators.inferred_galaxy_zdist.Grid1D
class firecrown.generators.inferred_galaxy_zdist.ZDistLSSTSRDBin(/, **data)[source]

Bases: pydantic.BaseModel

Inheritance diagram of firecrown.generators.inferred_galaxy_zdist.ZDistLSSTSRDBin

LSST Inferred galaxy redshift distributions in bins.

Parameters:

data (Any)

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

zpl: float
zpu: float
sigma_z: float
z: Annotated[Grid1D, Field(union_mode='left_to_right')]
bin_name: str
measurements: Annotated[set[firecrown.metadata_functions.Measurement], BeforeValidator(make_measurements)]
classmethod serialize_measurements(value)[source]

Serialize the Measurement.

Parameters:

value (set[firecrown.metadata_functions.Measurement])

Return type:

list[dict]

generate(zdist)[source]

Generate the inferred galaxy redshift distribution in bins.

Parameters:

zdist (ZDistLSSTSRD)

Return type:

firecrown.metadata_types.InferredGalaxyZDist

class firecrown.generators.inferred_galaxy_zdist.ZDistLSSTSRDBinCollection(/, **data)[source]

Bases: pydantic.BaseModel

Inheritance diagram of firecrown.generators.inferred_galaxy_zdist.ZDistLSSTSRDBinCollection

LSST Inferred galaxy redshift distributions in bins.

Parameters:

data (Any)

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

alpha: float
beta: float
z0: float
bins: list[ZDistLSSTSRDBin]
max_z: float = 5.0
use_autoknot: bool = True
autoknots_reltol: float = 0.0001
autoknots_abstol: float = 1e-15
generate()[source]

Generate the inferred galaxy redshift distributions in bins.

Return type:

list[firecrown.metadata_types.InferredGalaxyZDist]

firecrown.generators.inferred_galaxy_zdist.get_y1_lens_bins()[source]

Get the Year 1 lens bins.

Return type:

BinsType

firecrown.generators.inferred_galaxy_zdist.get_y1_source_bins()[source]

Get the Year 1 source bins.

Return type:

BinsType

firecrown.generators.inferred_galaxy_zdist.get_y10_lens_bins()[source]

Get the Year 10 lens bins.

Return type:

BinsType

firecrown.generators.inferred_galaxy_zdist.get_y10_source_bins()[source]

Get the Year 10 source bins.

Return type:

BinsType

firecrown.generators.inferred_galaxy_zdist.get_lsst_y1_lens_bin_collection()[source]

Get the LSST Year 1 lens bin collection.

Return type:

ZDistLSSTSRDBinCollection

firecrown.generators.inferred_galaxy_zdist.get_lsst_y1_source_bin_collection()[source]

Get the LSST Year 1 source bin collection.

Return type:

ZDistLSSTSRDBinCollection

firecrown.generators.inferred_galaxy_zdist.get_lsst_y10_lens_bin_collection()[source]

Get the LSST Year 10 lens bin collection.

Return type:

ZDistLSSTSRDBinCollection

firecrown.generators.inferred_galaxy_zdist.get_lsst_y10_source_bin_collection()[source]

Get the LSST Year 10 source bin collection.

Return type:

ZDistLSSTSRDBinCollection

firecrown.generators.inferred_galaxy_zdist.__getattr__(name)[source]

Lazy evaluation of the bins.

Parameters:

name (str)

Return type:

Any

firecrown.generators.inferred_galaxy_zdist.Y1_LENS_BINS: BinsType
firecrown.generators.inferred_galaxy_zdist.Y1_SOURCE_BINS: BinsType
firecrown.generators.inferred_galaxy_zdist.Y10_LENS_BINS: BinsType
firecrown.generators.inferred_galaxy_zdist.Y10_SOURCE_BINS: BinsType
firecrown.generators.inferred_galaxy_zdist.LSST_Y1_LENS_BIN_COLLECTION: ZDistLSSTSRDBinCollection
firecrown.generators.inferred_galaxy_zdist.LSST_Y1_SOURCE_BIN_COLLECTION: ZDistLSSTSRDBinCollection
firecrown.generators.inferred_galaxy_zdist.LSST_Y10_LENS_BIN_COLLECTION: ZDistLSSTSRDBinCollection
firecrown.generators.inferred_galaxy_zdist.LSST_Y10_SOURCE_BIN_COLLECTION: ZDistLSSTSRDBinCollection