DDPM pipeline for generating correlated CIB and tSZ extragalactic CMB foregrounds
Project description
Denoising Diffusion Probabilistic Models for Extragalactic Foregrounds from AGORA
This repository implements a denoising diffusion probabilistic model (DDPM) pipeline to generate realistic AGORA map patches, incorporating point-source masked Cosmic Infrared Background (CIB) and cluster masked thermal Sunyaev-Zeldovich (tSZ) maps. The model is trained to reproduce statistical features of simulated sky patches.
Overview
- Data: AGORA maps with point sources masked at 2mJy threshold. Zeroed-out pixels represent masked regions.
- Preprocessing:
- High-frequency suppression via sharp mode cutoff (
l > 7000) to avoid aliasing. - Negative pixel values from filtering artifacts are zeroed out.
- High-frequency suppression via sharp mode cutoff (
- Patching:
- Patches of size 6°×6° projected to 256×256 pixel Cartesian grids.
- Centered on a grid defined by step size of 6° adjusted for equal angular separation in galactic coordinates.
Data Location
Maps are produced by Srini and are located at: /sptlocal/analysis/ymap/sims/mdpl2/data/v0.7/bahamas80_scal1.000/mask_radio_cib_2.0mjy/cib(tsz)
Training
Training is handled using huggingface-accelerate by running the script train.py:
accelerate launch train.py
The training script: Loads preprocessed maps from data/low_pass/{ptsrc}mJy/ Stacks CIB and tSZ maps into a 2-channel tensor: (N, 2, 256, 256) Augments with 90°, 180°, 270° rotations and horizontal flips Trains a U-Net-based DDPM model with flash attention
Sampling
The trained model generates synthetic CIB and tSZ map pairs that resemble the original astrophysical simulations and preserve the correct cross-correlations. These samples are useful for data augmentation, uncertainty estimation, and testing cosmological inference pipelines.
New samples can be generated using sample.py, which loads a trained checkpoint and produces batches of correlated CIB–tSZ pairs:
accelerate launch sample.py
Requirements
- Python 3+ ** Denoising-diffusion (https://github.com/lucidrains/denoising-diffusion-pytorch)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file foregrounds_diffusion-0.1.0.tar.gz.
File metadata
- Download URL: foregrounds_diffusion-0.1.0.tar.gz
- Upload date:
- Size: 47.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28a1b13fcc11969f04ac2549eaf1b5f19a856749a24d0e136a5f4fa5c50a7d05
|
|
| MD5 |
b0ab330d3440c8a5b3332ddd9ba7dd8e
|
|
| BLAKE2b-256 |
b5f2c653024a40e07a795b7549eac6da747afbccdcdf0b5c667ea9b3d2745573
|
Provenance
The following attestation bundles were made for foregrounds_diffusion-0.1.0.tar.gz:
Publisher:
publish.yml on AlexBM173/cmb_foregrounds_diffusion
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
foregrounds_diffusion-0.1.0.tar.gz -
Subject digest:
28a1b13fcc11969f04ac2549eaf1b5f19a856749a24d0e136a5f4fa5c50a7d05 - Sigstore transparency entry: 2040548647
- Sigstore integration time:
-
Permalink:
AlexBM173/cmb_foregrounds_diffusion@f6f34e57fdfdbb174d0d22fe755bf1e1af37dd3f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/AlexBM173
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f6f34e57fdfdbb174d0d22fe755bf1e1af37dd3f -
Trigger Event:
push
-
Statement type:
File details
Details for the file foregrounds_diffusion-0.1.0-py3-none-any.whl.
File metadata
- Download URL: foregrounds_diffusion-0.1.0-py3-none-any.whl
- Upload date:
- Size: 37.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2719619f3178bd7160e42f15848201000eebeef288d81be120b1b0dc0e8e1593
|
|
| MD5 |
91742053f93e8ad4da92a3abb6e5ac1a
|
|
| BLAKE2b-256 |
74cecb59d2a10921119fa947405ff6a2e8424c1eb1d87741853e4c85f383ee04
|
Provenance
The following attestation bundles were made for foregrounds_diffusion-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on AlexBM173/cmb_foregrounds_diffusion
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
foregrounds_diffusion-0.1.0-py3-none-any.whl -
Subject digest:
2719619f3178bd7160e42f15848201000eebeef288d81be120b1b0dc0e8e1593 - Sigstore transparency entry: 2040548930
- Sigstore integration time:
-
Permalink:
AlexBM173/cmb_foregrounds_diffusion@f6f34e57fdfdbb174d0d22fe755bf1e1af37dd3f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/AlexBM173
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f6f34e57fdfdbb174d0d22fe755bf1e1af37dd3f -
Trigger Event:
push
-
Statement type: