Skip to content

Commit a5e8922

Browse files
committed
Add ClΦΦ power spectrum
1 parent 9ff17b4 commit a5e8922

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/observables/angular.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,18 +181,22 @@ function spectrum_cmb(modes::AbstractVector, prob::CosmologyProblem, ls::Abstrac
181181
# Integrate perturbations to calculate source function on coarse k-grid
182182
iT = 'T' in join(modes) ? 1 : 0
183183
iE = 'E' in join(modes) ? iT + 1 : 0
184+
= 'Φ' in join(modes) ? iE + 1 : 0
184185
Ss = Num[]
185186
iT > 0 && push!(Ss, prob.M.ST0)
186187
iE > 0 && push!(Ss, prob.M.ST2_polarization)
188+
> 0 && push!(Ss, prob.M.SΦ)
187189
Ss_coarse = source_grid(prob, Ss, τs, ks_coarse; bgopts, ptopts, thread, verbose) # TODO: pass kτ0 and x # TODO: pass bgsol
188190

189191
# Interpolate source function to finer k-grid
190192
ks_fine = collect(kτ0s_fine ./ τ0)
191193
ks_fine = clamp.(ks_fine, ks_coarse[begin], ks_coarse[end]) # TODO: ideally avoid
192194
Ss_fine = source_grid(Ss_coarse, ks_coarse, ks_fine)
195+
Ss_fine[:,end,:] .= 0
193196

194197
ΘlTs = iT > 0 ? los_integrate(@view(Ss_fine[iT, :, :]), ls, τs, ks_fine, jl; integrator, verbose, kwargs...) : nothing
195198
ΘlEs = iE > 0 ? los_integrate(@view(Ss_fine[iE, :, :]), ls, τs, ks_fine, jl_x2; integrator, verbose, kwargs...) .* transpose(@. ((ls+2)*(ls+1)*(ls+0)*(ls-1))) : nothing
199+
ΘlΦs => 0 ? los_integrate(@view(Ss_fine[iΦ, :, :]), ls, τs, ks_fine, jl; integrator, verbose, kwargs...) : nothing
196200

197201
P0s = spectrum_primordial(ks_fine, sol) # more accurate
198202

@@ -212,6 +216,8 @@ function spectrum_cmb(modes::AbstractVector, prob::CosmologyProblem, ls::Abstrac
212216
spectrum = spectrum_cmb(ΘlEs, ΘlEs, P0s, ls, ks_fine; integrator, normalization)
213217
elseif mode == :TE
214218
spectrum = spectrum_cmb(ΘlTs, ΘlEs, P0s, ls, ks_fine; integrator, normalization)
219+
elseif mode == :ΦΦ
220+
spectrum = spectrum_cmb(ΘlΦs, ΘlΦs, P0s, ls, ks_fine; integrator, normalization)
215221
else
216222
error("Unknown CMB power spectrum mode $mode")
217223
end

0 commit comments

Comments
 (0)