firecrown.generators.two_point ============================== .. py:module:: firecrown.generators.two_point .. autoapi-nested-parse:: Generator support for TwoPoint statistics. Attributes ---------- .. autoapisummary:: firecrown.generators.two_point.ELL_FOR_XI_DEFAULTS Classes ------- .. autoapisummary:: firecrown.generators.two_point.LogLinearElls firecrown.generators.two_point.EllOrThetaConfig Functions --------- .. autoapisummary:: firecrown.generators.two_point.log_linear_ells firecrown.generators.two_point.generate_bin_centers firecrown.generators.two_point.calculate_ells_for_interpolation firecrown.generators.two_point.generate_ells_cells firecrown.generators.two_point.generate_reals firecrown.generators.two_point.apply_ells_min_max firecrown.generators.two_point.apply_theta_min_max Module Contents --------------- .. py:data:: ELL_FOR_XI_DEFAULTS .. 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. 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. .. py:attribute:: minimum :type: Annotated[int, Field(ge=0)] .. py:attribute:: midpoint :type: Annotated[int, Field(ge=0)] .. py:attribute:: maximum :type: Annotated[int, Field(ge=0)] .. py:attribute:: n_log :type: Annotated[int, Field(ge=1)] .. py:method:: require_increasing() Validate the ell values. .. py:method:: generate() Generate the log-linear ell values. 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. :param minimum: The low edge of the first bin. :param midpoint: The high edge of the last in the linear range. :param maximum: The high edge of the last bin. :param n_log: The number of bins in the log section of the range. .. py:function:: log_linear_ells(*, minimum, midpoint, maximum, n_log) Create an array of ells to sample the power spectrum. This is used for for real-space predictions. 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. All values are rounded to the nearest integer. :param minimum: The low edge of the first bin. :param midpoint: The high edge of the last in the linear range. :param maximum: The high edge of the last bin. :param n_log: The number of bins in the log section of the range. .. 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:function:: calculate_ells_for_interpolation(min_ell, max_ell) See log_linear_ells. This method mixes together: 1. the default parameters in ELL_FOR_XI_DEFAULTS 2. the first and last values in w. and then calls log_linear_ells with those arguments, returning whatever it returns. .. 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 .. py:function:: apply_ells_min_max(ells, Cells, indices, ell_min, ell_max) Apply the minimum and maximum ell values to the ells and Cells. .. py:function:: apply_theta_min_max(thetas, xis, indices, theta_min, theta_max) Apply the minimum and maximum theta values to the thetas and xis.