firecrown.models.two_point ========================== .. py:module:: firecrown.models.two_point .. autoapi-nested-parse:: TwoPoint theory support. Classes ------- .. autoapisummary:: firecrown.models.two_point.ApplyInterpolationWhen firecrown.models.two_point.TwoPointTheory Functions --------- .. autoapisummary:: firecrown.models.two_point.at_least_one_tracer_has_hm firecrown.models.two_point.at_least_one_tracer_has_pt firecrown.models.two_point.calculate_pk firecrown.models.two_point.determine_ccl_kind Package Contents ---------------- .. py:class:: ApplyInterpolationWhen Bases: :py:obj:`enum.Flag` .. autoapi-inheritance-diagram:: firecrown.models.two_point.ApplyInterpolationWhen :parts: 1 Flags controlling when to apply interpolation of multipole moments. These flags specify the contexts in which interpolation should be used instead of computing all multipoles exactly. When `NONE` is set, all multipoles are computed directly. When any flag is set, only the multipoles defined in `LogLinearElls()` are computed exactly; the others will be interpolated. Note: For real-space correlation functions xi(theta), interpolation is handled internally by CCL and does not depend on these flags. .. py:attribute:: NONE :value: 0 .. py:attribute:: REAL .. py:attribute:: HARMONIC .. py:attribute:: HARMONIC_WINDOW .. py:attribute:: DEFAULT .. py:attribute:: ALL .. py:method:: __get_pydantic_core_schema__(_source_type, _handler) :classmethod: Custom schema for Pydantic to support Flag (de)serialization from string. .. py:function:: at_least_one_tracer_has_hm(tools, tracer0, tracer1) Compute a power spectrum with the halo model. :param tools: The modeling tools to use. :param tracer0: The first tracer to use. :param tracer1: The second tracer to use. :return: The power spectrum. .. py:function:: at_least_one_tracer_has_pt(tools, tracer0, tracer1) Compute the power spectrum with the perturbation theory. If one of the tracers does not have a perturbation theory (PT) tracer, a dummy matter PT tracer is created for it. This is useful for doing cross-correlations between a PT tracer and a non-PT tracer. :param tools: The modeling tools to use. :param tracer0: The first tracer to use. :param tracer1: The second tracer to use. :return: The power spectrum. .. py:function:: calculate_pk(pk_name, tools, tracer0, tracer1) Return the power spectrum named by pk_name. If the modeling tools already has the power spectrum, it is returned. If not, is is computed with the help of the modeling tools. :param pk_name: The name of the power spectrum to return. :param tools: The modeling tools to use. :param tracer0: The first tracer to use. :param tracer1: The second tracer to use. :return: The power spectrum. .. py:function:: determine_ccl_kind(sacc_data_type) Determine the CCL kind for this SACC data type. :param sacc_data_type: the name of the SACC data type :return: the CCL kind .. py:class:: TwoPointTheory(*, sacc_data_type, sources, interp_ells_gen = LogLinearElls(), ell_or_theta = None, tracers = None, int_options = None, apply_interp = ApplyInterpolationWhen.DEFAULT) Bases: :py:obj:`firecrown.updatable.Updatable` .. autoapi-inheritance-diagram:: firecrown.models.two_point.TwoPointTheory :parts: 1 Making predictions for TwoPoint statistics. .. py:attribute:: sacc_data_type .. py:attribute:: ccl_kind :value: 'cl' .. py:attribute:: sources .. py:attribute:: interp_ells_gen .. py:attribute:: ell_or_theta_config :type: None | firecrown.generators.two_point.EllOrThetaConfig :value: None .. py:attribute:: window :type: None | numpy.typing.NDArray[numpy.float64] :value: None .. py:attribute:: sacc_tracers :value: None .. py:attribute:: ells :type: None | numpy.typing.NDArray[numpy.int64] :value: None .. py:attribute:: thetas :type: None | numpy.typing.NDArray[numpy.float64] :value: None .. py:attribute:: mean_ells :type: None | numpy.typing.NDArray[numpy.float64] :value: None .. py:attribute:: cells :type: dict[firecrown.metadata_types.TracerNames, numpy.typing.NDArray[numpy.float64]] .. py:attribute:: ells_for_xi :type: numpy.typing.NDArray[numpy.int64] .. py:attribute:: int_options :value: None .. py:attribute:: apply_interp .. py:property:: source0 :type: firecrown.likelihood.source.Source Return the first source. .. py:property:: source1 :type: firecrown.likelihood.source.Source Return the second source. .. py:method:: initialize_sources(sacc_data) Initialize this TwoPointTheory's sources and tracer names. :param sacc_data: The data in the from which we read the data. :return: The tracer names. .. py:method:: get_tracers_and_scales(tools) Get tracers and scales for both sources. :param tools: The modeling tools to use. :result: The tracers and scales for both sources. .. py:method:: generate_ells_for_interpolation() Generate ells for interpolation.