firecrown.connector.cosmosis.likelihood.FirecrownLikelihood#

class firecrown.connector.cosmosis.likelihood.FirecrownLikelihood(config)[source]#

Bases: object

CosmoSIS likelihood module for calculating 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.

Parameters:

config (<module ‘cosmosis.datablock’ from ‘/home/docs/checkouts/readthedocs.org/user_builds/firecrown/conda/latest/lib/python3.12/site-packages/cosmosis/datablock/__init__.py’>) – current CosmoSIS datablock

Public Methods:

__init__(config)

Create the FirecrownLikelihood object from the given configuration.

execute(sample)

This is the method called for each sample generated by the sampler.

special_gauss_family_handling(sample)

Special handling for the GaussFamily likelihood.

handle_twopoint_statistic(sample, stat)

Handle the TwoPoint statistic for the GaussFamily likelihood.

update_likelihood_and_tools(firecrown_params)

Update the likelihood and tools with the new parameters.

form_error_message(exc)

Form the error message that will be used to report a missing parameter.

calculate_firecrown_params(sample)

Calculate the ParamsMap for this sample.


calculate_firecrown_params(sample)[source]#

Calculate the ParamsMap for this sample.

Parameters:

sample (<module ‘cosmosis.datablock’ from ‘/home/docs/checkouts/readthedocs.org/user_builds/firecrown/conda/latest/lib/python3.12/site-packages/cosmosis/datablock/__init__.py’>) –

Return type:

ParamsMap

execute(sample)[source]#

This is the method called for each sample generated by the sampler.

Parameters:

sample (<module ‘cosmosis.datablock’ from ‘/home/docs/checkouts/readthedocs.org/user_builds/firecrown/conda/latest/lib/python3.12/site-packages/cosmosis/datablock/__init__.py’>) –

Return type:

int

form_error_message(exc)[source]#

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.

Parameters:

exc (MissingSamplerParameterError) –

Return type:

str

handle_twopoint_statistic(sample, stat)[source]#

Handle the TwoPoint statistic for the GaussFamily likelihood.

special_gauss_family_handling(sample)[source]#

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.

update_likelihood_and_tools(firecrown_params)[source]#

Update the likelihood and tools with the new parameters.

Parameters:

firecrown_params (ParamsMap) –

Return type:

None