- Why this dataset exists
- Contents
- Downloading
- The 5D CAMB grid
- LCDM chains (
joint_inference_data/) - Delensed covariances (
delensed_field_covariance_data/) - Lensing reconstruction noise (
map_joint_phi_noise_data/,sampler_phi_noise_data/) - Python versus Julia
map_jointcomparison (map_joint_comparison/) - Reproducibility notes
- Citation and license
CMBLensing.py data
This dataset holds every large data product behind CMBLensing.py, a JAX port of the Julia package CMBLensing.jl. CMBLensing.py simulates gravitationally lensed CMB temperature and polarization maps on a flat sky, recovers the unlensed field and the lensing potential from a lensed data map (map_joint), and jointly samples the LCDM parameters from that map (sample_joint).
Documentation for the package: https://zaneblooddev.com/CMBLensing.py/
Why this dataset exists
The code lives on GitHub, but the data it needs and the data it produced do not fit there:
- The sampler cannot run without a precomputed 5D grid of CAMB spectra (~7.9 GB). Calling CAMB at every proposed parameter combination would dominate the run time, so the spectra are computed once on a grid and interpolated.
- The results reported for the package (LCDM chains, lensing reconstruction noise measurements, delensed covariances for the Fisher forecast, and the Python versus Julia
map_jointcomparison) took many cluster hours to generate. Storing the raw outputs here lets anyone regenerate the figures, check the analysis, or run a new analysis without repeating those jobs.
Everything is stored in the layout the cluster jobs wrote it in, so the scripts in the repository read it without conversion.
This dataset was previously named
zaneblood1/5D_LCDM_CAMB_Grid_Splineand held only the CAMB grid. The old name redirects here, and the grid files are still at the dataset root, so existing installs keep working.
Contents
| Path | Size | Files | What it is |
|---|---|---|---|
camb_grid_spline.npz |
7.9 GB | 1 | the 5D CAMB grid that sample_joint interpolates |
camb_*_grid.npz |
small | 5 | legacy 1D CAMB grids, no longer read by the package |
joint_inference_data/ |
512 MB | 5,061 | LCDM parameter chains from sample_joint |
delensed_field_covariance_data/ |
683 MB | 1,506 | empirical delensed covariances, the field block of the Fisher forecast |
map_joint_phi_noise_data/ |
98 MB | 303 | per-mode lensing reconstruction noise of map_joint |
sampler_phi_noise_data/ |
787 MB | 622 | per-mode lensing reconstruction noise of the sampler's posterior mean |
map_joint_comparison/ |
13 GB | 6,420 | map_joint run times and reconstructions, CMBLensing.py versus CMBLensing.jl |
Unless a folder says otherwise, the experiments use 128 x 128 pixel temperature maps at 2.5 arcminutes per pixel, white noise only (no 1/f term, no beam, no mask), at 2.5, 5 or 10 uK-arcmin, with the ground truth cosmology
omch2 |
ombh2 |
ns |
theta_MC_100 |
logA |
|---|---|---|---|---|
| 0.109381 | 0.022386 | 0.959814 | 1.031732 | 3.218387 |
Downloading
The whole dataset is about 23 GB. To take only the part you need, pass a folder pattern:
pip install -U huggingface_hub
#one folder
hf download zaneblood1/cmb_lensing_data --repo-type dataset \
--include "joint_inference_data/*" --local-dir cmb_lensing_data
#everything
hf download zaneblood1/cmb_lensing_data --repo-type dataset --local-dir cmb_lensing_data
or from Python:
from huggingface_hub import snapshot_download
snapshot_download(repo_id = "zaneblood1/cmb_lensing_data", repo_type = "dataset",
allow_patterns = ["delensed_field_covariance_data/*"],
local_dir = "cmb_lensing_data")
The CAMB grid needs no manual step: CMBLensing.py downloads it into camb_splines/ the first time the sampler asks for it, or ahead of time with cmb-lensing-download-splines.
The files are NumPy .npz archives and plain text, so the dataset viewer and datasets.load_dataset do not apply. Read them with numpy.load and numpy.loadtxt.
The 5D CAMB grid
camb_grid_spline.npz holds CAMB spectra on a tensor-product grid over the five LCDM parameters, which the package turns into a 5D cubic spline. It serves any subset of the five parameters and every polarization mode. See The CAMB Grid for how it is used and Building the CAMB Grid for how to rebuild it.
| Parameter | Minimum | Maximum | Nodes |
|---|---|---|---|
h0 |
25 | 130 | 81 |
log_a |
2.661635 | 3.782861 | 5 |
ns |
0.867143 | 1.042186 | 5 |
ombh2 |
0.020413 | 0.024389 | 5 |
omch2 |
0.079704 | 0.155541 | 7 |
CAMB settings: lmax = 4000, tau = 0.05, mnu = 0.06, k_pivot = 0.05, alens = 1, and accuracy_boost = l_sample_boost = l_accuracy_boost = 1.
The five camb_<parameter>_grid.npz files are 1D grids along one parameter with the other four held at their fiducial values. The package stopped using them in November 2026; they are kept for anyone on an older version.
LCDM chains (joint_inference_data/)
Each sub-folder is one run of sample_joint over many simulated data maps, sampling omch2, logA and theta_MC_100. A chain is one text file with one sample per line:
<parameter>_map_<map seed>_chain_<sub-chain index>_history.txt
Most folders carry an experimental_details.txt listing the map size, noise level, step sizes, number of maps and sub-chains, and the burn-in used for that run. The folder names give the date of the run and, for the later ones, the noise level; the three joint_inference_2026_10_29_<noise>uk folders are the most recent.
A folder is a chain_dir for the package's chain analysis:
python -m cmb_lensing.chain_analysis cmb_lensing_data/joint_inference_data/joint_inference_2026_10_29_2.5uk \
--nside 128 --theta_pix 2.5 --noise 2.5
or read one chain directly:
import numpy as np
chain = np.loadtxt("joint_inference_data/joint_inference_2026_10_29_2.5uk/logA_map_234567_chain_1_history.txt")
Delensed covariances (delensed_field_covariance_data/)
The per-mode covariance of the delensed field at the fiducial cosmology and at plus and minus one step in each sampled parameter. The Fisher forecast cannot run without one. See Delensed Covariances.
Folders are named delensed_covariance_output_<W>_<noise>uk, where <W> says which lensing noise built the Wiener filter used to delens:
<W> |
Lensing noise in the Wiener filter |
|---|---|
qe_filter_unlensed_response_unlensed |
quadratic estimate N0, unlensed spectra in the filter |
qe_filter_lensed_response_unlensed |
quadratic estimate N0, lensed spectra in the filter |
qe_filter_delensed_response_unlensed |
quadratic estimate N0, iterated (delensed) filter |
map_joint |
the measured noise in map_joint_phi_noise_data/ |
sampler_phi_noise |
the measured noise in sampler_phi_noise_data/ |
Each folder has 100 per-realization files, delensed_covariance_0000.npz to delensed_covariance_0099.npz. The map_joint and sampler_phi_noise folders also have the merged delensed_covariance.npz (the realization mean), which is the file the forecast takes. For the qe_filter_* folders, produce it with get_delensed_field_covariance/merge_delensed_field_covariance.py from the repository.
import numpy as np
cov = np.load("delensed_field_covariance_data/delensed_covariance_output_map_joint_5uk/delensed_covariance.npz")
cov["delensed_fid"] #(128, 65) covariance on the rfft grid at the fiducial cosmology
cov["delensed_plus"] #(3, 128, 65) at +1 step in each of cov["names"]
cov["delensed_minus"] #(3, 128, 65) at -1 step
cov["steps"] #the step sizes
python -m cmb_lensing.fisher_forecast --noise 5 \
--delensed_covariance delensed_field_covariance_data/delensed_covariance_output_map_joint_5uk/delensed_covariance.npz
Lensing reconstruction noise (map_joint_phi_noise_data/, sampler_phi_noise_data/)
The per-mode noise of the reconstructed lensing potential, measured over 100 realizations at each noise level: once for the map_joint estimate and once for the sampler's posterior mean with the cosmology held at the ground truth. See MAP Joint Phi Noise and Sampler Phi Noise.
Each ..._output_<noise>uk/ folder has the 100 per-realization files and one merged file, map_joint_phi_noise.npz or sampler_phi_noise.npz:
import numpy as np
noise = np.load("map_joint_phi_noise_data/map_joint_phi_noise_output_5uk/map_joint_phi_noise.npz")
noise["nphi"] #(128, 65) N_phi per rfft mode
noise["nphi_error"] #(128, 65) its error
noise["nphi_leave_one_out"] #(100, 128, 65) leave-one-realization-out estimates
noise["cphi"] #(128, 65) the lensing potential power spectrum
Either merged file can be passed to the forecast or the chain analysis as --phi_noise.
The three sampler_phi_noise_output_<noise>uk_pre_refactor/ folders hold the same measurement in the format written before the October 2026 refactor (sampler_effective_noise.npz, plus versions at several burn-in lengths). They are kept as a record; the current code reads only sampler_phi_noise.npz.
Python versus Julia map_joint comparison (map_joint_comparison/)
Run times and reconstructions of map_joint from CMBLensing.py and CMBLensing.jl on identical simulated data: temperature plus polarization (IP) maps of 128, 256, 512 and 1024 pixels per side at 2.5 arcminutes per pixel, 10 data maps per size and 10 trials per data map, 30 map_joint steps, 3 uK-arcmin white noise in T with a 1/f term (l-knee 100).
map_joint_comparison/performance_results/
python_results/map_size_<N>_polarity_IP_seed_<s>/
cached_times/cached_time_<trial>.txt wall time in seconds, second call (compiled)
uncached_times/uncached_time_<trial>.txt wall time in seconds, first call (includes compilation)
learned_fields/cmb/<t|e|b>_field_python_predict_<trial>.npz the reconstructed unlensed field
learned_fields/cmb/<t|e|b>_field_julia_simulation_<trial>.npz the simulated truth
learned_fields/lensing_potential/phi_python_predict_<trial>.npz
learned_fields/lensing_potential/phi_julia_simulation_<trial>.npz
julia_results/map_size_<N>_polarity_IP_seed_<s>/
cached_times/, uncached_times/ as above
learned_fields/cmb/<t|e|b>_field_julia_predict_<trial>.npz
learned_fields/lensing_potential/phi_julia_predict_<trial>.npz
performance_analysis/ the figures made from these files
Every field is a complex array on the rfft grid, shape (N, N // 2 + 1). One caveat when reading them: the Python files are true .npz archives, while the Julia files are single arrays in .npy format that carry an .npz extension. numpy.load handles both, but returns different things:
import numpy as np
base = "map_joint_comparison/performance_results"
run = "map_size_256_polarity_IP_seed_2"
phi_python = np.load(f"{base}/python_results/{run}/learned_fields/lensing_potential/phi_python_predict_1.npz")["arr_0"]
phi_julia = np.load(f"{base}/julia_results/{run}/learned_fields/lensing_potential/phi_julia_predict_1.npz")
seconds = np.loadtxt(f"{base}/python_results/{run}/cached_times/cached_time_1.txt")
The figures are regenerated by runtime_comparison/performance_analysis.py in the repository, with its BASE_DIR / RESULTS_DIR pointed at the downloaded performance_results folder.
Reproducibility notes
- Every per-realization file stores its own truth (seed, parameters, box and noise settings), so each merged file can be rebuilt from the files next to it.
- CMBLensing.py changed how
load_simderives its random numbers on 2026-10-15. A seed recorded in a file written before that date no longer reproduces the same realization with the current code. - Some per-realization delensed covariance files record the absolute path, on the cluster they ran on, of the lensing noise file they used (
wiener_nphi_file). The file it refers to is the merged noise file of the same noise level in this dataset.
Citation and license
If you use this data, please cite CMBLensing.py through the CITATION.cff in its repository, and CMBLensing.jl, which it ports.
Released under the MIT license, the same as the code.
- Downloads last month
- 104