Skip to content
fbianchiniPublic

About

A python code to perform Needlet Internal Linear Combination (NILC) analysis for CMB data.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NeeLC

A Needlet Internal Linear Combination (NILC) code for Python.

NeeLC provides tools for performing needlet decomposition and internal linear combination analysis on HEALPix maps, commonly used in CMB and multi-frequency astrophysical data analysis.

Installation

pip install .

For development (includes matplotlib for plotting):

pip install -e ".[dev]"

Quick start

Needlet decomposition

import numpy as np
import healpy as hp
from neelc import GaussianNeedlet, CosineNeedlet

# Gaussian needlets defined by FWHM scales (in arcmin, descending order)
need = GaussianNeedlet(theta_fwhms_arcmin=np.array([300., 120., 60.]), l_max=1000)

# Or cosine needlets defined by multipole ranges
need = CosineNeedlet(
    l_peaks=np.array([50, 200, 500]),
    l_mins=np.array([0, 50, 200]),
    l_maxs=np.array([50, 200, 1000]),
)

# Decompose a map into needlet coefficients
m = hp.read_map("my_map.fits")
beta_j = need.map2betajk(m, j=0)  # coefficients in band j=0

# Plot the needlet filters
need.plot_filter()

NILC analysis

from neelc import NILC, CosineNeedlet

need = CosineNeedlet(l_peaks, l_mins, l_maxs)

# Define frequencies and beams (FWHM in arcmin)
freqs = [90, 150, 220]
beams = {90: 5.0, 150: 3.5, 220: 2.5}

nilc = NILC(need, freqs, beams, eff_fwhm=20.)

# Get needlet coefficients for multi-frequency maps
betajk = nilc.get_betajk(maparr)

# Compute covariance of needlet coefficients
betajk_cov = nilc.get_betajk_cov(betajk=betajk)

API reference

Needlets

  • Needlet -- Base class for needlet analysis
  • GaussianNeedlet(theta_fwhms_arcmin, l_max) -- Needlets with Gaussian window functions
  • CosineNeedlet(l_peaks, l_mins, l_maxs) -- Needlets with cosine window functions

NILC

  • NILC(need, freqs, beams, ...) -- Needlet Internal Linear Combination analysis

Utilities

  • reduce_lmax(alm, lmax) -- Reduce the maximum multipole of an alm array
  • masked_smoothing(U, fwhm) -- Gaussian smoothing with proper mask handling

References

About

A python code to perform Needlet Internal Linear Combination (NILC) analysis for CMB data.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages