firecrown.connector.cosmosis.likelihood ======================================= .. py:module:: firecrown.connector.cosmosis.likelihood .. autoapi-nested-parse:: CosmoSIS Likelihood Connector. This module provides the class FirecrownLikelihood, and the hook functions for this module to be a CosmoSIS likelihood module. Note that the class FirecrownLikelihood does *not* inherit from firecrown's likelihood abstract base class; it the implementation of a CosmoSIS module, not a specific likelihood. Classes ------- .. autoapisummary:: firecrown.connector.cosmosis.likelihood.FirecrownLikelihood Functions --------- .. autoapisummary:: firecrown.connector.cosmosis.likelihood.extract_section firecrown.connector.cosmosis.likelihood.calculate_firecrown_params firecrown.connector.cosmosis.likelihood.form_error_message firecrown.connector.cosmosis.likelihood.setup firecrown.connector.cosmosis.likelihood.execute firecrown.connector.cosmosis.likelihood.cleanup Module Contents --------------- .. py:function:: extract_section(sample, section) Extract all the parameters from the name datablock section into a dictionary. :param sample: the CosmoSiS datablock to query :param section: the name of the section desired :return: a dictionary of the parameters in the section .. py:class:: FirecrownLikelihood(config) CosmoSIS likelihood module for calculating a Firecrown likelihood. In this simplest implementation, we have only a single module. This module is responsible for calling CCL to perform theory calculations, based on the output of CAMB, and also for calculating the data likelihood based on this theory. .. py:attribute:: firecrown_module_name :value: 'module_options' .. py:attribute:: sampling_sections :type: list[str] .. py:attribute:: likelihood :type: firecrown.likelihood.likelihood.Likelihood .. py:attribute:: map .. py:method:: execute(sample) This is the method called for each sample generated by the sampler. :param sample: the sample generated by the sampler :return: 0 .. py:method:: special_gauss_family_handling(sample) Special handling for the GaussFamily likelihood. We need to save concatenated data vector and inverse covariance to enable support for the CosmoSIS Fisher sampler. This can only work for likelihoods that have these quantities. Currently, this is only GaussFamily. :param sample: the sample generated by the sampler :return: None .. py:method:: handle_twopoint_statistic(sample, stat) Handle the TwoPoint statistic for the GaussFamily likelihood. This puts the theory and data vectors in the data block. :param sample: the sample generated by the sampler :param stat: a TwoPoint statistic .. py:method:: update_likelihood_and_tools(firecrown_params) Update the likelihood and tools with the new parameters. :param firecrown_params: the new parameters :return: None .. py:function:: calculate_firecrown_params(sampling_sections, firecrown_module_name, sample) Calculate the ParamsMap for this sample. :param sample: the sample generated by the sampler :return: a ParamsMap with the firecrown parameters .. py:function:: form_error_message(sampling_sections, exc) Form the error message that will be used to report a missing parameter. This error message will also include when that parameter should have been supplied by the sampler. :param exc: the missing parameter error :return: the error message .. py:function:: setup(config) Setup hook for a CosmoSIS module. The returned object will be passed to the CosmoSIS execute hook. :param config: the datablock the configuration :return: an instance of class FirecrownLikelihood .. py:function:: execute(sample, instance) Execute hook for a CosmoSIS module. Return 0 on success. The parameter `sample` represents the current MCMC sample; `instance` is the FirecrownLikelihood object created by `setup`. :param sample: the sample generated by the sampler :param instance: the FirecrownLikelihood object :return: the status of the call to the module's execute function .. py:function:: cleanup(_) Cleanup hook for a CosmoSIS module. This one has nothing to do. :return: 0