simonsobs / LAT_MFLike

Multifrequency Likelihood for SO Large Aperture Telescope
https://lat-mflike.readthedocs.io
Other
4 stars 12 forks source link

correct bandpass construction in the presence of shifts #58

Closed sgiardie closed 1 year ago

sgiardie commented 1 year ago

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.