drift.core.psmc

Functions

block_root(clzz)

Calculate the 'square root' of an angular powerspectrum matrix (with nulls).

sim_skyvec(trans, n)

Simulate a set of \(alm(\nu)\) 's for a given \(m\).

Classes

PSMonteCarlo(kltrans[, subdir])

An extension of the PSEstimation class to support estimation of the Fisher matrix via Monte-Carlo simulations.

PSMonteCarloAlt(kltrans[, subdir])

An extension of the PSEstimation class to support estimation of the Fisher matrix via Monte-Carlo simulations.

class drift.core.psmc.PSMonteCarlo(kltrans, subdir='ps')

Bases: PSEstimation

An extension of the PSEstimation class to support estimation of the Fisher matrix via Monte-Carlo simulations.

This uses the fact that the covariance of the q-estimator is the Fisher matrix to Monte-Carlo the Fisher matrix and the bias. See Padmanabhan and Pen (2003), and Dillon et al. (2012).

nsamples

The number of samples to draw from each band.

Type:

integer

Initialise a PS estimator class.

Parameters:
  • kltrans (KLTransform) – The KL Transform filter to use.

  • subdir (string, optional) – Subdirectory of the KLTransform directory to store results in. Default is ‘ps’.

gen_sample(mi, nsamples=None, noiseonly=False)

Generate a random set of KL-data for this m-mode.

Found by drawing from the eigenvalue distribution.

Parameters:

mi (integer) – The m-mode to draw from.

Returns:

x – The random KL-data. The number of samples is set by the objects attribute.

Return type:

np.ndarray[nmodes, self.nsamples]

class drift.core.psmc.PSMonteCarloAlt(kltrans, subdir='ps')

Bases: PSEstimation

An extension of the PSEstimation class to support estimation of the Fisher matrix via Monte-Carlo simulations.

This uses a stochastic estimation of the trace which allows us to compute a reduced set of products between the four covariance matrices.

nswitch

The threshold number of eigenmodes above which we switch to Monte-Carlo estimation.

Type:

integer

nsamples

The number of samples to draw from each band.

Type:

integer

Initialise a PS estimator class.

Parameters:
  • kltrans (KLTransform) – The KL Transform filter to use.

  • subdir (string, optional) – Subdirectory of the KLTransform directory to store results in. Default is ‘ps’.

gen_vecs(mi)

Generate a cache of sample vectors for each bandpower.

drift.core.psmc.block_root(clzz)

Calculate the ‘square root’ of an angular powerspectrum matrix (with nulls).

drift.core.psmc.sim_skyvec(trans, n)

Simulate a set of \(alm(\nu)\) ‘s for a given \(m\).

Generated as if \(m=0\). For greater \(m\), just ignore entries for \(l < abs(m)\).

Parameters:

trans (np.ndarray) – Transfer matrix generated by block_root from a a particular \(C_l(z,z')\).

Returns:

gaussvars – Vector of alms.

Return type:

np.ndarray