-
Notifications
You must be signed in to change notification settings - Fork 12
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
Implementing beam chromaticity #76
Conversation
@sgiardie Can you try this
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #76 +/- ##
==========================================
+ Coverage 85.24% 85.45% +0.21%
==========================================
Files 3 3
Lines 454 550 +96
==========================================
+ Hits 387 470 +83
- Misses 67 80 +13
|
That worked, thanks! |
We changed a bit the approach since the beginning of this PR, due to discussions with @AdriJD.
There is still the option to read precomputed chromatic beams from an external file, which is activated in
Finally, we changed the way we deal with bandpass shifts. Before, we were applying the Gaussian correction expected for
This yaml file should be saved in the cobaya data directory and will be read by
In the absence of measurements of these |
Recent changes to this branch: I have aligned it to the current mflike master and allowed the choice of leaving the beams unchanged in case of bandpass shifts (keeping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made some kozmetix comments but since the current unit test still pass (and you have added a new test for beam chromaticity), I guess we are safe. I'm only a bit concerned by the mflike_utils/utils.py
script (see comment below)
#reading the Delta nu list in the file | ||
dnulist = np.array([float(dn) for dn in bandsh_beams["beams"].keys()]) | ||
#finding the Delta nu closer to the sampled one | ||
Dnu = dnulist[abs(dnulist - dnu).argmin()] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the use of abs
function was not going to work because it had to deal with numpy
array and a scalar float but it actually works and it is as fast as np.abs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you prefer I can change it to np.abs!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
This PR introduces the beam chromaticity effect in mflike. This means considering the frequency dependence of beams (both in temperature and polarization)$b^{T/P}_{\ell}(\nu)$ and computing the foreground SEDs by taking that into account: $ \frac{\int d\nu \frac{\partial B_{\nu}(\nu)}{\partial T} \tau(\nu) b^{T/P}_{\ell}(\nu) f^{T/P}_{SED}(\nu)}{\int d\nu \frac{\partial B_{\nu}(\nu)}{\partial T} \tau(\nu) b^{T/P}_{\ell}(\nu) }$ (where $\tau(\nu)$ is the bandpass and $\frac{\partial B_{\nu}(\nu)}{\partial T} $ is the derivative of the black body emission). Since this integral is computed in $\frac{\frac{\partial B_{\nu}(\nu)}{\partial T} \tau(\nu) b^{T/P}_{\ell}(\nu) }{\int d\nu \frac{\partial B_{\nu}(\nu)}{\partial T} \tau(\nu) b^{T/P}_{\ell}(\nu) }$ to have dimension
fgspectra
, we modified alsofgspectra/frequency.py
to allow the transmission factor(freqs, ells)
.Since we need to differentiate between temperature and polarization beam, we now need to distinguish between the transmission factors in T/P. This also means having to introduce a new class in
fgspectra/cross.py
,FactorizedCrossSpectrumTE
, to separately pass the different transmissions for T and E for the same cross spectrum.There are three ways to provide the beams for each frequency array/experiment: computing them in the code as simple Gaussian beams, reading them from external file or reading them from the data sacc file (currently this would require modifications to
sacc
, since sacc does not allow anarray(freqs, ells)
to be passed as a beam tracertracer.beam
. If we cannot modify that, we should drop the option to read from sacc, or find another way to do that). This choice is done by selecting the appropriate options in theMFLike.py
blockbeam_profile
.We also introduced a correction factor to apply to the beam profiles in the presence of bandpass shift:$b^{T/P}_{\ell}(\nu+\Delta \nu) \simeq b^{T/P}_{\ell}(\nu) b^{T/P, Gauss \, corr}_{\ell}(\nu, \Delta \nu)$ . For simplicity, this is the correction factor expected for a Gaussian beam.