Simulating Data¶
cmb_lensing.simulate.load_sim is the main entry point. It
- runs CAMB for the requested cosmology,
- builds the field, phi and noise covariances in Fourier space,
- draws the unlensed field, phi and the noise,
- lenses the field with
primal_lense_flow, - returns a
DataSetT/DataSetEB/DataSetTEBholding the fields, the operators and the simulated data.
from cmb_lensing.simulate import load_sim
data_set = load_sim(nside = 128, #pixels per side
theta_pix = 2.5, #arcmin per pixel
pol = "IP", #"I", "P" or "IP"
master_seed = 67,
uk_arcmin_t = 5, #white noise level in T (P is sqrt(2) higher)
l_knee = 0) #0 for pure white noise
Useful attributes of the returned data set: unlensed_field, lensed_field, phi, data, field_covariance, phi_covariance, noise_covariance, mask, beam, mixing_d, mixing_g, quadratic_estimate.
Choices to know about¶
- Noise sprectra are computed via
noise_cls(...)with a 1/f term. The defaults arel_knee = 100andalpha_knee = 3. The default beam FWHM is 0. - Cosmology is given in CAMB's names (
cosmomc_theta,As,ombh2,omch2,ns, ...). The sampler's names (theta_MC_100,logA) are converted byto_camb_naming_conv(which edits its dict in place) orfisher_forecast.load_sim_cosmology. - CAMB runs inside
jax.pure_callback, soload_simis traceable. A CAMB failure gives NaN spectra and a non-finite logpdf, never an exception.