Source windows functions

class camb.sources.SourceWindow(*args, **kwargs)[source]

Abstract base class for a number count/lensing/21cm source window function. A list of instances of these classes can be assigned to the SourceWindows field of model.CAMBparams.

Note that source windows can currently only be used in flat models.

  • source_type – (integer/string, one of: 21cm, counts, lensing)

  • bias – (float64)

  • dlog10Ndm – (float64)

class camb.sources.GaussianSourceWindow(*args, **kwargs)[source]

Bases: SourceWindow

A Gaussian W(z) source window function.

  • redshift – (float64)

  • sigma – (float64)

class camb.sources.SplinedSourceWindow(*args, **kwargs)[source]

Bases: SourceWindow

A numerical W(z) source window function constructed by interpolation from a numerical table.

set_table(z, W, bias_z=None, k_bias=None, bias_kz=None)[source]

Set arrays of z and W(z) for cublic spline interpolation. Note that W(z) is the total count distribution observed, not a fractional selection function on an underlying distribution.

  • z – array of redshift values (monotonically increasing)

  • W – array of window function values. It must be well enough sampled to smoothly cubic-spline interpolate

  • bias_z – optional array of bias values at each z for scale-independent bias

  • k_bias – optional array of k values for bias

  • bias_kz – optional 2D contiguous array for space-dependent bias(k, z). Must ensure range of k is large enough to cover required vaules.