Skip to main content

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.
  • 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

foregrounds_diffusion-0.1.0.tar.gz (47.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

foregrounds_diffusion-0.1.0-py3-none-any.whl (37.0 kB view details)

Uploaded Python 3

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

Hashes for foregrounds_diffusion-0.1.0.tar.gz
Algorithm Hash digest
SHA256 28a1b13fcc11969f04ac2549eaf1b5f19a856749a24d0e136a5f4fa5c50a7d05
MD5 b0ab330d3440c8a5b3332ddd9ba7dd8e
BLAKE2b-256 b5f2c653024a40e07a795b7549eac6da747afbccdcdf0b5c667ea9b3d2745573

See more details on using hashes here.

Provenance

The following attestation bundles were made for foregrounds_diffusion-0.1.0.tar.gz:

Publisher: publish.yml on AlexBM173/cmb_foregrounds_diffusion

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file foregrounds_diffusion-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for foregrounds_diffusion-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2719619f3178bd7160e42f15848201000eebeef288d81be120b1b0dc0e8e1593
MD5 91742053f93e8ad4da92a3abb6e5ac1a
BLAKE2b-256 74cecb59d2a10921119fa947405ff6a2e8424c1eb1d87741853e4c85f383ee04

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page