moments — Power spectra and higher-order statistics¶
- foregrounds_diffusion.moments.mean_cls(maps_nhw, mapparams, lmin, lmax, binsize, n_jobs=1)[source]¶
Compute mean auto-power spectrum over a stack of maps.
- Parameters:
maps_nhw (ndarray, shape (N, H, W)) – Stack of flat-sky maps.
mapparams (list) – [nx, ny, dx, dy] — see
get_lxly().lmin, lmax (float) – Multipole range.
binsize (float) – Bin width in ℓ.
n_jobs (int) – Number of parallel workers (joblib). 1 = serial (default). -1 = all cores.
- Returns:
el (ndarray) – Bin centres.
mean_cl (ndarray) – Mean power spectrum across maps.
std_cl (ndarray) – Standard deviation across maps.
- foregrounds_diffusion.moments.mean_cross_cls(maps1, maps2, mapparams, lmin, lmax, binsize, n_jobs=1)[source]¶
Compute mean cross-power spectrum between two stacks of maps.
- Parameters:
maps1, maps2 (ndarray, shape (N, H, W)) – Two stacks of flat-sky maps.
mapparams (list) – [nx, ny, dx, dy].
lmin, lmax (float) – Multipole range.
binsize (float) – Bin width in ℓ.
n_jobs (int) – Number of parallel workers (joblib). 1 = serial (default). -1 = all cores.
- Returns:
el (ndarray)
mean_cl (ndarray)
std_cl (ndarray)
- foregrounds_diffusion.moments.compute_summed_moments(cib_arr, tsz_arr, bp_filters, n_jobs=1)[source]¶
Compute S2, S3, S4 of the summed CIB+tSZ field per ℓ-band.
- Parameters:
cib_arr (ndarray, shape (N, H, W))
tsz_arr (ndarray, shape (N, H, W))
bp_filters (list of ndarray) – 2D bandpass filters from
get_lpf_hpf().n_jobs (int) – Number of parallel workers (joblib). 1 = serial (default). -1 = all cores.
- Returns:
ndarray, shape (N, len(bp_filters), 3) – Columns: variance (S2), skewness (S3), excess kurtosis (S4).
- foregrounds_diffusion.moments.compute_cross_moments(cib_arr, tsz_arr, bp_filters, n_jobs=1)[source]¶
Compute all 12 cross-moments per ℓ-band (a=CIB, b=tSZ).
- Moments: S2^{aa}, S2^{bb}, S2^{ab},
S3^{aaa}, S3^{bbb}, S3^{aab}, S3^{abb}, S4^{aaaa}, S4^{bbbb}, S4^{aaab}, S4^{aabb}, S4^{abbb}.
- Parameters:
cib_arr (ndarray, shape (N, H, W))
tsz_arr (ndarray, shape (N, H, W))
bp_filters (list of ndarray)
n_jobs (int) – Number of parallel workers (joblib). 1 = serial (default). −1 = use all cores.
- Returns:
moments (ndarray, shape (N, len(bp_filters), 12))
labels (list of str)