Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correct bandpass construction in the presence of shifts #58

Merged
merged 1 commit into from
Apr 25, 2023

Conversation

sgiardie
Copy link
Collaborator

There is a mistake in the current construction of the transmission from the bandpasses, in the presence of bandpass shift.
In the current version we are doing:

nub = nu_ghz + params[bandpar] <--- freqs nu_ghz shifted by params['bandpass_shift'] sampled by cobaya
trans_norm = np.trapz(bp * _cmb2bb(nu_ghz), nu_ghz) <--- integral of the bandpass bp and the conversion factor from cmb to brightness temperature
trans = bp / trans_norm * _cmb2bb(nub) <--- trasmission normalized by the integral trans_norm
self.bandint_freqs.append([nub, trans])

while we should do:

nub = nu_ghz + params[bandpar]
trans_norm = np.trapz(bp * _cmb2bb(nub), nub)
trans = bp / trans_norm * _cmb2bb(nub)
self.bandint_freqs.append([nub, trans])

so we should use the shifted frequency array nub both at the numerator and the denominator of trans
This way, we assume that the cmb component would always have trans = 1 (since the cmb component can come out of the integral and the numerator and denominator can simplify)
This is implicitly what we are already doing by summing the cmb theory spectra to the foreground spectra integrated in band:
cmbfg_dict[s, exp1, exp2] = Dls[s] + fg_dict[s, "all", exp1, exp2]

The current version works fine when bandpass_shifts = 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants