py21cmmc.likelihood.LikelihoodLuminosityFunction#

class py21cmmc.likelihood.LikelihoodLuminosityFunction(*args, name='', mag_brightest=-20.0, z=None, **kwargs)[source]#

Likelihood based on Chi^2 comparison to luminosity function data.

This likelihood is vectorized i.e., it accepts an array of astro_params.

Parameters:
  • datafile (str, optional) – Input data should be in a .npz file, and contain the arrays: * Muv: the brightness magnitude array * lfunc: the number density of galaxies at each Muv bin. Each of these arrays can be either 1D or 2D. If 1D, they will be interpreted to be arrays over Muv. If 2D, first axis will be interpreted to be redshift. If you require each luminosity function at different redshifts to have different numbers of Muv bins, you should create multiple files, and create a separate core/likelihood instance pair for each, pairing them by name. A set of default LFs (z=6,7,8,10; Bouwens+15,16; Oesch+17) are provided in the folder data where datafile and noisefile (see below) are named LF_lfuncs_z*.npz and LF_sigmas_z*.npz. To use these files, a separate core/likelihood instance pair for each redshift is required.

  • noisefile (str, optional) – Noise should be a .npz file with a single array ‘sigma` which gives the error at each of the Muv bins in the datafile. If 1D, it must have the same length as Muv. If 2D, must have the same length as the number of redshifts as the first dimension.

  • mag_brightest (float, optional) – Brightest magnitude when calculating the likelihood. Default is -20.

  • name (str, optional) – A name for the instance. This is used to pair it with a particular core instance.

Methods

__init__(*args[, name, mag_brightest, z])

computeLikelihood(model)

Compute the likelihood.

define_noise(ctx, model)

Define noise properties.

get_fiducial_model()

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

reduce_data(ctx)

Reduce simulated model data.

setup()

Setup instance.

Attributes

chain

Reference to the LikelihoodComputationChain containing this core.

core_primary

The first core that appears in the requirements.

paired_core

The luminosity function core that is paired with this likelihood.

parameter_names

Names of the parameters of the full chain.

redshifts

Redshifts at which luminosity function is defined.

required_cores