Simulating Data¶
cmb_lensing.simulate.load_sim ¶
load_sim(nside, theta_pix, pol, master_seed, uk_arcmin_t=3, H0=None, ombh2=0.0224567, omch2=0.118489, cosmomc_theta=0.0104098, r=0.0, mnu=DEFAULT_MNU, tau=DEFAULT_TAUREIO, As=jnp.exp(3.043) * 1e-10, nt=0, ns=0.968602, lmax=4000, begin_ell_interp=None, l_knee=100, k_pivot=DEFAULT_K_PIVOT, Alens=DEFAULT_A_LENSE, nphi_fac=2, a_phi=1, precomputed_cls=None, max_l_tensor=DEFAULT_MAX_L_TENSOR, max_eta_k_tensor=DEFAULT_MAX_ETA_K_TENSOR, use_mask=False)
Simulate a lensed CMB data set on a flat nside x nside sky patch.
Runs CAMB for the requested cosmology, builds the field, phi and noise covariances in
Fourier space, draws the unlensed field(s), phi and the noise, lenses the field with
LenseFlow and returns everything in one data set object. CAMB runs inside
jax.pure_callback, so a CAMB failure gives NaN spectra rather than an exception.
Randomness: one root key PRNGKey(master_seed), and every random field (phi, then the unlensed field(s), then the noise) splits its own subkey off it in that fixed order (field_from_covar). So the realization at a seed depends on the cosmology only through the covariances the white noise is scaled by.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nside
|
Number of pixels on a side. |
required | |
theta_pix
|
Pixel width in arcmin. |
required | |
pol
|
"I" (temperature only), "P" (E/B polarization only) or "IP" (both). |
required | |
master_seed
|
Root seed of every random draw. |
required | |
uk_arcmin_t
|
White noise level in temperature, in uK-arcmin. The polarization noise is sqrt(2) higher. |
3
|
|
H0
|
Hubble constant. Leave as None to set the expansion through |
None
|
|
ombh2
|
Physical baryon density. |
0.0224567
|
|
omch2
|
Physical cold dark matter density. |
0.118489
|
|
cosmomc_theta
|
CosmoMC's approximation to the angular size of the sound horizon (the sampler's theta_MC_100 divided by 100). |
0.0104098
|
|
r
|
Tensor-to-scalar ratio. |
0.0
|
|
mnu
|
Sum of the neutrino masses in eV. |
DEFAULT_MNU
|
|
tau
|
Optical depth to reionization. |
DEFAULT_TAUREIO
|
|
As
|
Primordial scalar amplitude (the sampler's logA is log(1e10 As)). |
exp(3.043) * 1e-10
|
|
nt
|
Tensor spectral index. |
0
|
|
ns
|
Scalar spectral index. |
0.968602
|
|
lmax
|
Largest multipole of the spectra. |
4000
|
|
begin_ell_interp
|
Optional multipole past which the spectra are extrapolated rather than taken from CAMB. |
None
|
|
l_knee
|
Knee of the 1/f noise term. 0 gives pure white noise, as every sampler entry point uses. |
100
|
|
k_pivot
|
Pivot scale of the primordial spectra, in 1/Mpc. |
DEFAULT_K_PIVOT
|
|
Alens
|
CAMB's lensing amplitude. |
DEFAULT_A_LENSE
|
|
nphi_fac
|
Factor the quadratic-estimate noise is divided by (CMBLensing.jl's preconditioning heuristic). |
2
|
|
a_phi
|
Amplitude multiplying the phi covariance. |
1
|
|
precomputed_cls
|
Optional dict of CAMB spectra to use instead of running CAMB, for
callers that build many realizations at one cosmology. It must be in
|
None
|
|
max_l_tensor
|
CAMB's largest multipole for the tensor spectra. |
DEFAULT_MAX_L_TENSOR
|
|
max_eta_k_tensor
|
CAMB's largest k * eta for the tensor spectra. |
DEFAULT_MAX_ETA_K_TENSOR
|
|
use_mask
|
Apply a sky mask. False (the default) uses a mask of all ones. |
False
|
Returns:
| Type | Description |
|---|---|
|
A |
|
|
holding the fields ( |
|
|
operators ( |
|
|
|
|
|
Fourier space. |
Example
Source code in cmb_lensing/simulate.py
799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 | |