py21cmmc.likelihood.LikelihoodBaseFile#

class py21cmmc.likelihood.LikelihoodBaseFile(datafile=None, noisefile=None, simulate=False, emulate=False, use_data=True)[source]#

Base class for likelihoods whose data is read from a file.

Parameters:
  • datafile (str, optional) – The file(s) from which to read the data. Alternatively, the file to which to write the data. Data will only be written to the file if simulate is set to True explicitly.

  • noisefile (str, optional) – The file(s) from which to read the noise profile. If not given, no noise is used.

  • simulate (bool, optional) – Whether to perform a simulation to create the (mock) data (i.e. instead of reading from file). Default is False, which prevents the mock data from potentially overwriting the datafile.

  • emulate (bool, optional) – Default is False

  • use_data (bool, optional) – Sometimes you may want to construct the likelihood without any data at all. Set this to False if this is the case.

Methods

__init__([datafile, noisefile, simulate, ...])

computeLikelihood(model)

Calculate the likelihood of the instance data given the model.

get_fiducial_model()

Compute and return a model dictionary at the fiducial set of parameters.

reduce_data(ctx)

Perform reduction on raw data (from all cores in the chain).

setup()

Perform post-init setup.

Attributes

chain

Reference to the LikelihoodComputationChain containing this core.

core_primary

The first core that appears in the requirements.

parameter_names

Names of the parameters of the full chain.

required_cores