From b9e1aeb41ebf63c076b2d31b16b58c5e2f375018 Mon Sep 17 00:00:00 2001 From: sgiardie Date: Wed, 4 Sep 2024 16:11:23 +0100 Subject: [PATCH 1/2] fixing example file + allowing lmax_theory to set ell range --- examples/mflike_example.yaml | 2 +- mflike/mflike.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/mflike_example.yaml b/examples/mflike_example.yaml index daffc22..d54fd65 100644 --- a/examples/mflike_example.yaml +++ b/examples/mflike_example.yaml @@ -3,7 +3,7 @@ debug: True likelihood: - mflike.MFLike: + mflike.TTTEEE: input_file: LAT_simu_sacc_00044.fits cov_Bbl_file: data_sacc_w_covar_and_Bbl.fits diff --git a/mflike/mflike.py b/mflike/mflike.py index b99ac8a..4443617 100644 --- a/mflike/mflike.py +++ b/mflike/mflike.py @@ -105,7 +105,7 @@ def initialize(self): self.log.info("Initialized!") def get_fg_requirements(self): - return {"ells": self.l_bpws, + return {"ells": self.l_bpws[:self.lmax_theory + 1], "requested_cls": self.requested_cls, "experiments": self.experiments, "bands": self.bands} @@ -119,7 +119,8 @@ def get_requirements(self): """ return {"fg_totals": self.get_fg_requirements(), - "Cl": {k: max(c, self.lmax_theory + 1) for k, c in self.lcuts.items()}} + "Cl": {k: self.lmax_theory + 1 for k, _ in self.lcuts.items()}} + #"Cl": {k: max(c, self.lmax_theory + 1) for k, c in self.lcuts.items()}} def logp(self, **params_values): cl = self.provider.get_Cl(ell_factor=True) From 156763fb7795998ac28176d767a9dbdf1c5b2021 Mon Sep 17 00:00:00 2001 From: sgiardie Date: Thu, 5 Sep 2024 11:28:15 +0100 Subject: [PATCH 2/2] expanding docs --- mflike/foreground.py | 24 ++++++++++++++++++------ mflike/mflike.py | 2 +- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/mflike/foreground.py b/mflike/foreground.py index 538de9d..420f46c 100644 --- a/mflike/foreground.py +++ b/mflike/foreground.py @@ -7,8 +7,18 @@ If one wants to use this class as standalone, the ``bands`` dictionary is filled when initializing ``BandpowerForeground``. -The values of the systematic parameters are set in ``MFLike.yaml``. They have to be named as -``cal/calT/calE/alpha`` + ``_`` + experiment_channel string (e.g. ``LAT_93/dr6_pa4_f150``). +The default values of the systematic parameters are set in the ``TTTEEE/TEEE/TT/EE/TE/etc.yaml`` files. They have to be named as ``cal/calT/calE/alpha`` + ``_`` + experiment_channel string (e.g. ``LAT_93/dr6_pa4_f150``). +The default values of the foreground parameters are set in the ``fg_TT/TE/EE.yaml`` files. +If you want to set different parameters settings, do that in the ``params`` block of the ``yaml`` file you will use for running (see the `examples/mflike_example.yaml `_). + +.. note:: + Note that when you set different foregrounds/systematics parameters in the ``params`` block + of your running ``yaml``, Cobaya will use the new parameters settings you indicated. If you + don't change a parameter setting in the ``params`` block, Cobaya will use its default stored + in the files mentioned above. Note that, in the ``.updated.yaml`` file generated by Cobaya, + the ``mflike.BandpowerForeground`` theory block will have a ``params`` block with all the + foreground parameters default settings which may be different from what you are defining in + the general ``params`` block. The bandpass shifts are applied within the ``_bandpass_construction`` function. There are two possibilities: @@ -16,7 +26,7 @@ (which is the default now) * building the passbands :math:`\tau(\nu)`, either as Dirac delta or as top-hat -For the second option, the ``top_hat_band`` dictionary in ``MFLike.yaml`` has to be filled with two keys: +For the second option, the ``top_hat_band`` dictionary under the ``mflike.BandpowerForeground`` theory block has to be filled with two keys: * ``nsteps``: setting the number of frequencies used in the band integration (either 1 for a Dirac delta or > 1) * ``bandwidth``: setting the relative width :math:`\delta` of the band with respect to @@ -32,9 +42,11 @@ .. code-block:: yaml - top_hat_band: - nsteps: 1 - bandwidth: 0 + theory: + mflike.BandpowerForeground: + top_hat_band: + nsteps: 1 + bandwidth: 0 """ diff --git a/mflike/mflike.py b/mflike/mflike.py index 4443617..1201c36 100644 --- a/mflike/mflike.py +++ b/mflike/mflike.py @@ -33,7 +33,7 @@ If left ``null``, no systematic template is applied. -The values of the systematic parameters are set in ``MFLike.yaml``. They have to be named as +The values of the systematic parameters are set in the ``TTTEEE/TTTE/TT/EE/TE/etc.yaml`` fils corresponding to the classes that inherit the ``_MFLike`` one. They have to be named as ``cal/calT/calE/alpha`` + ``_`` + experiment_channel string (e.g. ``LAT_93/dr6_pa4_f150``). """