Skip to main content

HI_FORGE

HI_FORGE generates realistic HI intensity maps across redshift ranges. Features: Gaussian beam/noise/masks/zebras, single maps or Latin Hypercube parameter suites for ML/SBI training, multi-bin tomography support. Seeds logged 1→N. Perfect for cosmological simulations.

HiCrafter Logo

HI_FORGE is designed for rapid experimentation and reproducibility, enabling large-scale simulation campaigns while preserving precise control over astrophysical and instrumental systematics.

This README explains the package structure, configuration options, and provides guidance for running simulations and using the included tutorials.

Table of Contents

Overview

HI_FORGE generates full-sky neutral hydrogen (HI) intensity maps by combining realizations of the large-scale matter density field with an effective model for the HI brightness temperature, followed by the application of instrumental and observational effects.

HI intensity map construction

The HI brightness temperature fluctuation along a direction is modeled as

T_HI(n̂) = ∫_{z_min}^{z_max} T̄_HI(z) · b_HI(z) · δ_m(n̂, z) dz

where δ_m(n̂, z) is the matter overdensity field, b_HI(z) is the HI bias, and T̄_HI(z) is the mean HI brightness temperature.

In practice, the redshift integral is discretized into radial shells, yielding

T_HI(n̂) ≈ Σ_i ⟨T̄_HI⟩_i · b_HI(z_i) · δ_i(n̂)

where δ_i(n̂) are lognormal realizations of the matter field on shell i.

The mean HI brightness temperature is parametrized as

T̄_HI(z) = 189 × 4 × 10^-4 · (1 + z)^2.6 · h / H(z)

and the HI bias is modeled as

b_HI(z) = 0.6 + 0.3(1 + z)

Beam smoothing

Finite angular resolution is modeled by convolution with a Gaussian beam. In spherical harmonic space, the observed coefficients are

a_obs(ℓ, m) = b_ℓ · a(ℓ, m)

with beam transfer function

b_ℓ = exp[ -½ · ℓ(ℓ + 1) · σ_b^2 ]
σ_b = θ_FWHM / sqrt(8 ln 2)

Thermal noise

Instrumental noise is modeled as additive, uncorrelated Gaussian noise in pixel space,

n(n̂) ~ N(0, σ_n^2)

such that the noisy map is

T'_HI(n̂) = T_HI(n̂) + n(n̂)

Zebra-striping systematics

Scan-synchronous striping systematics are modeled as a deterministic modulation added to the map,

S(θ, φ) = A · sin[ (2π / λ) · (sinθ cosφ) ]

where (θ, φ) are spherical coordinates, λ sets the stripe wavelength, and A is the stripe amplitude.

The final observed map is therefore

T_obs(n̂) = (T_HI * B)(n̂) + n(n̂) + S(n̂)

with optional masking applied multiplicatively in pixel space.

Features

  • Lognormal HI intensity maps — full-sky HI brightness temperature maps generated from lognormal matter-field realizations via GLASS.
  • Gaussian beam smoothing — convolve the map with a Gaussian beam of arbitrary FWHM (degrees).
  • Thermal noise — add pixel-level white Gaussian noise with a configurable noise level.
  • Zebra-striping systematics — inject scan-synchronous striping artefacts.
  • Sky masking — apply an external mask (HEALPix FITS or .npy file).
  • Latin Hypercube suites — generate large batches of maps spanning a cosmological parameter space for ML / SBI training.
  • Reproducible seeds — every map is generated from a deterministic seed; seeds are logged 1 → N across a batch.
  • Multi-CPU batching — produce N maps efficiently with generate_batch().
  • Flexible cosmology — five configurable ΛCDM parameters (h, As, Ωc, Ωb, ns) via CAMB.

Installation

We recommend installing HI_FORGE in a new conda environment. Clone the repository and install in editable mode:

git clone https://github.com/PaulineGorbatchev/HI_FORGE.git
cd HI_FORGE
pip install -e .

Since the repository is private, Git will ask for your GitHub username and a personal access token (with the repo scope) as the password.

Dependencies are listed in requirements.txt:


numpy>=1.21.0
healpy>=1.15.0
camb>=0.5.0
glass>=0.5.0
scipy>=1.8.0

Usage

Import HIGenerator from the hi_forge package and call generate_map() to produce a single HEALPix map, or generate_batch() to produce a numbered set of maps saved to disk.

from hi_forge import HIGenerator

gen = HIGenerator(nside=64, z_min=0.40, z_max=0.45, seed=42)
hi_map = gen.generate_map()   # returns numpy array of shape (hp.nside2npix(nside),)

To generate a batch of N maps (each with an independent seed offset), use:

maps = gen.generate_batch(n_maps=100, output_dir="output/maps")

See the basic pipeline tutorial and Latin Hypercube tutorial for full worked examples.

Configuration

All parameters are passed to the HIGenerator constructor.

Parameter Type Default Description
hfloat0.7Dimensionless Hubble constant.
Asfloat2×10−9Scalar amplitude of primordial power spectrum.
Ocfloat0.25Cold dark matter density Ωc.
Obfloat0.05Baryon density Ωb.
nsfloat0.965Scalar spectral index.
nsideint32HEALPix resolution parameter (capped at 512 for safety). Pixel count = 12 × nside².
z_minfloat0.4Minimum redshift of the survey volume.
z_maxfloat0.45Maximum redshift of the survey volume.
nbinsint1Number of tomographic redshift bins.
sigmaz0float1×10−4Photometric redshift uncertainty σz,0.
beam_degfloat or NoneNoneGaussian beam FWHM in degrees. Set to None to skip smoothing.
noiseboolTrueWhether to add thermal noise.
noise_levelfloat1.0Standard deviation of the Gaussian noise (same units as THI).
mask_filestr or NoneNonePath to a sky mask (.npy or HEALPix FITS). Masked pixels are set to zero.
zebrasboolFalseAdd scan-synchronous zebra-striping systematics.
seedint1Base random seed for reproducibility.

Examples

Baseline HI map

Generate a baseline HI intensity map without instrumental or observational effects.

gen = HIGenerator(
    nside=32,
    z_min=0.40,
    z_max=0.45,
    nbins=1,
    sigmaz0=1e-4,
    beam_deg=None,
    noise=False,
    zebras=False,
    seed=1,
)

hi_map = gen.generate_map()

Beam smoothing

Apply Gaussian beam smoothing to the HI intensity map.

gen_beam = HIGenerator(
    nside=32,
    z_min=0.40,
    z_max=0.45,
    nbins=1,
    sigmaz0=1e-4,
    beam_deg=1.5,
    noise=False,
    zebras=False,
    seed=1,
)

hi_beam = gen_beam.generate_map()

Thermal noise

Add thermal noise on top of the beam-smoothed HI map.

gen_noise = HIGenerator(
    nside=32,
    z_min=0.40,
    z_max=0.45,
    nbins=1,
    sigmaz0=1e-4,
    beam_deg=1.5,
    noise=True,
    noise_level=1.0,
    zebras=False,
    seed=1,
)

hi_noise = gen_noise.generate_map()

Zebra-striping systematics

Add zebra-striping systematics in addition to beam smoothing and noise.

gen_zebra = HIGenerator(
    nside=32,
    z_min=0.40,
    z_max=0.45,
    nbins=1,
    sigmaz0=1e-4,
    beam_deg=1.5,
    noise=True,
    noise_level=1.0,
    zebras=True,
    seed=1,
)

hi_zebra = gen_zebra.generate_map()

Citation

If you use HI_FORGE in your research, please cite the repository:

@software{hi_forge,
  author  = {Gorbatchev, Pauline},
  title   = {HI\_FORGE: HI Intensity Map Generator},
  url     = {https://github.com/PaulineGorbatchev/HI_FORGE},
  version = {0.1.0}
}

Download files

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

Source Distribution

hi_forge-0.1.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

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

hi_forge-0.1.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file hi_forge-0.1.0.tar.gz.

File metadata

  • Download URL: hi_forge-0.1.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for hi_forge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c78b598781d1b8de163634a644b085d6cd491d13174beb5f07a35f57eed526b3
MD5 af3f777affa59d1b21949bd9276ee316
BLAKE2b-256 f6df2f5e7f16a3fbfe6f5a73cf0022932595cced6f1258bc1443bc16b8b66d03

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hi_forge-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for hi_forge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e7aeac6e0a5873e92d00b89f83a1e54e45a58a749be0aeab687ce6003424c364
MD5 8b49c5395283fb1ace2c46626532cd46
BLAKE2b-256 005f5b77d56da1df6a84acc2df508945dac264587c68f3a3a43379ee817cebe0

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page