Index
PowerSpectra.ConstantDict
PowerSpectra.CovField
PowerSpectra.CovarianceWorkspace
PowerSpectra.CovarianceWorkspace
PowerSpectra.SpectralArray
PowerSpectra.SpectralVector
PowerSpectra.coupledcov
PowerSpectra.coupledcov
PowerSpectra.decouple_covmat
PowerSpectra.fitdipole
PowerSpectra.getblock
PowerSpectra.getlmax
PowerSpectra.kᵤ
PowerSpectra.kᵤ
PowerSpectra.mask!
PowerSpectra.maskedalm2spectra
PowerSpectra.master
PowerSpectra.mcm
PowerSpectra.mcm
PowerSpectra.name_alms
PowerSpectra.nside2lmax
PowerSpectra.planck256_map
PowerSpectra.planck256_mask
PowerSpectra.quickpolW
PowerSpectra.quickpolW
PowerSpectra.quickpolΞ!
PowerSpectra.quickpolΞ!
PowerSpectra.scale!
PowerSpectra.spectralones
PowerSpectra.spectralzeros
PowerSpectra.subtract_monopole_dipole!
PowerSpectra.synalm
PowerSpectra.synalm!
PowerSpectra.Ξsum
PowerSpectra.@spectra
PowerSpectra.ConstantDict
— TypeA dictionary that always returns one thing, no matter what key.
PowerSpectra.CovarianceWorkspace
— MethodCovarianceWorkspace(m_i, m_j, m_p, m_q; lmax::Int=0)
Inputs and cache for covariance calculations. A covariance matrix relates the masks of four fields and spins. This structure caches various cross-spectra between masks and noise-weighted masks. By default, operates at Float64 precision.
Arguments:
m_i::CovField{T}
: map im_j::CovField{T}
: map jm_p::CovField{T}
: map pm_q::CovField{T}
: map q
Keywords
lmax::Int=0
: maximum multipole to compute covariance matrix
PowerSpectra.SpectralArray
— MethodSpectralArray(A::AbstractArray, [ranges])
A renamed OffsetArray. By default, it produces a 0-indexed array.
PowerSpectra.SpectralVector
— MethodAlias for SpectralArray{T,1}
PowerSpectra.coupledcov
— Methodcoupledcov(ch1, ch2, workspace, spectra;
noiseratios=Dict(), lmax=0) where T
Arguments:
ch1::Symbol
: spectrum type of first spectrum (i.e. :TT, :TE, :EE)ch2::Symbol
: spectrum type of second spectrum (i.e. :TT, :TE, :EE)workspace
: cache for working with covariancesspectra
: signal spectra
Keywords
noiseratios::AbstractDict
: ratio of noise spectra to white noiselmax=0
: maximum multipole moment for covariance matrix
Returns:
SpectralArray{T,2}
: covariance matrix (0-indexed)
PowerSpectra.decouple_covmat
— Methoddecouple_covmat(Y, B1, B2; lmin1=2, lmin2=2)
Decouples a covariance matrix Y, performing B₁⁻¹ × Y × (B₂⁻¹)^† by mutating Y.
PowerSpectra.fitdipole
— Functionfunction fitdipole(m::HealpixMap{T}, [w::HealpixMap{T}=1]) where T
Fit the monopole and dipole of a map.
Arguments:
m::HealpixMap{T}
: map to fitw::HealpixMap{T}
: weight map. Defaults to a FillArray of ones.
Returns:
Tuple{T, NTuple{3,T}}
: (monopole, (dipole x, dipole y, dipole z))
PowerSpectra.getblock
— Methodgetblock(A::BlockSpectralMatrix{T,M_BLOCKS,1}, i) where {T,M_BLOCKS}
Extract a sub-block from a BlockSpectralMatrix
.
Arguments:
A::BlockSpectralMatrix{T,M_BLOCKS,1}
: array to extract fromi::Int
: index of the sub-block (1-indexed)
Returns:
Array{T,2}
: sub-blocks
PowerSpectra.getlmax
— MethodHeuristic for a maximum multipole
PowerSpectra.kᵤ
— Methodkᵤ([T=Float64], u)
Defined only for u ∈ {-2, 0, 2}.
PowerSpectra.mask!
— Methodmask!(m::HealpixMap, mask)
mask!(m::PolarizedHealpixMap, maskT, maskP)
Mask a map or polarized map in place.
Arguments:
m::Union{HealpixMap,PolarizedHealpixMap}
: map or polarized map to maskmaskT::HealpixMap
: mask for first map's intensitymaskP::HealpixMap
: mask for first map's polarization
PowerSpectra.maskedalm2spectra
— MethodCompute spectra from alms of masked maps and alms of the masks themselves.
PowerSpectra.master
— Methodmaster(map₁::PolarizedHealpixMap, maskT₁::HealpixMap, maskP₁::HealpixMap,
map₂::PolarizedHealpixMap, maskT₂::HealpixMap, maskP₂::HealpixMap; already_masked=false)
Perform a mode-decoupling calculation for two polarized maps, along with masks to apply. Returns spectra for $TT$, $TE$, $ET$, $EE$, $EB$, $BE$, and $BB$.
Arguments:
map₁::PolarizedHealpixMap
: the first IQU mapmaskT₁::HealpixMap
: mask for first map's intensitymaskP₁::HealpixMap
: mask for first map's polarizationmap₂::PolarizedHealpixMap
: the second IQU mapmaskT₂::HealpixMap
: mask for second map's intensitymaskP₂::HealpixMap
: mask for second map's polarization
Keywords
already_masked::Bool=false
: are the input maps already multiplied with the masks?lmin::Int=0
: minimum multipole
Returns:
Dict{Symbol,SpectralVector}
: spectraDict
, indexed with:TT
,:TE
,:ET
, etc.
PowerSpectra.mcm
— Methodmcm(spec::Symbol, alm₁::Alm{T}, alm₂::Alm{T}; lmax=nothing)
Compute the mode-coupling matrix. See the Spectral Analysis section in the documentation for examples. These are used by applying the linear solve operator \
to a SpectralArray{T,1}
.
Choices for spec
:
:TT
, identical toM⁰⁰
:TE
, identical to:ET
,:TB
,:BT
,:M⁰²
,:M²⁰
:EE_BB
, returns coupling matrix for stacked EE and BB vectors:EB_BE
, returns coupling matrix for stacked EB and BE vectors:M⁺⁺
, sub-block of spin-2 mode-coupling matrices:M⁻⁻
, sub-block of spin-2 mode-coupling matrices
Arguments:
spec::Symbol
: cross-spectrum of the mode-coupling matrixalm₁::Alm{T}
: first mask's spherical harmonic coefficientsalm₂::Alm{T}
: second mask's spherical harmonic coefficients
Keywords
lmin=0
: minimum multiple for mode-coupling matrixlmax=nothing
: maximum multipole for mode-coupling matrix
Returns:
- the mode coupling matrix. for single symbols, this returns a
SpectralArray{T,2}
. if spec is:EE_BB
or:EB_BE
, returns aBlockSpectralMatrix{T}
with 2×2 blocks.
PowerSpectra.name_alms
— MethodConstruct a NamedTuple with T,E,B names for the alms.
PowerSpectra.nside2lmax
— Methodnside2lmax(nside)
Get the Nyquist frequency from nside, $3n_{\mathrm{side}} - 1$.
PowerSpectra.planck256_map
— Functionplanck256_map(freq, split, col, type::Type=Float64) -> HealpixMap{T, RingOrder}
Returns a Planck 2018 half-mission frequency map downgraded to nside 256 in KCMB units. FITS file column numbers are
- I_STOKES
- Q_STOKES
- U_STOKES
- HITS
- II_COV
- IQ_COV
- IU_COV
- QQ_COV
- QU_COV
- UU_COV
Arguments:
freq::String
: Planck frequency ∈ {"100", "143", "217"}split::String
: half mission split ∈ {"hm1", "hm2"}col::Int
: FITS file column. Either a number, String, or Symbol above.
Returns:
Map{T, RingOrder}
: the map
PowerSpectra.planck256_mask
— Functionplanck256_mask(freq, split, maptype, T::Type=Float64) -> HealpixMap{T}
Arguments:
freq::String
: Planck frequency ∈ {"100", "143", "217"}split::String
: half mission split ∈ {"hm1", "hm2"}maptype
: pass T or P, as a String or Symbol
Returns:
HealpixMap{T, RingOrder}
: the mask
PowerSpectra.quickpolW
— MethodquickpolW(alm₁::Alm{Complex{T}}, alm₂::Alm{Complex{T}})
Computes a scaled spectrum of the scan pattern.
\[W_{\ell'}^{\nu_1,\nu_2,s_1,s_2,j_1,j_2} = \sum_{m^\prime=-\ell^\prime}^{\ell^\prime} \left(_{s_1+\nu_1}\tilde{\omega}^{(j_1)}_{\ell^\prime m^\prime}\right) \left(_{s_2+\nu_2}\tilde{\omega}^{(j_2)}_{\ell^\prime m^\prime}\right)^*\]
PowerSpectra.quickpolΞ!
— MethodquickpolΞ!(𝚵::AA, ν₁, ν₂, s₁, s₂, ω₁, ω₂)
This computes the $\Xi_{\ell^{\prime \prime},\ell}$ matrix. It assumes $\rho$ has been absorbed into the $\omega$ terms.
ω₁
: effective scan weights with spin s₁ + ν₁ω₂
: effective scan weights with spin s₂ + ν₂
PowerSpectra.scale!
— MethodScale a map.
PowerSpectra.spectralones
— Methodspectralones(size1::Int, size2::Int, ...)
spectralones(range1::AbstractRange, range2::AbstractRange, ...)
Utility function for generating a SpectralArray by passing arguments of ranges or sizes, just like ones.
PowerSpectra.spectralzeros
— Methodspectralzeros(size1, size2, ...)
spectralzeros(range1, range2, ...)
Utility function for generating a SpectralArray by passing arguments of ranges or sizes, just like zeros.
PowerSpectra.subtract_monopole_dipole!
— Methodsubtract_monopole_dipole!(map_in, monopole, dipole)
Arguments:
map_in::HealpixMap
: the map to modifymonopole::T
: monopole valuedipole::NTuple{3,T}
: dipole value
PowerSpectra.synalm!
— Methodsynalm!([rng=GLOBAL_RNG], Cl::AbstractArray{T,3}, alms) where T
In-place synthesis of spherical harmonic coefficients, given spectra.
Arguments:
Cl::AbstractArray{T,3}
: array with dimensions of comp, comp, ℓalms::Union{NTuple{N,Alm}, Vector{Alm}}
: array of Alm to fill
Examples
nside = 16
C0 = [3. 2.; 2. 5.]
Cl = repeat(C0, 1, 1, 3nside) # spectra constant with ℓ
alms = [Alm{Complex{Float64}}(3nside-1, 3nside-1) for i in 1:2]
synalm!(Cl, alms)
PowerSpectra.synalm
— Methodsynalm([rng=GLOBAL_RNG], Cl::AbstractArray{T,3}, nside::Int) where T
Arguments:
Cl::AbstractArray{T,3}
: array with dimensions of comp, comp, ℓnside::Int
: healpix resolution
Returns:
Vector{Alm{T}}
: spherical harmonics realizations for each component
Examples
nside = 16
C0 = [3. 2.; 2. 5.]
Cl = repeat(C0, 1, 1, 3nside) # spectra constant with ℓ
alms = synalm(Cl, nside)
PowerSpectra.Ξsum
— MethodΞsum(alm₁, alm₂, w3j₁, w3j₂)
Sum over $\ell$ and $m$ of two $a_{\ell m}$ and nontrivial Wigner-3j vectors. This is a step in computing the $\mathbf{\Xi}$ matrix. The $\rho$ factors are not in this summation, as they can be pulled out.
\[\begin{aligned} (\Xi \mathrm{sum}) &= \sum_{\ell^{\prime} m^{\prime}} \, W_{\ell'}^{\nu_1,\nu_2,s_1,s_2,j_1,j_2} \times \begin{pmatrix} \ell & \ell^{\prime} & \ell^{\prime\prime} \\ -s_1 & s_1+\nu_1 & -\nu_1 \end{pmatrix} \begin{pmatrix} \ell & \ell^{\prime} & \ell^{\prime\prime} \\ -s_2 & s_2+\nu_2 & -\nu_2 \end{pmatrix} \end{aligned}\]
PowerSpectra.@spectra
— Macro@spectra [expr=BlockSpectralMatrix]
Unpack a block vector. This is equivalent to calling getblock
for all the sub-blocks and putting them in a Tuple.
Example
# compute stacked EE,BB mode-coupling matrix from mask alm
M_EE_BB = mcm(:EE_BB, map2alm(mask1), map2alm(mask2))
# apply the 2×2 block mode-coupling matrix to the stacked EE and BB spectra
@spectra Cl_EE, Cl_BB = M_EE_BB \ [pCl_EE; pCl_BB]