firecrown.generators.inferred_galaxy_zdist ========================================== .. py:module:: firecrown.generators.inferred_galaxy_zdist .. autoapi-nested-parse:: Generation of inferred galaxy redshift distributions. Attributes ---------- .. autoapisummary:: firecrown.generators.inferred_galaxy_zdist.BinsType firecrown.generators.inferred_galaxy_zdist.Y1_LENS_ALPHA firecrown.generators.inferred_galaxy_zdist.Y1_LENS_BETA firecrown.generators.inferred_galaxy_zdist.Y1_LENS_Z0 firecrown.generators.inferred_galaxy_zdist.Y1_SOURCE_ALPHA firecrown.generators.inferred_galaxy_zdist.Y1_SOURCE_BETA firecrown.generators.inferred_galaxy_zdist.Y1_SOURCE_Z0 firecrown.generators.inferred_galaxy_zdist.Y10_LENS_ALPHA firecrown.generators.inferred_galaxy_zdist.Y10_LENS_BETA firecrown.generators.inferred_galaxy_zdist.Y10_LENS_Z0 firecrown.generators.inferred_galaxy_zdist.Y10_SOURCE_ALPHA firecrown.generators.inferred_galaxy_zdist.Y10_SOURCE_BETA firecrown.generators.inferred_galaxy_zdist.Y10_SOURCE_Z0 firecrown.generators.inferred_galaxy_zdist.Grid1D firecrown.generators.inferred_galaxy_zdist.Y1_LENS_BINS firecrown.generators.inferred_galaxy_zdist.Y1_SOURCE_BINS firecrown.generators.inferred_galaxy_zdist.Y10_LENS_BINS firecrown.generators.inferred_galaxy_zdist.Y10_SOURCE_BINS firecrown.generators.inferred_galaxy_zdist.LSST_Y1_LENS_BIN_COLLECTION firecrown.generators.inferred_galaxy_zdist.LSST_Y1_SOURCE_BIN_COLLECTION firecrown.generators.inferred_galaxy_zdist.LSST_Y10_LENS_BIN_COLLECTION firecrown.generators.inferred_galaxy_zdist.LSST_Y10_SOURCE_BIN_COLLECTION Classes ------- .. autoapisummary:: firecrown.generators.inferred_galaxy_zdist.ZDistLSSTSRDOpt firecrown.generators.inferred_galaxy_zdist.ZDistLSSTSRD firecrown.generators.inferred_galaxy_zdist.LinearGrid1D firecrown.generators.inferred_galaxy_zdist.RawGrid1D firecrown.generators.inferred_galaxy_zdist.ZDistLSSTSRDBin firecrown.generators.inferred_galaxy_zdist.ZDistLSSTSRDBinCollection Functions --------- .. autoapisummary:: firecrown.generators.inferred_galaxy_zdist.get_y1_lens_bins firecrown.generators.inferred_galaxy_zdist.get_y1_source_bins firecrown.generators.inferred_galaxy_zdist.get_y10_lens_bins firecrown.generators.inferred_galaxy_zdist.get_y10_source_bins firecrown.generators.inferred_galaxy_zdist.get_lsst_y1_lens_bin_collection firecrown.generators.inferred_galaxy_zdist.get_lsst_y1_source_bin_collection firecrown.generators.inferred_galaxy_zdist.get_lsst_y10_lens_bin_collection firecrown.generators.inferred_galaxy_zdist.get_lsst_y10_source_bin_collection firecrown.generators.inferred_galaxy_zdist.__getattr__ Module Contents --------------- .. py:data:: BinsType .. py:data:: Y1_LENS_ALPHA :value: 0.94 .. py:data:: Y1_LENS_BETA :value: 2.0 .. py:data:: Y1_LENS_Z0 :value: 0.26 .. py:data:: Y1_SOURCE_ALPHA :value: 0.78 .. py:data:: Y1_SOURCE_BETA :value: 2.0 .. py:data:: Y1_SOURCE_Z0 :value: 0.13 .. py:data:: Y10_LENS_ALPHA :value: 0.9 .. py:data:: Y10_LENS_BETA :value: 2.0 .. py:data:: Y10_LENS_Z0 :value: 0.28 .. py:data:: Y10_SOURCE_ALPHA :value: 0.68 .. py:data:: Y10_SOURCE_BETA :value: 2.0 .. py:data:: Y10_SOURCE_Z0 :value: 0.11 .. py:class:: ZDistLSSTSRDOpt Bases: :py:obj:`TypedDict` .. autoapi-inheritance-diagram:: firecrown.generators.inferred_galaxy_zdist.ZDistLSSTSRDOpt :parts: 1 Optional parameters for the LSST Inferred galaxy redshift distribution. .. py:attribute:: max_z :type: float .. py:attribute:: use_autoknot :type: bool .. py:attribute:: autoknots_reltol :type: float .. py:attribute:: autoknots_abstol :type: float .. py:class:: ZDistLSSTSRD(alpha, beta, z0, max_z = 5.0, use_autoknot = False, autoknots_reltol = 0.0001, autoknots_abstol = 1e-15) 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 :math:`\beta = 2`. The values of :math:`\alpha` and :math:`z_0` are different for Year 1 and Year 10. `ZDistLLSTSRD` provides these values as defaults and allows for greater flexibility when desired. .. py:attribute:: alpha .. py:attribute:: beta .. py:attribute:: z0 .. py:attribute:: max_z :value: 5.0 .. py:attribute:: use_autoknot :value: False .. py:attribute:: autoknots_reltol :value: 0.0001 .. py:attribute:: autoknots_abstol :value: 1e-15 .. py:method:: year_1_lens(alpha = Y1_LENS_ALPHA, beta = Y1_LENS_BETA, z0 = Y1_LENS_Z0, **kwargs) :classmethod: 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. :param alpha: The alpha parameter of the distribution :param beta: The beta parameter of the distribution :param z0: The z0 parameter of the distribution :return: A ZDistLSSTSRD object. .. py:method:: year_1_source(alpha = Y1_SOURCE_ALPHA, beta = Y1_SOURCE_BETA, z0 = Y1_SOURCE_Z0, **kwargs) :classmethod: 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. :param alpha: The alpha parameter of the distribution :param beta: The beta parameter of the distribution :param z0: The z0 parameter of the distribution :return: A ZDistLSSTSRD object. .. py:method:: year_10_lens(alpha = Y10_LENS_ALPHA, beta = Y10_LENS_BETA, z0 = Y10_LENS_Z0, **kwargs) :classmethod: 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. :param alpha: The alpha parameter of the distribution :param beta: The beta parameter of the distribution :param z0: The z0 parameter of the distribution :return: A ZDistLSSTSRD object. .. py:method:: year_10_source(alpha = Y10_SOURCE_ALPHA, beta = Y10_SOURCE_BETA, z0 = Y10_SOURCE_Z0, **kwargs) :classmethod: 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. :param alpha: The alpha parameter of the distribution :param beta: The beta parameter of the distribution :param z0: The z0 parameter of the distribution :return: A ZDistLSSTSRD object. .. py:method:: distribution(z) Generate the inferred galaxy redshift distribution. :param z: The redshifts at which to evaluate the distribution :return: The inferred galaxy redshift distribution .. py:method:: distribution_zp(zp, sigma_z) Generate the Gaussian convolution of the distribution. :param sigma_z: The resolution parameter :param zp: The photometric redshift :return: The Gaussian distribution .. py:method:: compute_distribution(sigma_z) 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. :param sigma_z: The resolution parameter :return: The inferred galaxy redshift distribution .. py:method:: compute_true_distribution() Generate the inferred galaxy redshift distribution. Computes the distribution without the convolution with the Gaussian. That is, the true redshift distribution. :return: The inferred galaxy redshift distribution .. py:method:: equal_area_bins(n_bins, sigma_z, last_z, use_true_distribution = False) 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. :param n_bins: The number of bins :param sigma_z: The resolution parameter :param last_z: The last redshift to consider :param use_true_distribution: Whether to use the true distribution :return: The bin edges .. py:method:: binned_distribution(*, zpl, zpu, sigma_z, z, name, measurements) Generate the inferred galaxy redshift distribution in bins. :param zpl: The lower bound of the integration :param zpu: The upper bound of the integration :param sigma_z: The resolution parameter :param z: The redshifts at which to evaluate the distribution :param name: The name of the distribution :param measurements: The set of measurements of the distribution :return: The inferred galaxy redshift distribution .. py:class:: LinearGrid1D(/, **data) Bases: :py:obj:`pydantic.BaseModel` .. autoapi-inheritance-diagram:: firecrown.generators.inferred_galaxy_zdist.LinearGrid1D :parts: 1 A 1D linear grid. .. py:attribute:: model_config Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict]. .. py:attribute:: start :type: float .. py:attribute:: end :type: float .. py:attribute:: num :type: int .. py:method:: generate() Generate the 1D linear grid. .. py:class:: RawGrid1D(/, **data) Bases: :py:obj:`pydantic.BaseModel` .. autoapi-inheritance-diagram:: firecrown.generators.inferred_galaxy_zdist.RawGrid1D :parts: 1 A 1D grid. .. py:attribute:: model_config Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict]. .. py:attribute:: values :type: list[float] .. py:method:: generate() Generate the 1D grid. .. py:data:: Grid1D .. py:class:: ZDistLSSTSRDBin(/, **data) Bases: :py:obj:`pydantic.BaseModel` .. autoapi-inheritance-diagram:: firecrown.generators.inferred_galaxy_zdist.ZDistLSSTSRDBin :parts: 1 LSST Inferred galaxy redshift distributions in bins. .. py:attribute:: model_config Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict]. .. py:attribute:: zpl :type: float .. py:attribute:: zpu :type: float .. py:attribute:: sigma_z :type: float .. py:attribute:: z :type: Annotated[Grid1D, Field(union_mode='left_to_right')] .. py:attribute:: bin_name :type: str .. py:attribute:: measurements :type: Annotated[set[firecrown.metadata_functions.Measurement], BeforeValidator(make_measurements)] .. py:method:: serialize_measurements(value) :classmethod: Serialize the Measurement. .. py:method:: generate(zdist) Generate the inferred galaxy redshift distribution in bins. .. py:class:: ZDistLSSTSRDBinCollection(/, **data) Bases: :py:obj:`pydantic.BaseModel` .. autoapi-inheritance-diagram:: firecrown.generators.inferred_galaxy_zdist.ZDistLSSTSRDBinCollection :parts: 1 LSST Inferred galaxy redshift distributions in bins. .. py:attribute:: model_config Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict]. .. py:attribute:: alpha :type: float .. py:attribute:: beta :type: float .. py:attribute:: z0 :type: float .. py:attribute:: bins :type: list[ZDistLSSTSRDBin] .. py:attribute:: max_z :type: float :value: 5.0 .. py:attribute:: use_autoknot :type: bool :value: True .. py:attribute:: autoknots_reltol :type: float :value: 0.0001 .. py:attribute:: autoknots_abstol :type: float :value: 1e-15 .. py:method:: generate() Generate the inferred galaxy redshift distributions in bins. .. py:function:: get_y1_lens_bins() Get the Year 1 lens bins. .. py:function:: get_y1_source_bins() Get the Year 1 source bins. .. py:function:: get_y10_lens_bins() Get the Year 10 lens bins. .. py:function:: get_y10_source_bins() Get the Year 10 source bins. .. py:function:: get_lsst_y1_lens_bin_collection() Get the LSST Year 1 lens bin collection. .. py:function:: get_lsst_y1_source_bin_collection() Get the LSST Year 1 source bin collection. .. py:function:: get_lsst_y10_lens_bin_collection() Get the LSST Year 10 lens bin collection. .. py:function:: get_lsst_y10_source_bin_collection() Get the LSST Year 10 source bin collection. .. py:function:: __getattr__(name) Lazy evaluation of the bins. .. py:data:: Y1_LENS_BINS :type: BinsType .. py:data:: Y1_SOURCE_BINS :type: BinsType .. py:data:: Y10_LENS_BINS :type: BinsType .. py:data:: Y10_SOURCE_BINS :type: BinsType .. py:data:: LSST_Y1_LENS_BIN_COLLECTION :type: ZDistLSSTSRDBinCollection .. py:data:: LSST_Y1_SOURCE_BIN_COLLECTION :type: ZDistLSSTSRDBinCollection .. py:data:: LSST_Y10_LENS_BIN_COLLECTION :type: ZDistLSSTSRDBinCollection .. py:data:: LSST_Y10_SOURCE_BIN_COLLECTION :type: ZDistLSSTSRDBinCollection