firecrown.generators.two_point ============================== .. py:module:: firecrown.generators.two_point .. autoapi-nested-parse:: Generator support for TwoPoint statistics. Classes ------- .. autoapisummary:: firecrown.generators.two_point.LogLinearElls firecrown.generators.two_point.EllOrThetaConfig Functions --------- .. autoapisummary:: firecrown.generators.two_point.generate_bin_centers firecrown.generators.two_point.generate_ells_cells firecrown.generators.two_point.generate_reals Module Contents --------------- .. py:class:: LogLinearElls(/, **data) Bases: :py:obj:`pydantic.BaseModel` .. autoapi-inheritance-diagram:: firecrown.generators.two_point.LogLinearElls :parts: 1 Generator for log-linear integral ell values. The initializer for LogLinearElls accepts only named parameters. A default value is provided for each parameter, which default is used if the parameter is not provided to the initializer. Not all ell values will be generated. The result will contain each integral value from min to mid. Starting from mid, and going up to max, there will be n_log logarithmically spaced values. Note that midpoint must be strictly greater than minimum, and strictly less than maximum. n_log must be positive. All must be integers. All these conditions are verified in the initializer. LogLinearElls objects are immutable, so they are safe to share and to use as default values for parameters. .. py:attribute:: model_config Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict]. .. py:attribute:: minimum :type: Annotated[int, Field(ge=0)] :value: 2 .. py:attribute:: midpoint :type: Annotated[int, Field(ge=0)] :value: 50 .. py:attribute:: maximum :type: Annotated[int, Field(ge=0)] :value: 60000 .. py:attribute:: n_log :type: Annotated[int, Field(ge=1)] :value: 200 .. py:method:: require_increasing() Validate the ell values. .. py:method:: generate(min_ell = None, max_ell = None) Generate the log-linear ell values. This will use the object's minimum, midpoint, maximum, and n_log, unless min_ell and max_ell are provided, in which case those will be used. :param min_ell: The low edge of the first bin. :param max_ell: The high edge of the last bin. :return: The ell values. .. py:function:: generate_bin_centers(*, minimum, maximum, n, binning = 'log') Return the centers of bins that span the range from minimum to maximum. If binning is 'log', this will generate logarithmically spaced bins; if binning is 'lin', this will generate linearly spaced bins. :param minimum: The low edge of the first bin. :param maximum: The high edge of the last bin. :param n: The number of bins. :param binning: Either 'log' or 'lin'. :return: The centers of the bins. .. py:class:: EllOrThetaConfig Bases: :py:obj:`TypedDict` .. autoapi-inheritance-diagram:: firecrown.generators.two_point.EllOrThetaConfig :parts: 1 A dictionary of options for generating the ell or theta. This dictionary contains the minimum, maximum and number of bins to generate the ell or theta values at which to compute the statistics. :param minimum: The start of the binning. :param maximum: The end of the binning. :param n: The number of bins. :param binning: Pass 'log' to get logarithmic spaced bins and 'lin' to get linearly spaced bins. Default is 'log'. .. py:attribute:: minimum :type: float .. py:attribute:: maximum :type: float .. py:attribute:: n :type: int .. py:attribute:: binning :type: str .. py:function:: generate_ells_cells(ell_config) Generate ells or theta values from the configuration dictionary. :param ell_config: the configuration parameters. :return: ells and Cells .. py:function:: generate_reals(theta_config) Generate theta and xi values from the configuration dictionary. :param ell_config: the configuration parameters. :return: ells and Cells