From 86bd95adddf193e63bdb2dba8fabee6bd5500556 Mon Sep 17 00:00:00 2001 From: Matthieu Tristram Date: Mon, 11 Dec 2023 13:50:07 +0100 Subject: [PATCH 01/26] Montepython wrapper for Hillipop and Lollipop --- .../Planck20_Hillipop_TT.data | 15 +++++ .../Planck20_Hillipop_TT.py | 57 ++++++++++++++++++ .../likelihoods/Planck20_Hillipop_TT/README | 25 ++++++++ .../Planck20_Hillipop_TT/__init__.py | 1 + .../Planck20_Hillipop_TTTEEE.data | 19 ++++++ .../Planck20_Hillipop_TTTEEE.py | 58 +++++++++++++++++++ .../Planck20_Hillipop_TTTEEE/README | 25 ++++++++ .../Planck20_Hillipop_TTTEEE/__init__.py | 1 + .../Planck20_Lollipop_BB.data | 10 ++++ .../Planck20_Lollipop_BB.py | 58 +++++++++++++++++++ .../likelihoods/Planck20_Lollipop_BB/README | 23 ++++++++ .../Planck20_Lollipop_BB/__init__.py | 1 + .../Planck20_Lollipop_EB.data | 10 ++++ .../Planck20_Lollipop_EB.py | 58 +++++++++++++++++++ .../likelihoods/Planck20_Lollipop_EB/README | 23 ++++++++ .../Planck20_Lollipop_EB/__init__.py | 1 + .../Planck20_Lollipop_EE.data | 10 ++++ .../Planck20_Lollipop_EE.py | 58 +++++++++++++++++++ .../likelihoods/Planck20_Lollipop_EE/README | 23 ++++++++ .../Planck20_Lollipop_EE/__init__.py | 1 + 20 files changed, 477 insertions(+) create mode 100755 montepython/likelihoods/Planck20_Hillipop_TT/Planck20_Hillipop_TT.data create mode 100644 montepython/likelihoods/Planck20_Hillipop_TT/Planck20_Hillipop_TT.py create mode 100644 montepython/likelihoods/Planck20_Hillipop_TT/README create mode 100644 montepython/likelihoods/Planck20_Hillipop_TT/__init__.py create mode 100755 montepython/likelihoods/Planck20_Hillipop_TTTEEE/Planck20_Hillipop_TTTEEE.data create mode 100644 montepython/likelihoods/Planck20_Hillipop_TTTEEE/Planck20_Hillipop_TTTEEE.py create mode 100644 montepython/likelihoods/Planck20_Hillipop_TTTEEE/README create mode 100644 montepython/likelihoods/Planck20_Hillipop_TTTEEE/__init__.py create mode 100755 montepython/likelihoods/Planck20_Lollipop_BB/Planck20_Lollipop_BB.data create mode 100644 montepython/likelihoods/Planck20_Lollipop_BB/Planck20_Lollipop_BB.py create mode 100644 montepython/likelihoods/Planck20_Lollipop_BB/README create mode 100644 montepython/likelihoods/Planck20_Lollipop_BB/__init__.py create mode 100755 montepython/likelihoods/Planck20_Lollipop_EB/Planck20_Lollipop_EB.data create mode 100644 montepython/likelihoods/Planck20_Lollipop_EB/Planck20_Lollipop_EB.py create mode 100644 montepython/likelihoods/Planck20_Lollipop_EB/README create mode 100644 montepython/likelihoods/Planck20_Lollipop_EB/__init__.py create mode 100755 montepython/likelihoods/Planck20_Lollipop_EE/Planck20_Lollipop_EE.data create mode 100644 montepython/likelihoods/Planck20_Lollipop_EE/Planck20_Lollipop_EE.py create mode 100644 montepython/likelihoods/Planck20_Lollipop_EE/README create mode 100644 montepython/likelihoods/Planck20_Lollipop_EE/__init__.py diff --git a/montepython/likelihoods/Planck20_Hillipop_TT/Planck20_Hillipop_TT.data b/montepython/likelihoods/Planck20_Hillipop_TT/Planck20_Hillipop_TT.data new file mode 100755 index 00000000..c560a8a3 --- /dev/null +++ b/montepython/likelihoods/Planck20_Hillipop_TT/Planck20_Hillipop_TT.data @@ -0,0 +1,15 @@ +Planck20_Hillipop_TT.data_directory = '' +Planck20_Hillipop_TT.file = '' + +Planck20_Hillipop_TT.use_nuisance = ['A_planck','cal100A','cal100B','cal143A','cal143B','cal217A','cal217B','Aradio','Adusty','AdustT','Acib','Atsz','Aksz','Aksz','xi','beta_dustT','beta_radio','beta_dusty','beta_cib'] + +Planck20_Hillipop_TT.A_planck_prior_center = 1 +Planck20_Hillipop_TT.A_planck_prior_std = 0.0025 +Planck20_Hillipop_TT.AdustT_prior_center = 1.0 +Planck20_Hillipop_TT.AdustT_prior_std = 0.1 +Planck20_Hillipop_TT.beta_dustT_prior_center = 1.51 +Planck20_Hillipop_TT.beta_dustT_prior_std = 0.01 +Planck20_Hillipop_TT.beta_cib_prior_center = 1.75 +Planck20_Hillipop_TT.beta_cib_prior_std = 0.06 +Planck20_Hillipop_TT.beta_dusty_prior_center = 1.75 +Planck20_Hillipop_TT.beta_dusty_prior_std = 0.06 diff --git a/montepython/likelihoods/Planck20_Hillipop_TT/Planck20_Hillipop_TT.py b/montepython/likelihoods/Planck20_Hillipop_TT/Planck20_Hillipop_TT.py new file mode 100644 index 00000000..76f386db --- /dev/null +++ b/montepython/likelihoods/Planck20_Hillipop_TT/Planck20_Hillipop_TT.py @@ -0,0 +1,57 @@ +from montepython.likelihood_class import Likelihood +import numpy as np +import planck_2020_hillipop +import os +import tempfile + +packages_path = os.environ.get("COBAYA_PACKAGES_PATH") or os.path.join( + tempfile.gettempdir(), "Hillipop_packages" +) + +class Planck20_Hillipop_TT(Likelihood): + def __init__(self, path, data, command_line): + Likelihood.__init__(self, path, data, command_line) + + #Create Cobaya likelihood + self.lik = planck_2020_hillipop.TT({"packages_path": packages_path}) + + self.need_cosmo_arguments( + data, {'lensing': 'yes', 'output': 'tCl pCl lCl', 'non_linear': 'halofit', 'l_max_scalars': self.lik.lmax}) + + print( "Init Hillipop TT done !") + + def loglkl(self, cosmo, data): + + print( {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['cosmo'])}) + cls = self.get_cl(cosmo) + + fac = cls['ell'] * (cls['ell']+1) / (2*np.pi) + dl = {mode:np.zeros(self.lik.lmax+1) for mode in ['TT','TE','EE']} + for mode in ['TT','TE','EE']: + dl[mode][cls['ell']] = fac*cls[mode.lower()] + + data_params = {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['nuisance'])} + print(data_params) + + lkl = self.lik.loglike(dl, **data_params) + print( lkl) + + lkl = self.add_nuisance_prior(lkl, data) + + return lkl + + + def add_nuisance_prior(self, lkl, data): + # Recover the current value of the nuisance parameter. + for nuisance in self.use_nuisance: + nuisance_value = float( + data.mcmc_parameters[nuisance]['current'] * + data.mcmc_parameters[nuisance]['scale']) + + # add prior on nuisance parameters + if hasattr(self, "%s_prior_center" % nuisance) and getattr(self, "%s_prior_std" % nuisance) > 0: + # convenience variables + prior_center = getattr(self, "%s_prior_center" % nuisance) + prior_std = getattr(self, "%s_prior_std" % nuisance) + lkl += -0.5*((nuisance_value-prior_center)/prior_std)**2 + return lkl diff --git a/montepython/likelihoods/Planck20_Hillipop_TT/README b/montepython/likelihoods/Planck20_Hillipop_TT/README new file mode 100644 index 00000000..c5092ba6 --- /dev/null +++ b/montepython/likelihoods/Planck20_Hillipop_TT/README @@ -0,0 +1,25 @@ +Hillipop is a high-l polarized likelihood for Planck PR4 data. + +Hillipop is a multifrequency CMB likelihood for Planck data. The +likelihood is a spectrum-based Gaussian approximation for +cross-correlation spectra from Planck 100, 143 and 217GHz +split-frequency maps, with semi-analytic estimates of the Cl +covariance matrix based on the data. The cross-spectra are debiased +from the effects of the mask and the beam leakage using Xpol (a +generalization to polarization of the algorithm presented in Tristram +et al. 2005) before being compared to the model, which includes CMB +and foreground residuals. They cover the multipoles from ~=30 to ~=2500. + +The code is available here: +https://github.com/planck-npipe/hillipop + +This is a wrapper for MontePython. + +You need to install the code before: +> pip install planck-2020-hillipop + +Then get the data, untar and set the variable $COBAYA_PACKAGES_PATH to the local directory: +> wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_hillipop_TT_v4.2.tar.gz +> tar -zxvf planck_2020_hillipop_TT_v4.2.tar.gz --directory /path/to/data +> export COBAYA_PACKAGES_PATH=/path/to/data + diff --git a/montepython/likelihoods/Planck20_Hillipop_TT/__init__.py b/montepython/likelihoods/Planck20_Hillipop_TT/__init__.py new file mode 100644 index 00000000..856bad55 --- /dev/null +++ b/montepython/likelihoods/Planck20_Hillipop_TT/__init__.py @@ -0,0 +1 @@ +from .Planck20_Hillipop_TT import Planck20_Hillipop_TT diff --git a/montepython/likelihoods/Planck20_Hillipop_TTTEEE/Planck20_Hillipop_TTTEEE.data b/montepython/likelihoods/Planck20_Hillipop_TTTEEE/Planck20_Hillipop_TTTEEE.data new file mode 100755 index 00000000..cbd1e7d3 --- /dev/null +++ b/montepython/likelihoods/Planck20_Hillipop_TTTEEE/Planck20_Hillipop_TTTEEE.data @@ -0,0 +1,19 @@ +Planck20_Hillipop_TTTEEE.data_directory = '' +Planck20_Hillipop_TTTEEE.file = '' + +Planck20_Hillipop_TTTEEE.use_nuisance = ['A_planck','cal100A','cal100B','cal143A','cal143B','cal217A','cal217B','Aradio','Adusty','AdustT','AdustP','Acib','Atsz','Aksz','Aksz','xi','beta_radio','beta_dusty','beta_cib','beta_dustT','beta_dustP'] + +Planck20_Hillipop_TTTEEE.A_planck_prior_center = 1 +Planck20_Hillipop_TTTEEE.A_planck_prior_std = 0.0025 +Planck20_Hillipop_TTTEEE.beta_cib_prior_center = 1.75 +Planck20_Hillipop_TTTEEE.beta_cib_prior_std = 0.06 +Planck20_Hillipop_TTTEEE.beta_dusty_prior_center = 1.75 +Planck20_Hillipop_TTTEEE.beta_dusty_prior_std = 0.06 +Planck20_Hillipop_TTTEEE.AdustT_prior_center = 1.0 +Planck20_Hillipop_TTTEEE.AdustT_prior_std = 0.1 +Planck20_Hillipop_TTTEEE.beta_dustT_prior_center = 1.51 +Planck20_Hillipop_TTTEEE.beta_dustT_prior_std = 0.01 +Planck20_Hillipop_TTTEEE.AdustP_prior_center = 1.0 +Planck20_Hillipop_TTTEEE.AdustP_prior_std = 0.1 +Planck20_Hillipop_TTTEEE.beta_dustP_prior_center = 1.59 +Planck20_Hillipop_TTTEEE.beta_dustP_prior_std = 0.02 diff --git a/montepython/likelihoods/Planck20_Hillipop_TTTEEE/Planck20_Hillipop_TTTEEE.py b/montepython/likelihoods/Planck20_Hillipop_TTTEEE/Planck20_Hillipop_TTTEEE.py new file mode 100644 index 00000000..fe996787 --- /dev/null +++ b/montepython/likelihoods/Planck20_Hillipop_TTTEEE/Planck20_Hillipop_TTTEEE.py @@ -0,0 +1,58 @@ +from montepython.likelihood_class import Likelihood +import numpy as np +import planck_2020_hillipop +import os +import tempfile + +packages_path = os.environ.get("COBAYA_PACKAGES_PATH") or os.path.join( + tempfile.gettempdir(), "Hillipop_packages" +) + +class Planck20_Hillipop_TTTEEE(Likelihood): + def __init__(self, path, data, command_line): + Likelihood.__init__(self, path, data, command_line) + + #Create Cobaya likelihood + self.lik = planck_2020_hillipop.TTTEEE({"packages_path": packages_path}) + + self.need_cosmo_arguments( + data, {'lensing': 'yes', 'output': 'tCl pCl lCl', 'non_linear': 'halofit', 'l_max_scalars': self.lik.lmax}) + + print( "Init Hillipop TTTEEE done !") + + def loglkl(self, cosmo, data): + + cls = self.get_cl(cosmo) + + fac = cls['ell'] * (cls['ell']+1) / (2*np.pi) + dl = {mode:np.zeros(self.lik.lmax+1) for mode in ['TT','TE','EE']} + for mode in ['TT','TE','EE']: + dl[mode][cls['ell']] = fac*cls[mode.lower()] + + data_params = {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['nuisance'])} + for par in ['pe100A','pe100B','pe143A','pe143B']: data_params[par] = 1.0 + data_params['pe217A'] = data_params['pe217B'] = 0.975 + + print(data_params) + + lkl = self.lik.loglike(dl, **data_params) + + lkl = self.add_nuisance_prior(lkl, data) + + return lkl + + + def add_nuisance_prior(self, lkl, data): + # Recover the current value of the nuisance parameter. + for nuisance in self.use_nuisance: + nuisance_value = float( + data.mcmc_parameters[nuisance]['current'] * + data.mcmc_parameters[nuisance]['scale']) + + # add prior on nuisance parameters + if hasattr(self, "%s_prior_center" % nuisance) and getattr(self, "%s_prior_std" % nuisance) > 0: + # convenience variables + prior_center = getattr(self, "%s_prior_center" % nuisance) + prior_std = getattr(self, "%s_prior_std" % nuisance) + lkl += -0.5*((nuisance_value-prior_center)/prior_std)**2 + return lkl diff --git a/montepython/likelihoods/Planck20_Hillipop_TTTEEE/README b/montepython/likelihoods/Planck20_Hillipop_TTTEEE/README new file mode 100644 index 00000000..c6cc1bf7 --- /dev/null +++ b/montepython/likelihoods/Planck20_Hillipop_TTTEEE/README @@ -0,0 +1,25 @@ +Hillipop is a high-l polarized likelihood for Planck PR4 data. + +Hillipop is a multifrequency CMB likelihood for Planck data. The +likelihood is a spectrum-based Gaussian approximation for +cross-correlation spectra from Planck 100, 143 and 217GHz +split-frequency maps, with semi-analytic estimates of the Cl +covariance matrix based on the data. The cross-spectra are debiased +from the effects of the mask and the beam leakage using Xpol (a +generalization to polarization of the algorithm presented in Tristram +et al. 2005) before being compared to the model, which includes CMB +and foreground residuals. They cover the multipoles from ~=30 to ~=2500. + +The code is available here: +https://github.com/planck-npipe/hillipop + +This is a wrapper for MontePython. + +You need to install the code before: +> pip install planck-2020-hillipop + +Then get the data, untar and set the variable $COBAYA_PACKAGES_PATH to the local directory: +> wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_hillipop_TTTEEE_v4.2.tar.gz +> tar -zxvf planck_2020_hillipop_TTTEEE_v4.2.tar.gz --directory /path/to/data +> export COBAYA_PACKAGES_PATH=/path/to/data + diff --git a/montepython/likelihoods/Planck20_Hillipop_TTTEEE/__init__.py b/montepython/likelihoods/Planck20_Hillipop_TTTEEE/__init__.py new file mode 100644 index 00000000..5c60eb8e --- /dev/null +++ b/montepython/likelihoods/Planck20_Hillipop_TTTEEE/__init__.py @@ -0,0 +1 @@ +from .Planck20_Hillipop_TTTEEE import Planck20_Hillipop_TTTEEE diff --git a/montepython/likelihoods/Planck20_Lollipop_BB/Planck20_Lollipop_BB.data b/montepython/likelihoods/Planck20_Lollipop_BB/Planck20_Lollipop_BB.data new file mode 100755 index 00000000..42efd7c6 --- /dev/null +++ b/montepython/likelihoods/Planck20_Lollipop_BB/Planck20_Lollipop_BB.data @@ -0,0 +1,10 @@ +Planck20_Lollipop_BB.data_directory = '' +Planck20_Lollipop_BB.file = '' + +Planck20_Lollipop_BB.Nsim = 400 +Planck20_Lollipop_BB.lmin = 2 +Planck20_Lollipop_BB.lmax = 150 +Planck20_Lollipop_BB.use_nuisance = ['A_planck'] + +Planck20_Lollipop_BB.A_planck_prior_center = 1 +Planck20_Lollipop_BB.A_planck_prior_std = 0.0025 diff --git a/montepython/likelihoods/Planck20_Lollipop_BB/Planck20_Lollipop_BB.py b/montepython/likelihoods/Planck20_Lollipop_BB/Planck20_Lollipop_BB.py new file mode 100644 index 00000000..71188486 --- /dev/null +++ b/montepython/likelihoods/Planck20_Lollipop_BB/Planck20_Lollipop_BB.py @@ -0,0 +1,58 @@ +from montepython.likelihood_class import Likelihood +import numpy as np +import planck_2020_lollipop +import os +import tempfile + +packages_path = os.environ.get("COBAYA_PACKAGES_PATH") or os.path.join( + tempfile.gettempdir(), "Lollipop_packages" +) + +hartlap_factor = False +marginalised_over_covariance = True + + +class Planck20_Lollipop_BB(Likelihood): + def __init__(self, path, data, command_line): + Likelihood.__init__(self, path, data, command_line) + + #Create Cobaya likelihood + self.lik = planck_2020_lollipop.lowlB({"packages_path": packages_path, "Nsim": self.Nsim, "lmin":self.lmin, "lmax":self.lmax}) + + self.need_cosmo_arguments( + data, {'lensing': 'yes', 'output': 'pCl lCl', 'non_linear': 'halofit', 'l_max_scalars': self.lik.bins.lmax}) + + print( "Init Lollipop (lowlB) done !") + + def loglkl(self, cosmo, data): + + print( {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['cosmo'])}) + cls = self.get_cl(cosmo) + + data_params = {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['nuisance'])} + print(data_params) + + lkl = self.lik.loglike(cls, **data_params) + print( lkl) + + lkl = self.add_nuisance_prior(lkl, data) + + return lkl + + + def add_nuisance_prior(self, lkl, data): + # Recover the current value of the nuisance parameter. + for nuisance in self.use_nuisance: + nuisance_value = float( + data.mcmc_parameters[nuisance]['current'] * + data.mcmc_parameters[nuisance]['scale']) + + # add prior on nuisance parameters + if hasattr(self, "%s_prior_center" % nuisance) and getattr(self, "%s_prior_std" % nuisance) > 0: + # convenience variables + prior_center = getattr(self, "%s_prior_center" % nuisance) + prior_std = getattr(self, "%s_prior_std" % nuisance) + lkl += -0.5*((nuisance_value-prior_center)/prior_std)**2 + return lkl + + diff --git a/montepython/likelihoods/Planck20_Lollipop_BB/README b/montepython/likelihoods/Planck20_Lollipop_BB/README new file mode 100644 index 00000000..c84a951f --- /dev/null +++ b/montepython/likelihoods/Planck20_Lollipop_BB/README @@ -0,0 +1,23 @@ +Lollipop is a low-l polarized likelihood for Planck PR4 data. + +Lollipop is a Planck low-l polarization likelihood based on +cross-power-spectra for which the bias is zero when the noise is +uncorrelated between maps. It uses the approximation presented in +Hamimeche & Lewis (2008), modified as described in Mangilli et +al. (2015) to apply to cross-power spectra. This version is based on +the Planck PR4 data. Cross-spectra are computed on the CMB maps from +Commander component separation applied on each detset-split Planck +frequency maps. + +The code is available here: +https://github.com/planck-npipe/lollipop + +This is a wrapper for MontePython. + +You need to install the code before: +> pip install planck-2020-lollipop + +Then get the data, untar and set the variable $COBAYA_PACKAGES_PATH to the local directory: +> wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_lollipop.tar.gz +> tar -zxvf planck_2020_lollipop.tar.gz --directory /path/to/data +> export COBAYA_PACKAGES_PATH=/path/to/data diff --git a/montepython/likelihoods/Planck20_Lollipop_BB/__init__.py b/montepython/likelihoods/Planck20_Lollipop_BB/__init__.py new file mode 100644 index 00000000..e17c047f --- /dev/null +++ b/montepython/likelihoods/Planck20_Lollipop_BB/__init__.py @@ -0,0 +1 @@ +from .Planck20_Lollipop_BB import Planck20_Lollipop_BB diff --git a/montepython/likelihoods/Planck20_Lollipop_EB/Planck20_Lollipop_EB.data b/montepython/likelihoods/Planck20_Lollipop_EB/Planck20_Lollipop_EB.data new file mode 100755 index 00000000..bb912e43 --- /dev/null +++ b/montepython/likelihoods/Planck20_Lollipop_EB/Planck20_Lollipop_EB.data @@ -0,0 +1,10 @@ +Planck20_Lollipop_EB.data_directory = '' +Planck20_Lollipop_EB.file = '' + +Planck20_Lollipop_EB.Nsim = 400 +Planck20_Lollipop_EB.lmin = 2 +Planck20_Lollipop_EB.lmax = 30 +Planck20_Lollipop_EB.use_nuisance = ['A_planck'] + +Planck20_Lollipop_EB.A_planck_prior_center = 1 +Planck20_Lollipop_EB.A_planck_prior_std = 0.0025 diff --git a/montepython/likelihoods/Planck20_Lollipop_EB/Planck20_Lollipop_EB.py b/montepython/likelihoods/Planck20_Lollipop_EB/Planck20_Lollipop_EB.py new file mode 100644 index 00000000..ba5374aa --- /dev/null +++ b/montepython/likelihoods/Planck20_Lollipop_EB/Planck20_Lollipop_EB.py @@ -0,0 +1,58 @@ +from montepython.likelihood_class import Likelihood +import numpy as np +import planck_2020_lollipop +import os +import tempfile + +packages_path = os.environ.get("COBAYA_PACKAGES_PATH") or os.path.join( + tempfile.gettempdir(), "Lollipop_packages" +) + +hartlap_factor = False +marginalised_over_covariance = True + + +class Planck20_Lollipop_EB(Likelihood): + def __init__(self, path, data, command_line): + Likelihood.__init__(self, path, data, command_line) + + #Create Cobaya likelihood + self.lik = planck_2020_lollipop.lowlEB({"packages_path": packages_path, "Nsim": self.Nsim, "lmin":self.lmin, "lmax":self.lmax}) + + self.need_cosmo_arguments( + data, {'lensing': 'yes', 'output': 'pCl lCl', 'non_linear': 'halofit', 'l_max_scalars': self.lik.bins.lmax}) + + print( "Init Lollipop (lowlEB) done !") + + def loglkl(self, cosmo, data): + + print( {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['cosmo'])}) + cls = self.get_cl(cosmo) + + data_params = {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['nuisance'])} + print(data_params) + + lkl = self.lik.loglike(cls, **data_params) + print( lkl) + + lkl = self.add_nuisance_prior(lkl, data) + + return lkl + + + def add_nuisance_prior(self, lkl, data): + # Recover the current value of the nuisance parameter. + for nuisance in self.use_nuisance: + nuisance_value = float( + data.mcmc_parameters[nuisance]['current'] * + data.mcmc_parameters[nuisance]['scale']) + + # add prior on nuisance parameters + if hasattr(self, "%s_prior_center" % nuisance) and getattr(self, "%s_prior_std" % nuisance) > 0: + # convenience variables + prior_center = getattr(self, "%s_prior_center" % nuisance) + prior_std = getattr(self, "%s_prior_std" % nuisance) + lkl += -0.5*((nuisance_value-prior_center)/prior_std)**2 + return lkl + + diff --git a/montepython/likelihoods/Planck20_Lollipop_EB/README b/montepython/likelihoods/Planck20_Lollipop_EB/README new file mode 100644 index 00000000..c84a951f --- /dev/null +++ b/montepython/likelihoods/Planck20_Lollipop_EB/README @@ -0,0 +1,23 @@ +Lollipop is a low-l polarized likelihood for Planck PR4 data. + +Lollipop is a Planck low-l polarization likelihood based on +cross-power-spectra for which the bias is zero when the noise is +uncorrelated between maps. It uses the approximation presented in +Hamimeche & Lewis (2008), modified as described in Mangilli et +al. (2015) to apply to cross-power spectra. This version is based on +the Planck PR4 data. Cross-spectra are computed on the CMB maps from +Commander component separation applied on each detset-split Planck +frequency maps. + +The code is available here: +https://github.com/planck-npipe/lollipop + +This is a wrapper for MontePython. + +You need to install the code before: +> pip install planck-2020-lollipop + +Then get the data, untar and set the variable $COBAYA_PACKAGES_PATH to the local directory: +> wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_lollipop.tar.gz +> tar -zxvf planck_2020_lollipop.tar.gz --directory /path/to/data +> export COBAYA_PACKAGES_PATH=/path/to/data diff --git a/montepython/likelihoods/Planck20_Lollipop_EB/__init__.py b/montepython/likelihoods/Planck20_Lollipop_EB/__init__.py new file mode 100644 index 00000000..8c9ab70d --- /dev/null +++ b/montepython/likelihoods/Planck20_Lollipop_EB/__init__.py @@ -0,0 +1 @@ +from .Planck20_Lollipop_EB import Planck20_Lollipop_EB diff --git a/montepython/likelihoods/Planck20_Lollipop_EE/Planck20_Lollipop_EE.data b/montepython/likelihoods/Planck20_Lollipop_EE/Planck20_Lollipop_EE.data new file mode 100755 index 00000000..49766fc0 --- /dev/null +++ b/montepython/likelihoods/Planck20_Lollipop_EE/Planck20_Lollipop_EE.data @@ -0,0 +1,10 @@ +Planck20_Lollipop_EE.data_directory = '' +Planck20_Lollipop_EE.file = '' + +Planck20_Lollipop_EE.Nsim = 400 +Planck20_Lollipop_EE.lmin = 2 +Planck20_Lollipop_EE.lmax = 30 +Planck20_Lollipop_EE.use_nuisance = ['A_planck'] + +Planck20_Lollipop_EE.A_planck_prior_center = 1 +Planck20_Lollipop_EE.A_planck_prior_std = 0.0025 diff --git a/montepython/likelihoods/Planck20_Lollipop_EE/Planck20_Lollipop_EE.py b/montepython/likelihoods/Planck20_Lollipop_EE/Planck20_Lollipop_EE.py new file mode 100644 index 00000000..5f342d96 --- /dev/null +++ b/montepython/likelihoods/Planck20_Lollipop_EE/Planck20_Lollipop_EE.py @@ -0,0 +1,58 @@ +from montepython.likelihood_class import Likelihood +import numpy as np +import planck_2020_lollipop +import os +import tempfile + +packages_path = os.environ.get("COBAYA_PACKAGES_PATH") or os.path.join( + tempfile.gettempdir(), "Lollipop_packages" +) + +hartlap_factor = False +marginalised_over_covariance = True + + +class Planck20_Lollipop_EE(Likelihood): + def __init__(self, path, data, command_line): + Likelihood.__init__(self, path, data, command_line) + + #Create Cobaya likelihood + self.lik = planck_2020_lollipop.lowlE({"packages_path": packages_path, "Nsim": self.Nsim, "lmin":self.lmin, "lmax":self.lmax}) + + self.need_cosmo_arguments( + data, {'lensing': 'yes', 'output': 'pCl lCl', 'non_linear': 'halofit', 'l_max_scalars': self.lik.bins.lmax}) + + print( "Init Lollipop (lowlE) done !") + + def loglkl(self, cosmo, data): + + print( {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['cosmo'])}) + cls = self.get_cl(cosmo) + + data_params = {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['nuisance'])} + print(data_params) + + lkl = self.lik.loglike(cls, **data_params) + print( lkl) + + lkl = self.add_nuisance_prior(lkl, data) + + return lkl + + + def add_nuisance_prior(self, lkl, data): + # Recover the current value of the nuisance parameter. + for nuisance in self.use_nuisance: + nuisance_value = float( + data.mcmc_parameters[nuisance]['current'] * + data.mcmc_parameters[nuisance]['scale']) + + # add prior on nuisance parameters + if hasattr(self, "%s_prior_center" % nuisance) and getattr(self, "%s_prior_std" % nuisance) > 0: + # convenience variables + prior_center = getattr(self, "%s_prior_center" % nuisance) + prior_std = getattr(self, "%s_prior_std" % nuisance) + lkl += -0.5*((nuisance_value-prior_center)/prior_std)**2 + return lkl + + diff --git a/montepython/likelihoods/Planck20_Lollipop_EE/README b/montepython/likelihoods/Planck20_Lollipop_EE/README new file mode 100644 index 00000000..c84a951f --- /dev/null +++ b/montepython/likelihoods/Planck20_Lollipop_EE/README @@ -0,0 +1,23 @@ +Lollipop is a low-l polarized likelihood for Planck PR4 data. + +Lollipop is a Planck low-l polarization likelihood based on +cross-power-spectra for which the bias is zero when the noise is +uncorrelated between maps. It uses the approximation presented in +Hamimeche & Lewis (2008), modified as described in Mangilli et +al. (2015) to apply to cross-power spectra. This version is based on +the Planck PR4 data. Cross-spectra are computed on the CMB maps from +Commander component separation applied on each detset-split Planck +frequency maps. + +The code is available here: +https://github.com/planck-npipe/lollipop + +This is a wrapper for MontePython. + +You need to install the code before: +> pip install planck-2020-lollipop + +Then get the data, untar and set the variable $COBAYA_PACKAGES_PATH to the local directory: +> wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_lollipop.tar.gz +> tar -zxvf planck_2020_lollipop.tar.gz --directory /path/to/data +> export COBAYA_PACKAGES_PATH=/path/to/data diff --git a/montepython/likelihoods/Planck20_Lollipop_EE/__init__.py b/montepython/likelihoods/Planck20_Lollipop_EE/__init__.py new file mode 100644 index 00000000..1cb3a88d --- /dev/null +++ b/montepython/likelihoods/Planck20_Lollipop_EE/__init__.py @@ -0,0 +1 @@ +from .Planck20_Lollipop_EE import Planck20_Lollipop_EE From 17af57ccb7d723e7c763b6420f5242752be9e5cc Mon Sep 17 00:00:00 2001 From: Matthieu Tristram Date: Mon, 11 Dec 2023 15:11:29 +0100 Subject: [PATCH 02/26] Clean comments in the code Fix beta_cib to beta_dust (similar to Cobaya) --- .../Planck20_Hillipop_TT/Planck20_Hillipop_TT.data | 4 +--- .../Planck20_Hillipop_TT/Planck20_Hillipop_TT.py | 13 +++++++++---- .../Planck20_Hillipop_TTTEEE.data | 4 +--- .../Planck20_Hillipop_TTTEEE.py | 7 ++++++- .../Planck20_Lollipop_BB/Planck20_Lollipop_BB.py | 6 +++--- .../Planck20_Lollipop_EB/Planck20_Lollipop_EB.py | 7 ++++--- .../Planck20_Lollipop_EE/Planck20_Lollipop_EE.py | 7 ++++--- 7 files changed, 28 insertions(+), 20 deletions(-) diff --git a/montepython/likelihoods/Planck20_Hillipop_TT/Planck20_Hillipop_TT.data b/montepython/likelihoods/Planck20_Hillipop_TT/Planck20_Hillipop_TT.data index c560a8a3..cfb13bee 100755 --- a/montepython/likelihoods/Planck20_Hillipop_TT/Planck20_Hillipop_TT.data +++ b/montepython/likelihoods/Planck20_Hillipop_TT/Planck20_Hillipop_TT.data @@ -1,7 +1,7 @@ Planck20_Hillipop_TT.data_directory = '' Planck20_Hillipop_TT.file = '' -Planck20_Hillipop_TT.use_nuisance = ['A_planck','cal100A','cal100B','cal143A','cal143B','cal217A','cal217B','Aradio','Adusty','AdustT','Acib','Atsz','Aksz','Aksz','xi','beta_dustT','beta_radio','beta_dusty','beta_cib'] +Planck20_Hillipop_TT.use_nuisance = ['A_planck','cal100A','cal100B','cal143A','cal143B','cal217A','cal217B','Aradio','Adusty','AdustT','Acib','Atsz','Aksz','Aksz','xi','beta_dustT','beta_radio','beta_dusty'] Planck20_Hillipop_TT.A_planck_prior_center = 1 Planck20_Hillipop_TT.A_planck_prior_std = 0.0025 @@ -9,7 +9,5 @@ Planck20_Hillipop_TT.AdustT_prior_center = 1.0 Planck20_Hillipop_TT.AdustT_prior_std = 0.1 Planck20_Hillipop_TT.beta_dustT_prior_center = 1.51 Planck20_Hillipop_TT.beta_dustT_prior_std = 0.01 -Planck20_Hillipop_TT.beta_cib_prior_center = 1.75 -Planck20_Hillipop_TT.beta_cib_prior_std = 0.06 Planck20_Hillipop_TT.beta_dusty_prior_center = 1.75 Planck20_Hillipop_TT.beta_dusty_prior_std = 0.06 diff --git a/montepython/likelihoods/Planck20_Hillipop_TT/Planck20_Hillipop_TT.py b/montepython/likelihoods/Planck20_Hillipop_TT/Planck20_Hillipop_TT.py index 76f386db..7f0fe361 100644 --- a/montepython/likelihoods/Planck20_Hillipop_TT/Planck20_Hillipop_TT.py +++ b/montepython/likelihoods/Planck20_Hillipop_TT/Planck20_Hillipop_TT.py @@ -12,7 +12,7 @@ class Planck20_Hillipop_TT(Likelihood): def __init__(self, path, data, command_line): Likelihood.__init__(self, path, data, command_line) - #Create Cobaya likelihood + #Create Cobaya likelihood self.lik = planck_2020_hillipop.TT({"packages_path": packages_path}) self.need_cosmo_arguments( @@ -22,7 +22,6 @@ def __init__(self, path, data, command_line): def loglkl(self, cosmo, data): - print( {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['cosmo'])}) cls = self.get_cl(cosmo) fac = cls['ell'] * (cls['ell']+1) / (2*np.pi) @@ -31,11 +30,16 @@ def loglkl(self, cosmo, data): dl[mode][cls['ell']] = fac*cls[mode.lower()] data_params = {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['nuisance'])} - print(data_params) + + #fix beta_cib to beta_dusty + if 'beta_cib' not in data_params: + data_params['beta_cib'] = data_params['beta_dusty'] + #compute log-likelihood lkl = self.lik.loglike(dl, **data_params) - print( lkl) +# print( lkl) + #Add priors lkl = self.add_nuisance_prior(lkl, data) return lkl @@ -54,4 +58,5 @@ def add_nuisance_prior(self, lkl, data): prior_center = getattr(self, "%s_prior_center" % nuisance) prior_std = getattr(self, "%s_prior_std" % nuisance) lkl += -0.5*((nuisance_value-prior_center)/prior_std)**2 + return lkl diff --git a/montepython/likelihoods/Planck20_Hillipop_TTTEEE/Planck20_Hillipop_TTTEEE.data b/montepython/likelihoods/Planck20_Hillipop_TTTEEE/Planck20_Hillipop_TTTEEE.data index cbd1e7d3..c0d39f2c 100755 --- a/montepython/likelihoods/Planck20_Hillipop_TTTEEE/Planck20_Hillipop_TTTEEE.data +++ b/montepython/likelihoods/Planck20_Hillipop_TTTEEE/Planck20_Hillipop_TTTEEE.data @@ -1,12 +1,10 @@ Planck20_Hillipop_TTTEEE.data_directory = '' Planck20_Hillipop_TTTEEE.file = '' -Planck20_Hillipop_TTTEEE.use_nuisance = ['A_planck','cal100A','cal100B','cal143A','cal143B','cal217A','cal217B','Aradio','Adusty','AdustT','AdustP','Acib','Atsz','Aksz','Aksz','xi','beta_radio','beta_dusty','beta_cib','beta_dustT','beta_dustP'] +Planck20_Hillipop_TTTEEE.use_nuisance = ['A_planck','cal100A','cal100B','cal143A','cal143B','cal217A','cal217B','Aradio','Adusty','AdustT','AdustP','Acib','Atsz','Aksz','Aksz','xi','beta_radio','beta_dusty','beta_dustT','beta_dustP'] Planck20_Hillipop_TTTEEE.A_planck_prior_center = 1 Planck20_Hillipop_TTTEEE.A_planck_prior_std = 0.0025 -Planck20_Hillipop_TTTEEE.beta_cib_prior_center = 1.75 -Planck20_Hillipop_TTTEEE.beta_cib_prior_std = 0.06 Planck20_Hillipop_TTTEEE.beta_dusty_prior_center = 1.75 Planck20_Hillipop_TTTEEE.beta_dusty_prior_std = 0.06 Planck20_Hillipop_TTTEEE.AdustT_prior_center = 1.0 diff --git a/montepython/likelihoods/Planck20_Hillipop_TTTEEE/Planck20_Hillipop_TTTEEE.py b/montepython/likelihoods/Planck20_Hillipop_TTTEEE/Planck20_Hillipop_TTTEEE.py index fe996787..d2580eac 100644 --- a/montepython/likelihoods/Planck20_Hillipop_TTTEEE/Planck20_Hillipop_TTTEEE.py +++ b/montepython/likelihoods/Planck20_Hillipop_TTTEEE/Planck20_Hillipop_TTTEEE.py @@ -33,10 +33,14 @@ def loglkl(self, cosmo, data): for par in ['pe100A','pe100B','pe143A','pe143B']: data_params[par] = 1.0 data_params['pe217A'] = data_params['pe217B'] = 0.975 - print(data_params) + #fix beta_cib to beta_dusty + if 'beta_cib' not in data_params: + data_params['beta_cib'] = data_params['beta_dusty'] + #compute log-likelihood lkl = self.lik.loglike(dl, **data_params) + #Add priors lkl = self.add_nuisance_prior(lkl, data) return lkl @@ -55,4 +59,5 @@ def add_nuisance_prior(self, lkl, data): prior_center = getattr(self, "%s_prior_center" % nuisance) prior_std = getattr(self, "%s_prior_std" % nuisance) lkl += -0.5*((nuisance_value-prior_center)/prior_std)**2 + return lkl diff --git a/montepython/likelihoods/Planck20_Lollipop_BB/Planck20_Lollipop_BB.py b/montepython/likelihoods/Planck20_Lollipop_BB/Planck20_Lollipop_BB.py index 71188486..6a47cb0d 100644 --- a/montepython/likelihoods/Planck20_Lollipop_BB/Planck20_Lollipop_BB.py +++ b/montepython/likelihoods/Planck20_Lollipop_BB/Planck20_Lollipop_BB.py @@ -26,15 +26,15 @@ def __init__(self, path, data, command_line): def loglkl(self, cosmo, data): - print( {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['cosmo'])}) +# print( {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['cosmo'])}) cls = self.get_cl(cosmo) data_params = {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['nuisance'])} - print(data_params) + #compute log-likelihood lkl = self.lik.loglike(cls, **data_params) - print( lkl) + #Add priors lkl = self.add_nuisance_prior(lkl, data) return lkl diff --git a/montepython/likelihoods/Planck20_Lollipop_EB/Planck20_Lollipop_EB.py b/montepython/likelihoods/Planck20_Lollipop_EB/Planck20_Lollipop_EB.py index ba5374aa..3ed6c1d0 100644 --- a/montepython/likelihoods/Planck20_Lollipop_EB/Planck20_Lollipop_EB.py +++ b/montepython/likelihoods/Planck20_Lollipop_EB/Planck20_Lollipop_EB.py @@ -26,15 +26,16 @@ def __init__(self, path, data, command_line): def loglkl(self, cosmo, data): - print( {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['cosmo'])}) +# print( {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['cosmo'])}) cls = self.get_cl(cosmo) data_params = {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['nuisance'])} - print(data_params) +# print(data_params) + #compute log-likelihood lkl = self.lik.loglike(cls, **data_params) - print( lkl) + #Add priors lkl = self.add_nuisance_prior(lkl, data) return lkl diff --git a/montepython/likelihoods/Planck20_Lollipop_EE/Planck20_Lollipop_EE.py b/montepython/likelihoods/Planck20_Lollipop_EE/Planck20_Lollipop_EE.py index 5f342d96..13e128a2 100644 --- a/montepython/likelihoods/Planck20_Lollipop_EE/Planck20_Lollipop_EE.py +++ b/montepython/likelihoods/Planck20_Lollipop_EE/Planck20_Lollipop_EE.py @@ -26,15 +26,16 @@ def __init__(self, path, data, command_line): def loglkl(self, cosmo, data): - print( {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['cosmo'])}) +# print( {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['cosmo'])}) cls = self.get_cl(cosmo) data_params = {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['nuisance'])} - print(data_params) +# print(data_params) + #compute log-likelihood lkl = self.lik.loglike(cls, **data_params) - print( lkl) + #Add priors lkl = self.add_nuisance_prior(lkl, data) return lkl From 4b8001da75be97ed76c647dce9cce6f3459a30b5 Mon Sep 17 00:00:00 2001 From: Matthieu Tristram Date: Fri, 15 Dec 2023 16:28:31 +0100 Subject: [PATCH 03/26] Param file for Planck20 Hillipop and Lollipop likelihoods --- input/Planck20_Hillipop.param | 72 +++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 input/Planck20_Hillipop.param diff --git a/input/Planck20_Hillipop.param b/input/Planck20_Hillipop.param new file mode 100644 index 00000000..61159f05 --- /dev/null +++ b/input/Planck20_Hillipop.param @@ -0,0 +1,72 @@ +#------Experiments to test (separated with commas)----- +# To see all the available ones, please look in the +# montepython/likelihoods folder. Every folder there is a valid likelihood to +# test. +data.experiments=['Planck_lowl_TT','Planck20_Lollipop_EE','Planck20_Hillipop_TTTEEE'] + +#------ Parameter list ------- +# data.parameters[class name] = [mean, min, max, 1-sigma, scale, role] +# - if min max irrelevant, put to -1 or None (if you want a boundary of -1, use -1.0) +# - if fixed, put 1-sigma to 0 +# - if scale irrelevant, put to 1, otherwise to the appropriate factor +# - role is either 'cosmo', 'nuisance' or 'derived' + + +# Cosmological parameters list +data.parameters['omega_b'] = [2.249, -1,-1, 0.016, 0.01,'cosmo'] +data.parameters['omega_cdm'] = [0.1120, -1,-1, 0.0016,1, 'cosmo'] +data.parameters['n_s'] = [0.963, -1,-1, 0.004, 1, 'cosmo'] +data.parameters['A_s'] = [2.10, -1,-1, 0.038, 1e-9,'cosmo'] +data.parameters['h'] = [0.674, -1,-1, 0.0065,1, 'cosmo'] +data.parameters['tau_reio'] = [0.055, -1,-1, 0.0044,1, 'cosmo'] + +# Nuisance parameter list, same call, except the name does not have to be a class name +# Note the nuisance parameters must follow *immediately after* the cosmo parameters, +# MP expects cosmo, nuisance, derived + +# Nuisance parameters +data.parameters['A_planck'] = [1, 0.9, 1.1, 0.0025, 1, 'nuisance'] +data.parameters['cal100A'] = [1, 0.9, 1.1, 0.01, 1, 'nuisance'] +data.parameters['cal100B'] = [1, 0.9, 1.1, 0.01, 1, 'nuisance'] +data.parameters['cal143A'] = [1, 1, 1, 0, 1, 'nuisance'] +data.parameters['cal143B'] = [1, 0.9, 1.1, 0.01, 1, 'nuisance'] +data.parameters['cal217A'] = [1, 0.9, 1.1, 0.01, 1, 'nuisance'] +data.parameters['cal217B'] = [1, 0.9, 1.1, 0.01, 1, 'nuisance'] + +data.parameters['AdustT'] = [ 1.0, 0.5, 1.5, 0.05, 1, 'nuisance'] +data.parameters['beta_dustT'] = [ 1.51, 1.2, 1.8, 0.01, 1, 'nuisance'] +data.parameters['AdustP'] = [ 1.0, 0.5, 1.5, 0.05, 1, 'nuisance'] +data.parameters['beta_dustP'] = [ 1.58, 1.2, 1.8, 0.01, 1, 'nuisance'] +data.parameters['Aradio'] = [ 60., 0, 150, 1., 1, 'nuisance'] +data.parameters['beta_radio'] = [ -0.8, None, None, 0.00001, 1, 'nuisance'] +data.parameters['Adusty'] = [ 6., 0, 100, 6., 1, 'nuisance'] +data.parameters['beta_dusty'] = [ 1.75, 1.6, 1.9, 0.05, 1, 'nuisance'] +data.parameters['Acib'] = [ 4.0, 0., 20, 1., 1, 'nuisance'] +data.parameters['Atsz'] = [ 3.0, 0., 50, 1., 1, 'nuisance'] +data.parameters['Aksz'] = [ 1.0, 0., 50, 1., 1, 'nuisance'] +data.parameters['xi'] = [ 0.1, -1., 1., 0.1, 1, 'nuisance'] + +# Derived parameter list +data.parameters['z_reio'] = [0, -1, -1, 0,1, 'derived'] +data.parameters['Omega_Lambda'] = [0, -1, -1, 0,1, 'derived'] + + +# CLASS parameters +data.cosmo_arguments['k_pivot'] = 0.05 +data.cosmo_arguments['N_ur'] = 2.0328 +data.cosmo_arguments['N_ncdm'] = 1 +data.cosmo_arguments['m_ncdm'] = 0.06 +data.cosmo_arguments['T_ncdm'] = 0.71611 +data.cosmo_arguments['l_max_scalars'] = 2500 +data.cosmo_arguments['non_linear'] = 'halofit' + + +#------ Mcmc parameters ---- +# Number of steps taken, by default (overwritten by the -N command) +data.N=10 +# Number of accepted steps before writing to file the chain. Larger means less +# access to disc, but this is not so much time consuming. +data.write_step=5 + + +# Note: MP will only interpret comments if the line begins with # (you cannot add comments at the end of lines!) From 99b1816727b7672f5a2995b4f32424161c2de2f0 Mon Sep 17 00:00:00 2001 From: Matthieu Tristram Date: Thu, 21 Dec 2023 18:59:40 +0100 Subject: [PATCH 04/26] Remove nonlinear requirements for Class --- .../Planck20_Hillipop_TTTEEE/Planck20_Hillipop_TTTEEE.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/montepython/likelihoods/Planck20_Hillipop_TTTEEE/Planck20_Hillipop_TTTEEE.py b/montepython/likelihoods/Planck20_Hillipop_TTTEEE/Planck20_Hillipop_TTTEEE.py index d2580eac..804ad1df 100644 --- a/montepython/likelihoods/Planck20_Hillipop_TTTEEE/Planck20_Hillipop_TTTEEE.py +++ b/montepython/likelihoods/Planck20_Hillipop_TTTEEE/Planck20_Hillipop_TTTEEE.py @@ -16,7 +16,7 @@ def __init__(self, path, data, command_line): self.lik = planck_2020_hillipop.TTTEEE({"packages_path": packages_path}) self.need_cosmo_arguments( - data, {'lensing': 'yes', 'output': 'tCl pCl lCl', 'non_linear': 'halofit', 'l_max_scalars': self.lik.lmax}) + data, {'lensing': 'yes', 'output': 'tCl pCl lCl', 'l_max_scalars': self.lik.lmax}) print( "Init Hillipop TTTEEE done !") From fd49541bc34e5f629da190d01e5fc93bf62ad1e0 Mon Sep 17 00:00:00 2001 From: Matthieu Tristram Date: Thu, 21 Dec 2023 19:00:15 +0100 Subject: [PATCH 05/26] Force marginalisation for Lollipop --- .../likelihoods/Planck20_Lollipop_EE/Planck20_Lollipop_EE.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/montepython/likelihoods/Planck20_Lollipop_EE/Planck20_Lollipop_EE.py b/montepython/likelihoods/Planck20_Lollipop_EE/Planck20_Lollipop_EE.py index 13e128a2..68e19d7f 100644 --- a/montepython/likelihoods/Planck20_Lollipop_EE/Planck20_Lollipop_EE.py +++ b/montepython/likelihoods/Planck20_Lollipop_EE/Planck20_Lollipop_EE.py @@ -8,8 +8,6 @@ tempfile.gettempdir(), "Lollipop_packages" ) -hartlap_factor = False -marginalised_over_covariance = True class Planck20_Lollipop_EE(Likelihood): @@ -19,6 +17,9 @@ def __init__(self, path, data, command_line): #Create Cobaya likelihood self.lik = planck_2020_lollipop.lowlE({"packages_path": packages_path, "Nsim": self.Nsim, "lmin":self.lmin, "lmax":self.lmax}) + self.lik.hartlap_factor = False + self.lik.marginalised_over_covariance = True + self.need_cosmo_arguments( data, {'lensing': 'yes', 'output': 'pCl lCl', 'non_linear': 'halofit', 'l_max_scalars': self.lik.bins.lmax}) From bd981bc731db4520209f05498b6b21eb9f473eb8 Mon Sep 17 00:00:00 2001 From: Matthieu Tristram Date: Thu, 21 Dec 2023 19:00:41 +0100 Subject: [PATCH 06/26] Comment prior for A_planck (if already included in Hillipop) --- .../Planck20_Lollipop_BB/Planck20_Lollipop_BB.data | 11 +++++++++-- .../Planck20_Lollipop_EB/Planck20_Lollipop_EB.data | 11 +++++++++-- .../Planck20_Lollipop_EE/Planck20_Lollipop_EE.data | 11 +++++++++-- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/montepython/likelihoods/Planck20_Lollipop_BB/Planck20_Lollipop_BB.data b/montepython/likelihoods/Planck20_Lollipop_BB/Planck20_Lollipop_BB.data index 42efd7c6..63e2dc7a 100755 --- a/montepython/likelihoods/Planck20_Lollipop_BB/Planck20_Lollipop_BB.data +++ b/montepython/likelihoods/Planck20_Lollipop_BB/Planck20_Lollipop_BB.data @@ -6,5 +6,12 @@ Planck20_Lollipop_BB.lmin = 2 Planck20_Lollipop_BB.lmax = 150 Planck20_Lollipop_BB.use_nuisance = ['A_planck'] -Planck20_Lollipop_BB.A_planck_prior_center = 1 -Planck20_Lollipop_BB.A_planck_prior_std = 0.0025 +# note concerning the Planck likelihoods: +# This likelihood has a nuisance parameter A_planck that should be declared in +# your input parameter file. +# Usually this likelihood is used in combination with the highl likelihood, +# which imposes a gaussian prior on this nuisance parameter. +# If you run this likelihood alone (without any highl one), you need to +# impose the gaussian prior here. In that case, uncomment the two lines: +#Planck20_Lollipop_BB.A_planck_prior_center = 1 +#Planck20_Lollipop_BB.A_planck_prior_std = 0.0025 diff --git a/montepython/likelihoods/Planck20_Lollipop_EB/Planck20_Lollipop_EB.data b/montepython/likelihoods/Planck20_Lollipop_EB/Planck20_Lollipop_EB.data index bb912e43..65aa2908 100755 --- a/montepython/likelihoods/Planck20_Lollipop_EB/Planck20_Lollipop_EB.data +++ b/montepython/likelihoods/Planck20_Lollipop_EB/Planck20_Lollipop_EB.data @@ -6,5 +6,12 @@ Planck20_Lollipop_EB.lmin = 2 Planck20_Lollipop_EB.lmax = 30 Planck20_Lollipop_EB.use_nuisance = ['A_planck'] -Planck20_Lollipop_EB.A_planck_prior_center = 1 -Planck20_Lollipop_EB.A_planck_prior_std = 0.0025 +# note concerning the Planck likelihoods: +# This likelihood has a nuisance parameter A_planck that should be declared in +# your input parameter file. +# Usually this likelihood is used in combination with the highl likelihood, +# which imposes a gaussian prior on this nuisance parameter. +# If you run this likelihood alone (without any highl one), you need to +# impose the gaussian prior here. In that case, uncomment the two lines: +#Planck20_Lollipop_EB.A_planck_prior_center = 1 +#Planck20_Lollipop_EB.A_planck_prior_std = 0.0025 diff --git a/montepython/likelihoods/Planck20_Lollipop_EE/Planck20_Lollipop_EE.data b/montepython/likelihoods/Planck20_Lollipop_EE/Planck20_Lollipop_EE.data index 49766fc0..3764b099 100755 --- a/montepython/likelihoods/Planck20_Lollipop_EE/Planck20_Lollipop_EE.data +++ b/montepython/likelihoods/Planck20_Lollipop_EE/Planck20_Lollipop_EE.data @@ -6,5 +6,12 @@ Planck20_Lollipop_EE.lmin = 2 Planck20_Lollipop_EE.lmax = 30 Planck20_Lollipop_EE.use_nuisance = ['A_planck'] -Planck20_Lollipop_EE.A_planck_prior_center = 1 -Planck20_Lollipop_EE.A_planck_prior_std = 0.0025 +# note concerning the Planck likelihoods: +# This likelihood has a nuisance parameter A_planck that should be declared in +# your input parameter file. +# Usually this likelihood is used in combination with the highl likelihood, +# which imposes a gaussian prior on this nuisance parameter. +# If you run this likelihood alone (without any highl one), you need to +# impose the gaussian prior here. In that case, uncomment the two lines: +#Planck20_Lollipop_EE.A_planck_prior_center = 1 +#Planck20_Lollipop_EE.A_planck_prior_std = 0.0025 From fb409669b30d17c7d378d45140732079b8b02638 Mon Sep 17 00:00:00 2001 From: Matthieu Tristram Date: Fri, 22 Dec 2023 11:24:11 +0100 Subject: [PATCH 07/26] Add lite versions for Hillipop p --- .../Planck20_Hillipop_TTTEEE_lite.data | 17 +++++ .../Planck20_Hillipop_TTTEEE_lite.py | 63 +++++++++++++++++++ .../Planck20_Hillipop_TTTEEE_lite/README | 28 +++++++++ .../Planck20_Hillipop_TTTEEE_lite/__init__.py | 1 + .../Planck20_Hillipop_TT_lite.data | 13 ++++ .../Planck20_Hillipop_TT_lite.py | 62 ++++++++++++++++++ .../Planck20_Hillipop_TT_lite/README | 28 +++++++++ .../Planck20_Hillipop_TT_lite/__init__.py | 1 + 8 files changed, 213 insertions(+) create mode 100755 montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/Planck20_Hillipop_TTTEEE_lite.data create mode 100644 montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/Planck20_Hillipop_TTTEEE_lite.py create mode 100644 montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README create mode 100644 montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/__init__.py create mode 100755 montepython/likelihoods/Planck20_Hillipop_TT_lite/Planck20_Hillipop_TT_lite.data create mode 100644 montepython/likelihoods/Planck20_Hillipop_TT_lite/Planck20_Hillipop_TT_lite.py create mode 100644 montepython/likelihoods/Planck20_Hillipop_TT_lite/README create mode 100644 montepython/likelihoods/Planck20_Hillipop_TT_lite/__init__.py diff --git a/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/Planck20_Hillipop_TTTEEE_lite.data b/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/Planck20_Hillipop_TTTEEE_lite.data new file mode 100755 index 00000000..4bd5a42b --- /dev/null +++ b/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/Planck20_Hillipop_TTTEEE_lite.data @@ -0,0 +1,17 @@ +Planck20_Hillipop_TTTEEE_lite.data_directory = '' +Planck20_Hillipop_TTTEEE_lite.file = '' + +Planck20_Hillipop_TTTEEE_lite.use_nuisance = ['A_planck','cal100A','cal100B','cal143A','cal143B','cal217A','cal217B','Aradio','Adusty','AdustT','AdustP','Acib','Atsz','Aksz','Aksz','xi','beta_radio','beta_dusty','beta_dustT','beta_dustP'] + +Planck20_Hillipop_TTTEEE_lite.A_planck_prior_center = 1 +Planck20_Hillipop_TTTEEE_lite.A_planck_prior_std = 0.0025 +Planck20_Hillipop_TTTEEE_lite.beta_dusty_prior_center = 1.75 +Planck20_Hillipop_TTTEEE_lite.beta_dusty_prior_std = 0.06 +Planck20_Hillipop_TTTEEE_lite.AdustT_prior_center = 1.0 +Planck20_Hillipop_TTTEEE_lite.AdustT_prior_std = 0.1 +Planck20_Hillipop_TTTEEE_lite.beta_dustT_prior_center = 1.51 +Planck20_Hillipop_TTTEEE_lite.beta_dustT_prior_std = 0.01 +Planck20_Hillipop_TTTEEE_lite.AdustP_prior_center = 1.0 +Planck20_Hillipop_TTTEEE_lite.AdustP_prior_std = 0.1 +Planck20_Hillipop_TTTEEE_lite.beta_dustP_prior_center = 1.59 +Planck20_Hillipop_TTTEEE_lite.beta_dustP_prior_std = 0.02 diff --git a/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/Planck20_Hillipop_TTTEEE_lite.py b/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/Planck20_Hillipop_TTTEEE_lite.py new file mode 100644 index 00000000..3a948de2 --- /dev/null +++ b/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/Planck20_Hillipop_TTTEEE_lite.py @@ -0,0 +1,63 @@ +from montepython.likelihood_class import Likelihood +import numpy as np +import planck_2020_hillipop +import os +import tempfile + +packages_path = os.environ.get("COBAYA_PACKAGES_PATH") or os.path.join( + tempfile.gettempdir(), "Hillipop_packages" +) + +class Planck20_Hillipop_TTTEEE_lite(Likelihood): + def __init__(self, path, data, command_line): + Likelihood.__init__(self, path, data, command_line) + + #Create Cobaya likelihood + self.lik = planck_2020_hillipop.TTTEEE_lite({"packages_path": packages_path}) + + self.need_cosmo_arguments( + data, {'lensing': 'yes', 'output': 'tCl pCl lCl', 'l_max_scalars': self.lik.lmax}) + + print( "Init Hillipop TTTEEE_lite done !") + + def loglkl(self, cosmo, data): + + cls = self.get_cl(cosmo) + + fac = cls['ell'] * (cls['ell']+1) / (2*np.pi) + dl = {mode:np.zeros(self.lik.lmax+1) for mode in ['TT','TE','EE']} + for mode in ['TT','TE','EE']: + dl[mode][cls['ell']] = fac*cls[mode.lower()] + + data_params = {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['nuisance'])} + for par in ['pe100A','pe100B','pe143A','pe143B']: data_params[par] = 1.0 + data_params['pe217A'] = data_params['pe217B'] = 0.975 + + #fix beta_cib to beta_dusty + if 'beta_cib' not in data_params: + data_params['beta_cib'] = data_params['beta_dusty'] + + #compute log-likelihood + lkl = self.lik.loglike(dl, **data_params) + + #Add priors + lkl = self.add_nuisance_prior(lkl, data) + + return lkl + + + def add_nuisance_prior(self, lkl, data): + # Recover the current value of the nuisance parameter. + for nuisance in self.use_nuisance: + nuisance_value = float( + data.mcmc_parameters[nuisance]['current'] * + data.mcmc_parameters[nuisance]['scale']) + + # add prior on nuisance parameters + if hasattr(self, "%s_prior_center" % nuisance) and getattr(self, "%s_prior_std" % nuisance) > 0: + # convenience variables + prior_center = getattr(self, "%s_prior_center" % nuisance) + prior_std = getattr(self, "%s_prior_std" % nuisance) + lkl += -0.5*((nuisance_value-prior_center)/prior_std)**2 + + return lkl diff --git a/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README b/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README new file mode 100644 index 00000000..71d7f32c --- /dev/null +++ b/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README @@ -0,0 +1,28 @@ +Hillipop is a high-l polarized likelihood for Planck PR4 data +(lite, i.e. binned version) + +Hillipop is a multifrequency CMB likelihood for Planck data. The +likelihood is a spectrum-based Gaussian approximation for +cross-correlation spectra from Planck 100, 143 and 217GHz +split-frequency maps, with semi-analytic estimates of the Cl +covariance matrix based on the data. The cross-spectra are debiased +from the effects of the mask and the beam leakage using Xpol (a +generalization to polarization of the algorithm presented in Tristram +et al. 2005) before being compared to the model, which includes CMB +and foreground residuals. They cover the multipoles from ~=30 to ~=2500. + +The code is available here: +https://github.com/planck-npipe/hillipop + +This is a wrapper for MontePython. + +You need to install the code before: +> git clone https://github.com/planck-npipe/hillipop +> cd hillipop +> pip install . + +Then get the data, untar and set the variable $COBAYA_PACKAGES_PATH to the local directory: +> wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_hillipop_TTTEEE_lite_v4.2.tar.gz +> tar -zxvf planck_2020_hillipop_TTTEEE_lite_v4.2.tar.gz --directory /path/to/data +> export COBAYA_PACKAGES_PATH=/path/to/data + diff --git a/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/__init__.py b/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/__init__.py new file mode 100644 index 00000000..a168dd42 --- /dev/null +++ b/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/__init__.py @@ -0,0 +1 @@ +from .Planck20_Hillipop_TTTEEE_lite import Planck20_Hillipop_TTTEEE_lite diff --git a/montepython/likelihoods/Planck20_Hillipop_TT_lite/Planck20_Hillipop_TT_lite.data b/montepython/likelihoods/Planck20_Hillipop_TT_lite/Planck20_Hillipop_TT_lite.data new file mode 100755 index 00000000..63d8c83f --- /dev/null +++ b/montepython/likelihoods/Planck20_Hillipop_TT_lite/Planck20_Hillipop_TT_lite.data @@ -0,0 +1,13 @@ +Planck20_Hillipop_TT_lite.data_directory = '' +Planck20_Hillipop_TT_lite.file = '' + +Planck20_Hillipop_TT_lite.use_nuisance = ['A_planck','cal100A','cal100B','cal143A','cal143B','cal217A','cal217B','Aradio','Adusty','AdustT','Acib','Atsz','Aksz','Aksz','xi','beta_dustT','beta_radio','beta_dusty'] + +Planck20_Hillipop_TT_lite.A_planck_prior_center = 1 +Planck20_Hillipop_TT_lite.A_planck_prior_std = 0.0025 +Planck20_Hillipop_TT_lite.AdustT_prior_center = 1.0 +Planck20_Hillipop_TT_lite.AdustT_prior_std = 0.1 +Planck20_Hillipop_TT_lite.beta_dustT_prior_center = 1.51 +Planck20_Hillipop_TT_lite.beta_dustT_prior_std = 0.01 +Planck20_Hillipop_TT_lite.beta_dusty_prior_center = 1.75 +Planck20_Hillipop_TT_lite.beta_dusty_prior_std = 0.06 diff --git a/montepython/likelihoods/Planck20_Hillipop_TT_lite/Planck20_Hillipop_TT_lite.py b/montepython/likelihoods/Planck20_Hillipop_TT_lite/Planck20_Hillipop_TT_lite.py new file mode 100644 index 00000000..5718a112 --- /dev/null +++ b/montepython/likelihoods/Planck20_Hillipop_TT_lite/Planck20_Hillipop_TT_lite.py @@ -0,0 +1,62 @@ +from montepython.likelihood_class import Likelihood +import numpy as np +import planck_2020_hillipop +import os +import tempfile + +packages_path = os.environ.get("COBAYA_PACKAGES_PATH") or os.path.join( + tempfile.gettempdir(), "Hillipop_packages" +) + +class Planck20_Hillipop_TT_lite(Likelihood): + def __init__(self, path, data, command_line): + Likelihood.__init__(self, path, data, command_line) + + #Create Cobaya likelihood + self.lik = planck_2020_hillipop.TT_lite({"packages_path": packages_path}) + + self.need_cosmo_arguments( + data, {'lensing': 'yes', 'output': 'tCl pCl lCl', 'l_max_scalars': self.lik.lmax}) + + print( "Init Hillipop TT_lite done !") + + def loglkl(self, cosmo, data): + + cls = self.get_cl(cosmo) + + fac = cls['ell'] * (cls['ell']+1) / (2*np.pi) + dl = {mode:np.zeros(self.lik.lmax+1) for mode in ['TT','TE','EE']} + for mode in ['TT','TE','EE']: + dl[mode][cls['ell']] = fac*cls[mode.lower()] + + data_params = {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['nuisance'])} + + #fix beta_cib to beta_dusty + if 'beta_cib' not in data_params: + data_params['beta_cib'] = data_params['beta_dusty'] + + #compute log-likelihood + lkl = self.lik.loglike(dl, **data_params) +# print( lkl) + + #Add priors + lkl = self.add_nuisance_prior(lkl, data) + + return lkl + + + def add_nuisance_prior(self, lkl, data): + # Recover the current value of the nuisance parameter. + for nuisance in self.use_nuisance: + nuisance_value = float( + data.mcmc_parameters[nuisance]['current'] * + data.mcmc_parameters[nuisance]['scale']) + + # add prior on nuisance parameters + if hasattr(self, "%s_prior_center" % nuisance) and getattr(self, "%s_prior_std" % nuisance) > 0: + # convenience variables + prior_center = getattr(self, "%s_prior_center" % nuisance) + prior_std = getattr(self, "%s_prior_std" % nuisance) + lkl += -0.5*((nuisance_value-prior_center)/prior_std)**2 + + return lkl diff --git a/montepython/likelihoods/Planck20_Hillipop_TT_lite/README b/montepython/likelihoods/Planck20_Hillipop_TT_lite/README new file mode 100644 index 00000000..81546c06 --- /dev/null +++ b/montepython/likelihoods/Planck20_Hillipop_TT_lite/README @@ -0,0 +1,28 @@ +Hillipop is a high-l polarized likelihood for Planck PR4 data. +(lite, i.e. binned version) + +Hillipop is a multifrequency CMB likelihood for Planck data. The +likelihood is a spectrum-based Gaussian approximation for +cross-correlation spectra from Planck 100, 143 and 217GHz +split-frequency maps, with semi-analytic estimates of the Cl +covariance matrix based on the data. The cross-spectra are debiased +from the effects of the mask and the beam leakage using Xpol (a +generalization to polarization of the algorithm presented in Tristram +et al. 2005) before being compared to the model, which includes CMB +and foreground residuals. They cover the multipoles from ~=30 to ~=2500. + +The code is available here: +https://github.com/planck-npipe/hillipop + +This is a wrapper for MontePython. + +You need to install the code before: +> git clone https://github.com/planck-npipe/hillipop +> cd hillipop +> pip install . + +Then get the data, untar and set the variable $COBAYA_PACKAGES_PATH to the local directory: +> wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_hillipop_TT_lite_v4.2.tar.gz +> tar -zxvf planck_2020_hillipop_TT_lite_v4.2.tar.gz --directory /path/to/data +> export COBAYA_PACKAGES_PATH=/path/to/data + diff --git a/montepython/likelihoods/Planck20_Hillipop_TT_lite/__init__.py b/montepython/likelihoods/Planck20_Hillipop_TT_lite/__init__.py new file mode 100644 index 00000000..20ca9486 --- /dev/null +++ b/montepython/likelihoods/Planck20_Hillipop_TT_lite/__init__.py @@ -0,0 +1 @@ +from .Planck20_Hillipop_TT_lite import Planck20_Hillipop_TT_lite From 7506eec827d3cec329edd397094cde0c9de91147 Mon Sep 17 00:00:00 2001 From: Matthieu Tristram Date: Fri, 22 Dec 2023 11:24:41 +0100 Subject: [PATCH 08/26] Remove nonlinear rquirement for CLASS --- .../likelihoods/Planck20_Hillipop_TT/Planck20_Hillipop_TT.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/montepython/likelihoods/Planck20_Hillipop_TT/Planck20_Hillipop_TT.py b/montepython/likelihoods/Planck20_Hillipop_TT/Planck20_Hillipop_TT.py index 7f0fe361..3a7c8e13 100644 --- a/montepython/likelihoods/Planck20_Hillipop_TT/Planck20_Hillipop_TT.py +++ b/montepython/likelihoods/Planck20_Hillipop_TT/Planck20_Hillipop_TT.py @@ -16,7 +16,7 @@ def __init__(self, path, data, command_line): self.lik = planck_2020_hillipop.TT({"packages_path": packages_path}) self.need_cosmo_arguments( - data, {'lensing': 'yes', 'output': 'tCl pCl lCl', 'non_linear': 'halofit', 'l_max_scalars': self.lik.lmax}) + data, {'lensing': 'yes', 'output': 'tCl pCl lCl', 'l_max_scalars': self.lik.lmax}) print( "Init Hillipop TT done !") From c54e4b61cae8e5c626dddd630ff964c565eade35 Mon Sep 17 00:00:00 2001 From: Matthieu Tristram Date: Tue, 26 Dec 2023 10:44:10 +0100 Subject: [PATCH 09/26] Add covmat for hlpTTTEEE+lolE+lowlT --- covmat/planck20_TTTEEE.covmat | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 covmat/planck20_TTTEEE.covmat diff --git a/covmat/planck20_TTTEEE.covmat b/covmat/planck20_TTTEEE.covmat new file mode 100644 index 00000000..2c0f5325 --- /dev/null +++ b/covmat/planck20_TTTEEE.covmat @@ -0,0 +1,28 @@ +# omega_b, omega_cdm, n_s, ln10^{10}A_s, tau_reio, 100*theta_s, A_planck, cal100A, cal100B, cal143B, cal217A, cal217B, AdustT, beta_dustT, AdustP, beta_dustP, Aradio, Adusty, beta_dusty, Acib, Atsz, Aksz, xi, z_reio, Omega_Lambda, A_s, H0 + 1.840240e-08 -9.844223e-08 2.461074e-07 3.466029e-07 1.791125e-07 9.747048e-09 2.114019e-08 -7.859908e-08 -1.849875e-08 -9.439712e-08 -3.123796e-08 -5.127669e-08 -1.218057e-07 1.612356e-08 2.057271e-07 -4.992869e-08 9.731289e-07 9.862855e-07 4.055256e-08 3.925337e-07 3.954476e-06 -7.070384e-05 7.713336e-07 1.197509e-05 6.777182e-07 7.235976e-16 5.478000e-05 +-9.844223e-08 1.453346e-06 -3.458809e-06 -1.418125e-06 -1.803109e-06 -9.490650e-08 -1.898047e-07 2.862719e-07 5.488950e-07 8.259054e-07 2.585908e-07 4.928197e-07 6.632473e-07 -2.328195e-08 -1.609441e-06 9.665055e-07 9.515673e-06 -4.229444e-06 1.817085e-07 -3.786795e-06 -3.373463e-05 2.469045e-04 -5.891204e-06 -1.335299e-04 -8.820154e-06 -2.956279e-15 -6.377312e-04 + 2.461074e-07 -3.458809e-06 1.616490e-05 7.233634e-06 6.445059e-06 3.050385e-07 5.077061e-07 -1.275205e-06 -1.039523e-06 -2.432890e-06 -1.023703e-06 -1.615055e-06 1.016594e-05 -2.799777e-07 9.091211e-06 -3.926106e-06 5.673456e-04 2.354717e-04 -3.976805e-06 -9.521328e-05 -1.984541e-04 -3.639022e-03 3.056258e-05 5.324632e-04 2.129765e-05 1.507474e-14 1.555086e-03 + 3.466029e-07 -1.418125e-06 7.233634e-06 1.919708e-04 6.987095e-05 2.742058e-07 9.730918e-06 -1.859432e-05 -1.410698e-05 -3.246388e-05 -1.721372e-05 -1.444148e-05 1.179817e-05 7.041550e-07 2.733993e-05 -2.511366e-06 2.764393e-03 4.339771e-04 6.333277e-06 1.100864e-04 5.022837e-04 -4.753779e-03 -4.535069e-05 6.906325e-03 1.063569e-05 4.011037e-13 9.077986e-04 + 1.791125e-07 -1.803109e-06 6.445059e-06 6.987095e-05 3.828166e-05 1.337671e-07 -7.752258e-07 -3.092030e-07 1.333381e-06 1.047667e-06 7.361560e-07 6.099767e-07 -9.288704e-06 -1.624189e-07 -1.731937e-06 -2.054725e-06 -4.848227e-04 -2.691597e-05 3.661810e-07 4.066851e-05 4.333970e-05 -1.571131e-03 -1.453730e-05 3.767535e-03 1.131767e-05 1.460042e-13 8.480720e-04 + 9.747048e-09 -9.490650e-08 3.050385e-07 2.742058e-07 1.337671e-07 6.397486e-08 3.985364e-08 -5.890412e-08 -4.509948e-08 -1.026150e-07 -4.771522e-08 -4.657357e-08 1.037112e-07 4.201974e-08 1.065874e-07 -6.603654e-08 1.943370e-06 1.955609e-06 1.116957e-07 -8.019492e-07 7.874163e-06 -1.031093e-05 -1.660969e-07 9.697638e-06 7.736771e-07 5.720486e-16 6.389753e-05 + 2.114019e-08 -1.898047e-07 5.077061e-07 9.730918e-06 -7.752258e-07 3.985364e-08 6.030081e-06 6.388278e-07 -2.181853e-07 4.407630e-07 4.953891e-08 4.628820e-07 6.127432e-06 -1.107084e-07 6.724249e-06 -7.171283e-07 8.468127e-04 9.146022e-05 -9.103157e-07 9.454978e-06 1.026862e-04 -1.819521e-04 -5.557621e-06 -8.530258e-05 1.287541e-06 2.032108e-14 9.977298e-05 +-7.859908e-08 2.862719e-07 -1.275205e-06 -1.859432e-05 -3.092030e-07 -5.890412e-08 6.388278e-07 4.597547e-05 -2.618571e-05 1.925199e-05 9.532142e-06 9.845116e-06 -4.421378e-06 -2.479901e-07 -1.425274e-05 -2.403668e-06 -4.461737e-03 6.863017e-05 -1.957729e-06 -9.980441e-05 1.155702e-03 4.176499e-04 -1.773587e-04 -9.550186e-06 -2.195769e-06 -3.884571e-14 -1.927229e-04 +-1.849875e-08 5.488950e-07 -1.039523e-06 -1.410698e-05 1.333381e-06 -4.509948e-08 -2.181853e-07 -2.618571e-05 4.377068e-05 1.781603e-05 9.553313e-06 7.558668e-06 -6.551631e-06 -5.723337e-07 -9.084896e-06 2.198280e-06 3.131913e-03 -3.367207e-04 -5.261447e-06 6.180468e-05 -1.802217e-03 2.431963e-04 1.894150e-04 1.470479e-04 -3.264674e-06 -2.946301e-14 -2.266320e-04 +-9.439712e-08 8.259054e-07 -2.432890e-06 -3.246388e-05 1.047667e-06 -1.026150e-07 4.407630e-07 1.925199e-05 1.781603e-05 3.700643e-05 1.916173e-05 1.756032e-05 -1.654469e-05 -5.922455e-07 -2.328865e-05 -1.186339e-07 -1.032480e-03 -2.586462e-04 -5.832466e-06 -1.270953e-05 -5.151174e-04 5.053475e-04 -1.318968e-05 1.389484e-04 -5.390549e-06 -6.781155e-14 -4.131433e-04 +-3.123796e-08 2.585908e-07 -1.023703e-06 -1.721372e-05 7.361560e-07 -4.771522e-08 4.953891e-08 9.532142e-06 9.553313e-06 1.916173e-05 5.809793e-05 -3.814880e-05 -1.627697e-05 -1.229002e-06 -1.246862e-05 4.233637e-07 -1.279889e-03 6.936332e-05 -3.144755e-06 -9.650052e-05 2.404845e-04 2.799154e-04 2.463971e-05 8.347604e-05 -1.749373e-06 -3.594227e-14 -1.360365e-04 +-5.127669e-08 4.928197e-07 -1.615055e-06 -1.444148e-05 6.099767e-07 -4.657357e-08 4.628820e-07 9.845116e-06 7.558668e-06 1.756032e-05 -3.814880e-05 5.669923e-05 -1.949274e-05 4.645827e-07 -1.129255e-05 -7.126504e-07 -1.708754e-03 -3.966261e-05 -6.495942e-06 1.280121e-05 4.693752e-04 3.353928e-04 -1.058132e-04 8.130375e-05 -3.136340e-06 -3.016777e-14 -2.372048e-04 +-1.218057e-07 6.632473e-07 1.016594e-05 1.179817e-05 -9.288704e-06 1.037112e-07 6.127432e-06 -4.421378e-06 -6.551631e-06 -1.654469e-05 -1.627697e-05 -1.949274e-05 7.774506e-04 4.581974e-05 -1.253732e-05 -1.016558e-05 1.225531e-03 6.226687e-03 -4.098436e-05 -6.874444e-03 -5.877500e-03 -6.792076e-03 2.005832e-03 -8.869159e-04 -4.005608e-06 2.452478e-14 -3.115967e-04 + 1.612356e-08 -2.328195e-08 -2.799777e-07 7.041550e-07 -1.624189e-07 4.201974e-08 -1.107084e-07 -2.479901e-07 -5.723337e-07 -5.922455e-07 -1.229002e-06 4.645827e-07 4.581974e-05 9.979283e-05 1.198632e-06 -9.581335e-07 4.797010e-04 5.994743e-05 -7.095976e-06 1.712167e-05 -3.669122e-04 2.183215e-04 -4.650691e-05 -1.781926e-05 3.777093e-07 1.473960e-15 3.584764e-05 + 2.057271e-07 -1.609441e-06 9.091211e-06 2.733993e-05 -1.731937e-06 1.065874e-07 6.724249e-06 -1.425274e-05 -9.084896e-06 -2.328865e-05 -1.246862e-05 -1.129255e-05 -1.253732e-05 1.198632e-06 6.763898e-04 3.218554e-04 5.397361e-03 -5.429908e-04 7.773019e-06 5.785127e-04 -1.002273e-03 -9.984173e-04 2.619928e-05 -2.414659e-04 1.033572e-05 5.698178e-14 7.944932e-04 +-4.992869e-08 9.665055e-07 -3.926106e-06 -2.511366e-06 -2.054725e-06 -6.603654e-08 -7.171283e-07 -2.403668e-06 2.198280e-06 -1.186339e-07 4.233637e-07 -7.126504e-07 -1.016558e-05 -9.581335e-07 3.218554e-04 3.414193e-04 1.145459e-03 -1.974027e-04 5.635922e-06 1.582577e-04 -2.080866e-04 3.064776e-04 -4.739990e-05 -1.752200e-04 -5.769069e-06 -5.232584e-15 -4.114280e-04 + 9.731289e-07 9.515673e-06 5.673456e-04 2.764393e-03 -4.848227e-04 1.943370e-06 8.468127e-04 -4.461737e-03 3.131913e-03 -1.032480e-03 -1.279889e-03 -1.708754e-03 1.225531e-03 4.797010e-04 5.397361e-03 1.145459e-03 2.251021e+01 -8.509432e-01 2.326935e-02 3.380926e-01 -5.897223e+00 -2.219705e+00 5.642074e-01 -4.911396e-02 -4.732883e-05 5.758056e-12 -1.588059e-03 + 9.862855e-07 -4.229444e-06 2.354717e-04 4.339771e-04 -2.691597e-05 1.955609e-06 9.146022e-05 6.863017e-05 -3.367207e-04 -2.586462e-04 6.936332e-05 -3.966261e-05 6.226687e-03 5.994743e-05 -5.429908e-04 -1.974027e-04 -8.509432e-01 3.490880e-01 -1.409323e-02 -1.328494e-01 4.654434e-01 -4.728364e-01 -1.808381e-02 -2.976879e-03 3.654253e-05 9.071442e-13 2.991911e-03 + 4.055256e-08 1.817085e-07 -3.976805e-06 6.333277e-06 3.661810e-07 1.116957e-07 -9.103157e-07 -1.957729e-06 -5.261447e-06 -5.832466e-06 -3.144755e-06 -6.495942e-06 -4.098436e-05 -7.095976e-06 7.773019e-06 5.635922e-06 2.326935e-02 -1.409323e-02 2.006805e-03 -6.223253e-04 -7.418521e-03 2.562491e-03 -1.117960e-03 3.492301e-05 -5.427980e-07 1.311581e-14 1.306783e-05 + 3.925337e-07 -3.786795e-06 -9.521328e-05 1.100864e-04 4.066851e-05 -8.019492e-07 9.454978e-06 -9.980441e-05 6.180468e-05 -1.270953e-05 -9.650052e-05 1.280121e-05 -6.874444e-03 1.712167e-05 5.785127e-04 1.582577e-04 3.380926e-01 -1.328494e-01 -6.223253e-04 1.205578e-01 -8.948235e-02 7.040759e-03 -3.102271e-02 3.874726e-03 2.054708e-05 2.302574e-13 1.434847e-03 + 3.954476e-06 -3.373463e-05 -1.984541e-04 5.022837e-04 4.333970e-05 7.874163e-06 1.026862e-04 1.155702e-03 -1.802217e-03 -5.151174e-04 2.404845e-04 4.693752e-04 -5.877500e-03 -3.669122e-04 -1.002273e-03 -2.080866e-04 -5.897223e+00 4.654434e-01 -7.418521e-03 -8.948235e-02 2.773842e+00 -7.441553e-01 -3.626788e-01 2.712531e-03 2.347130e-04 1.060807e-12 1.808377e-02 +-7.070384e-05 2.469045e-04 -3.639022e-03 -4.753779e-03 -1.571131e-03 -1.031093e-05 -1.819521e-04 4.176499e-04 2.431963e-04 5.053475e-04 2.799154e-04 3.353928e-04 -6.792076e-03 2.183215e-04 -9.984173e-04 3.064776e-04 -2.219705e+00 -4.728364e-01 2.562491e-03 7.040759e-03 -7.441553e-01 5.556855e+00 3.364099e-01 -1.369179e-01 -1.803093e-03 -9.916522e-12 -1.546286e-01 + 7.713336e-07 -5.891204e-06 3.056258e-05 -4.535069e-05 -1.453730e-05 -1.660969e-07 -5.557621e-06 -1.773587e-04 1.894150e-04 -1.318968e-05 2.463971e-05 -1.058132e-04 2.005832e-03 -4.650691e-05 2.619928e-05 -4.739990e-05 5.642074e-01 -1.808381e-02 -1.117960e-03 -3.102271e-02 -3.626788e-01 3.364099e-01 9.293302e-02 -1.664305e-03 3.565081e-05 -9.577948e-14 2.756848e-03 + 1.197509e-05 -1.335299e-04 5.324632e-04 6.906325e-03 3.767535e-03 9.697638e-06 -8.530258e-05 -9.550186e-06 1.470479e-04 1.389484e-04 8.347604e-05 8.130375e-05 -8.869159e-04 -1.781926e-05 -2.414659e-04 -1.752200e-04 -4.911396e-02 -2.976879e-03 3.492301e-05 3.874726e-03 2.712531e-03 -1.369179e-01 -1.664305e-03 3.731198e-01 8.296338e-04 1.442919e-11 6.159178e-02 + 6.777182e-07 -8.820154e-06 2.129765e-05 1.063569e-05 1.131767e-05 7.736771e-07 1.287541e-06 -2.195769e-06 -3.264674e-06 -5.390549e-06 -1.749373e-06 -3.136340e-06 -4.005608e-06 3.777093e-07 1.033572e-05 -5.769069e-06 -4.732883e-05 3.654253e-05 -5.427980e-07 2.054708e-05 2.347130e-04 -1.803093e-03 3.565081e-05 8.296338e-04 5.462667e-05 2.217831e-14 4.007586e-03 + 7.235976e-16 -2.956279e-15 1.507474e-14 4.011037e-13 1.460042e-13 5.720486e-16 2.032108e-14 -3.884571e-14 -2.946301e-14 -6.781155e-14 -3.594227e-14 -3.016777e-14 2.452478e-14 1.473960e-15 5.698178e-14 -5.232584e-15 5.758056e-12 9.071442e-13 1.311581e-14 2.302574e-13 1.060807e-12 -9.916522e-12 -9.577948e-14 1.442919e-11 2.217831e-14 8.381452e-22 1.893555e-12 + 5.478000e-05 -6.377312e-04 1.555086e-03 9.077986e-04 8.480720e-04 6.389753e-05 9.977298e-05 -1.927229e-04 -2.266320e-04 -4.131433e-04 -1.360365e-04 -2.372048e-04 -3.115967e-04 3.584764e-05 7.944932e-04 -4.114280e-04 -1.588059e-03 2.991911e-03 1.306783e-05 1.434847e-03 1.808377e-02 -1.546286e-01 2.756848e-03 6.159178e-02 4.007586e-03 1.893555e-12 2.976239e-01 From 5bdcb5eddadc3980c8b585196753c2a0d9e8c6a7 Mon Sep 17 00:00:00 2001 From: Matthieu Tristram Date: Tue, 26 Dec 2023 11:08:15 +0100 Subject: [PATCH 10/26] Update param file --- input/Planck20_Hillipop.param | 88 +++++++++++++++++++++++------------ 1 file changed, 59 insertions(+), 29 deletions(-) diff --git a/input/Planck20_Hillipop.param b/input/Planck20_Hillipop.param index 61159f05..2c09e8ab 100644 --- a/input/Planck20_Hillipop.param +++ b/input/Planck20_Hillipop.param @@ -2,7 +2,28 @@ # To see all the available ones, please look in the # montepython/likelihoods folder. Every folder there is a valid likelihood to # test. -data.experiments=['Planck_lowl_TT','Planck20_Lollipop_EE','Planck20_Hillipop_TTTEEE'] +data.experiments=['Planck20_Hillipop_TTTEEE','Planck_lowl_TT','Planck20_Lollipop_EE'] + + +#------ Settings for the over-sampling. +# The first element will always be set to 1, for it is the sampling of the +# cosmological parameters. The other numbers describe the over sampling of the +# nuisance parameter space. This array must have the same dimension as the +# number of blocks in your run (so, 1 for cosmological parameters, and then 1 +# for each experiment with varying nuisance parameters). +# Note that when using Planck likelihoods, you definitely want to use [1, 4], +# to oversample as much as possible the 14 nuisance parameters. +# Remember to order manually the experiments from slowest to fastest (putting +# Planck as the first set of experiments should be a safe bet, except if you +# also have LSS experiments). +# If you have experiments without nuisance, you do not need to specify an +# additional entry in the over_sampling list (notice for instance that, out of +# the three Planck likelihoods used, only Planck_highl requires nuisance +# parameters, therefore over_sampling has a length of two (cosmology, plus one +# set of nuisance). +data.over_sampling=[1, 4] + + #------ Parameter list ------- # data.parameters[class name] = [mean, min, max, 1-sigma, scale, role] @@ -13,45 +34,49 @@ data.experiments=['Planck_lowl_TT','Planck20_Lollipop_EE','Planck20_Hillipop_TTT # Cosmological parameters list -data.parameters['omega_b'] = [2.249, -1,-1, 0.016, 0.01,'cosmo'] -data.parameters['omega_cdm'] = [0.1120, -1,-1, 0.0016,1, 'cosmo'] -data.parameters['n_s'] = [0.963, -1,-1, 0.004, 1, 'cosmo'] -data.parameters['A_s'] = [2.10, -1,-1, 0.038, 1e-9,'cosmo'] -data.parameters['h'] = [0.674, -1,-1, 0.0065,1, 'cosmo'] -data.parameters['tau_reio'] = [0.055, -1,-1, 0.0044,1, 'cosmo'] +data.parameters['omega_b'] = [0.0223, 0.017, 0.027, 0.0002, 1, 'cosmo'] +data.parameters['omega_cdm'] = [0.1188, 0.09, 0.15, 0.002, 1, 'cosmo'] +data.parameters['n_s'] = [ 0.968, 0.9, 1.1, 0.005, 1, 'cosmo'] +data.parameters['ln10^{10}A_s'] = [ 3.040, 2.7, 3.4, 0.02, 1, 'cosmo'] +data.parameters['tau_reio'] = [ 0.058, 0.01, 0.17, 0.008, 1, 'cosmo'] +data.parameters['100*theta_s'] = [1.0410, 1.03, 1.05, 0.0003, 1, 'cosmo'] # Nuisance parameter list, same call, except the name does not have to be a class name # Note the nuisance parameters must follow *immediately after* the cosmo parameters, # MP expects cosmo, nuisance, derived # Nuisance parameters -data.parameters['A_planck'] = [1, 0.9, 1.1, 0.0025, 1, 'nuisance'] -data.parameters['cal100A'] = [1, 0.9, 1.1, 0.01, 1, 'nuisance'] -data.parameters['cal100B'] = [1, 0.9, 1.1, 0.01, 1, 'nuisance'] -data.parameters['cal143A'] = [1, 1, 1, 0, 1, 'nuisance'] -data.parameters['cal143B'] = [1, 0.9, 1.1, 0.01, 1, 'nuisance'] -data.parameters['cal217A'] = [1, 0.9, 1.1, 0.01, 1, 'nuisance'] -data.parameters['cal217B'] = [1, 0.9, 1.1, 0.01, 1, 'nuisance'] - -data.parameters['AdustT'] = [ 1.0, 0.5, 1.5, 0.05, 1, 'nuisance'] -data.parameters['beta_dustT'] = [ 1.51, 1.2, 1.8, 0.01, 1, 'nuisance'] -data.parameters['AdustP'] = [ 1.0, 0.5, 1.5, 0.05, 1, 'nuisance'] -data.parameters['beta_dustP'] = [ 1.58, 1.2, 1.8, 0.01, 1, 'nuisance'] -data.parameters['Aradio'] = [ 60., 0, 150, 1., 1, 'nuisance'] -data.parameters['beta_radio'] = [ -0.8, None, None, 0.00001, 1, 'nuisance'] -data.parameters['Adusty'] = [ 6., 0, 100, 6., 1, 'nuisance'] -data.parameters['beta_dusty'] = [ 1.75, 1.6, 1.9, 0.05, 1, 'nuisance'] -data.parameters['Acib'] = [ 4.0, 0., 20, 1., 1, 'nuisance'] -data.parameters['Atsz'] = [ 3.0, 0., 50, 1., 1, 'nuisance'] -data.parameters['Aksz'] = [ 1.0, 0., 50, 1., 1, 'nuisance'] -data.parameters['xi'] = [ 0.1, -1., 1., 0.1, 1, 'nuisance'] +data.parameters['A_planck'] = [ 1.0, 0.9, 1.1, 0.0025, 1, 'nuisance'] +data.parameters['cal100A'] = [ 1.0, 0.9, 1.1, 0.005, 1, 'nuisance'] +data.parameters['cal100B'] = [ 1.0, 0.9, 1.1, 0.005, 1, 'nuisance'] +data.parameters['cal143A'] = [ 1.0, 1, 1, 0, 1, 'nuisance'] +data.parameters['cal143B'] = [ 1.0, 0.9, 1.1, 0.005, 1, 'nuisance'] +data.parameters['cal217A'] = [ 1.0, 0.9, 1.1, 0.005, 1, 'nuisance'] +data.parameters['cal217B'] = [ 1.0, 0.9, 1.1, 0.005, 1, 'nuisance'] + +data.parameters['AdustT'] = [ 1.0, 0.5, 1.5, 0.03, 1, 'nuisance'] +data.parameters['beta_dustT'] = [ 1.51, 1.2, 1.8, 0.01, 1, 'nuisance'] +data.parameters['AdustP'] = [ 1.0, 0.5, 1.5, 0.03, 1, 'nuisance'] +data.parameters['beta_dustP'] = [ 1.58, 1.2, 1.8, 0.02, 1, 'nuisance'] +data.parameters['Aradio'] = [ 63.3, 0, 150, 4.7, 1, 'nuisance'] +data.parameters['beta_radio'] = [ -0.8, -0.8, -0.8, 0, 1, 'nuisance'] +data.parameters['Adusty'] = [ 6.07, 0, 100, 0.6, 1, 'nuisance'] +data.parameters['beta_dusty'] = [ 1.75, 1.6, 1.9, 0.06, 1, 'nuisance'] +data.parameters['Acib'] = [ 1.0, 0., 20, 0.3, 1, 'nuisance'] +data.parameters['Atsz'] = [ 5.9, 0., 50, 1.6, 1, 'nuisance'] +data.parameters['Aksz'] = [ 1.0, 0., 50, 2.5, 1, 'nuisance'] +data.parameters['xi'] = [ 0.4, -1., 1., 0.3, 1, 'nuisance'] # Derived parameter list -data.parameters['z_reio'] = [0, -1, -1, 0,1, 'derived'] -data.parameters['Omega_Lambda'] = [0, -1, -1, 0,1, 'derived'] +data.parameters['z_reio'] = [0, None, None, 0, 1, 'derived'] +data.parameters['Omega_Lambda'] = [0, None, None, 0, 1, 'derived'] +data.parameters['A_s'] = [0, None, None, 0, 1e-9, 'derived'] +data.parameters['H0'] = [0, None, None, 0, 1, 'derived'] +#data.parameters['sigma8'] = [0, None, None, 0, 1, 'derived'] # CLASS parameters +data.cosmo_arguments['sBBN file'] = data.path['cosmo']+'/external/bbn/sBBN_2017.dat' data.cosmo_arguments['k_pivot'] = 0.05 data.cosmo_arguments['N_ur'] = 2.0328 data.cosmo_arguments['N_ncdm'] = 1 @@ -60,6 +85,11 @@ data.cosmo_arguments['T_ncdm'] = 0.71611 data.cosmo_arguments['l_max_scalars'] = 2500 data.cosmo_arguments['non_linear'] = 'halofit' +# These two are required to get sigma8 as a derived parameter +# (class must compute the P(k) until sufficient k) +#data.cosmo_arguments['output'] = 'mPk' +#data.cosmo_arguments['P_k_max_h/Mpc'] = 1. + #------ Mcmc parameters ---- # Number of steps taken, by default (overwritten by the -N command) From 58d456f300f59f92321663d2f335e727ce06e260 Mon Sep 17 00:00:00 2001 From: Matthieu Tristram Date: Tue, 26 Dec 2023 14:05:59 +0100 Subject: [PATCH 11/26] rename --- input/{Planck20_Hillipop.param => Planck20_TTTEEE.param} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename input/{Planck20_Hillipop.param => Planck20_TTTEEE.param} (100%) diff --git a/input/Planck20_Hillipop.param b/input/Planck20_TTTEEE.param similarity index 100% rename from input/Planck20_Hillipop.param rename to input/Planck20_TTTEEE.param From 58c89f96e082bd0afb385f341cfda3b2cc62a1f4 Mon Sep 17 00:00:00 2001 From: Matthieu TRISTRAM Date: Tue, 26 Dec 2023 16:20:19 +0100 Subject: [PATCH 12/26] Update README --- .../Planck20_Hillipop_TTTEEE_lite/README | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README b/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README index 71d7f32c..4afc2ef2 100644 --- a/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README +++ b/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README @@ -11,18 +11,24 @@ generalization to polarization of the algorithm presented in Tristram et al. 2005) before being compared to the model, which includes CMB and foreground residuals. They cover the multipoles from ~=30 to ~=2500. +Reference: +[Tristram et al., A&A, 2023](https://arxiv.org/abs/2309.10034) + The code is available here: -https://github.com/planck-npipe/hillipop +[https://github.com/planck-npipe/hillipop](https://github.com/planck-npipe/hillipop) This is a wrapper for MontePython. You need to install the code before: -> git clone https://github.com/planck-npipe/hillipop -> cd hillipop -> pip install . +``` +git clone https://github.com/planck-npipe/hillipop +cd hillipop +pip install . +``` Then get the data, untar and set the variable $COBAYA_PACKAGES_PATH to the local directory: -> wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_hillipop_TTTEEE_lite_v4.2.tar.gz -> tar -zxvf planck_2020_hillipop_TTTEEE_lite_v4.2.tar.gz --directory /path/to/data -> export COBAYA_PACKAGES_PATH=/path/to/data - +``` +wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_hillipop_TTTEEE_lite_v4.2.tar.gz +tar -zxvf planck_2020_hillipop_TTTEEE_lite_v4.2.tar.gz --directory /path/to/data +export COBAYA_PACKAGES_PATH=/path/to/data +``` From 466529252d9cbdf858960e00840da3bfa0812b6c Mon Sep 17 00:00:00 2001 From: Matthieu Tristram Date: Tue, 26 Dec 2023 16:21:46 +0100 Subject: [PATCH 13/26] rename readme --- .../Planck20_Hillipop_TTTEEE_lite/README.md | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README.md diff --git a/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README.md b/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README.md new file mode 100644 index 00000000..71d7f32c --- /dev/null +++ b/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README.md @@ -0,0 +1,28 @@ +Hillipop is a high-l polarized likelihood for Planck PR4 data +(lite, i.e. binned version) + +Hillipop is a multifrequency CMB likelihood for Planck data. The +likelihood is a spectrum-based Gaussian approximation for +cross-correlation spectra from Planck 100, 143 and 217GHz +split-frequency maps, with semi-analytic estimates of the Cl +covariance matrix based on the data. The cross-spectra are debiased +from the effects of the mask and the beam leakage using Xpol (a +generalization to polarization of the algorithm presented in Tristram +et al. 2005) before being compared to the model, which includes CMB +and foreground residuals. They cover the multipoles from ~=30 to ~=2500. + +The code is available here: +https://github.com/planck-npipe/hillipop + +This is a wrapper for MontePython. + +You need to install the code before: +> git clone https://github.com/planck-npipe/hillipop +> cd hillipop +> pip install . + +Then get the data, untar and set the variable $COBAYA_PACKAGES_PATH to the local directory: +> wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_hillipop_TTTEEE_lite_v4.2.tar.gz +> tar -zxvf planck_2020_hillipop_TTTEEE_lite_v4.2.tar.gz --directory /path/to/data +> export COBAYA_PACKAGES_PATH=/path/to/data + From 448fdab75807a492ddde85bbb401f85293300189 Mon Sep 17 00:00:00 2001 From: Matthieu Tristram Date: Tue, 26 Dec 2023 16:22:39 +0100 Subject: [PATCH 14/26] rename README --- .../Planck20_Hillipop_TTTEEE_lite/README.md | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README.md b/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README.md index 71d7f32c..4afc2ef2 100644 --- a/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README.md +++ b/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README.md @@ -11,18 +11,24 @@ generalization to polarization of the algorithm presented in Tristram et al. 2005) before being compared to the model, which includes CMB and foreground residuals. They cover the multipoles from ~=30 to ~=2500. +Reference: +[Tristram et al., A&A, 2023](https://arxiv.org/abs/2309.10034) + The code is available here: -https://github.com/planck-npipe/hillipop +[https://github.com/planck-npipe/hillipop](https://github.com/planck-npipe/hillipop) This is a wrapper for MontePython. You need to install the code before: -> git clone https://github.com/planck-npipe/hillipop -> cd hillipop -> pip install . +``` +git clone https://github.com/planck-npipe/hillipop +cd hillipop +pip install . +``` Then get the data, untar and set the variable $COBAYA_PACKAGES_PATH to the local directory: -> wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_hillipop_TTTEEE_lite_v4.2.tar.gz -> tar -zxvf planck_2020_hillipop_TTTEEE_lite_v4.2.tar.gz --directory /path/to/data -> export COBAYA_PACKAGES_PATH=/path/to/data - +``` +wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_hillipop_TTTEEE_lite_v4.2.tar.gz +tar -zxvf planck_2020_hillipop_TTTEEE_lite_v4.2.tar.gz --directory /path/to/data +export COBAYA_PACKAGES_PATH=/path/to/data +``` From e2bace304e3cfb76b1f4e4d83ccee9125b569a14 Mon Sep 17 00:00:00 2001 From: Matthieu TRISTRAM Date: Tue, 26 Dec 2023 16:26:46 +0100 Subject: [PATCH 15/26] Update README.md --- .../Planck20_Hillipop_TTTEEE_lite/README.md | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README.md b/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README.md index 4afc2ef2..ef9115ff 100644 --- a/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README.md +++ b/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README.md @@ -1,22 +1,12 @@ -Hillipop is a high-l polarized likelihood for Planck PR4 data -(lite, i.e. binned version) +# Hillipop is a high-l polarized likelihood for Planck PR4 data (lite, i.e. binned version) -Hillipop is a multifrequency CMB likelihood for Planck data. The -likelihood is a spectrum-based Gaussian approximation for -cross-correlation spectra from Planck 100, 143 and 217GHz -split-frequency maps, with semi-analytic estimates of the Cl -covariance matrix based on the data. The cross-spectra are debiased -from the effects of the mask and the beam leakage using Xpol (a -generalization to polarization of the algorithm presented in Tristram -et al. 2005) before being compared to the model, which includes CMB -and foreground residuals. They cover the multipoles from ~=30 to ~=2500. +Hillipop is a multifrequency CMB likelihood for Planck data. The likelihood is a spectrum-based Gaussian approximation for cross-correlation spectra from Planck 100, 143 and 217GHz split-frequency maps, with semi-analytic estimates of the Cl covariance matrix based on the data. The cross-spectra are debiased from the effects of the mask and the beam leakage using Xpol (a generalization to polarization of the algorithm presented in Tristram et al. 2005) before being compared to the model, which includes CMB and foreground residuals. They cover the multipoles from ℓ = 30 to 2500. Reference: [Tristram et al., A&A, 2023](https://arxiv.org/abs/2309.10034) The code is available here: [https://github.com/planck-npipe/hillipop](https://github.com/planck-npipe/hillipop) - This is a wrapper for MontePython. You need to install the code before: From 7dff4ec4b54fb5b890e38eac6393ded15bbfa9c1 Mon Sep 17 00:00:00 2001 From: Matthieu TRISTRAM Date: Tue, 26 Dec 2023 16:29:49 +0100 Subject: [PATCH 16/26] Update README.md --- montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README.md b/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README.md index ef9115ff..bb8b41eb 100644 --- a/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README.md +++ b/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README.md @@ -11,7 +11,7 @@ This is a wrapper for MontePython. You need to install the code before: ``` -git clone https://github.com/planck-npipe/hillipop +git clone https://github.com/planck-npipe/hillipop --branch v4.3 cd hillipop pip install . ``` From e0b09ffd5e778ae11367bd69c06d7876b78ad054 Mon Sep 17 00:00:00 2001 From: Matthieu Tristram Date: Tue, 26 Dec 2023 16:37:11 +0100 Subject: [PATCH 17/26] rename README --- .../Planck20_Hillipop_TT/README.md | 22 +++++++++++++ .../Planck20_Hillipop_TTTEEE/README.md | 22 +++++++++++++ .../Planck20_Hillipop_TT_lite/README.md | 24 ++++++++++++++ .../Planck20_Lollipop_BB/README.md | 30 ++++++++++++++++++ .../Planck20_Lollipop_EB/README.md | 31 +++++++++++++++++++ .../Planck20_Lollipop_EE/README.md | 31 +++++++++++++++++++ 6 files changed, 160 insertions(+) create mode 100644 montepython/likelihoods/Planck20_Hillipop_TT/README.md create mode 100644 montepython/likelihoods/Planck20_Hillipop_TTTEEE/README.md create mode 100644 montepython/likelihoods/Planck20_Hillipop_TT_lite/README.md create mode 100644 montepython/likelihoods/Planck20_Lollipop_BB/README.md create mode 100644 montepython/likelihoods/Planck20_Lollipop_EB/README.md create mode 100644 montepython/likelihoods/Planck20_Lollipop_EE/README.md diff --git a/montepython/likelihoods/Planck20_Hillipop_TT/README.md b/montepython/likelihoods/Planck20_Hillipop_TT/README.md new file mode 100644 index 00000000..a9820e2d --- /dev/null +++ b/montepython/likelihoods/Planck20_Hillipop_TT/README.md @@ -0,0 +1,22 @@ +# Hillipop is a high-l polarized likelihood for Planck PR4 data. + +Hillipop is a multifrequency CMB likelihood for Planck data. The likelihood is a spectrum-based Gaussian approximation for cross-correlation spectra from Planck 100, 143 and 217GHz split-frequency maps, with semi-analytic estimates of the Cl covariance matrix based on the data. The cross-spectra are debiased from the effects of the mask and the beam leakage using Xpol (a generalization to polarization of the algorithm presented in Tristram et al. 2005) before being compared to the model, which includes CMB and foreground residuals. They cover the multipoles from ℓ = 30 to 2500. + +Reference: +[Tristram et al., A&A, 2023](https://arxiv.org/abs/2309.10034) + +The code is available here: +[https://github.com/planck-npipe/hillipop](https://github.com/planck-npipe/hillipop) +This is a wrapper for MontePython. + +You need to install the code before: +``` +pip install planck-2020-hillipop +``` + +Then get the data, untar and set the variable $COBAYA_PACKAGES_PATH to the local directory: +``` +wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_hillipop_TT_v4.2.tar.gz +tar -zxvf planck_2020_hillipop_TT_v4.2.tar.gz --directory /path/to/data +export COBAYA_PACKAGES_PATH=/path/to/data +``` diff --git a/montepython/likelihoods/Planck20_Hillipop_TTTEEE/README.md b/montepython/likelihoods/Planck20_Hillipop_TTTEEE/README.md new file mode 100644 index 00000000..c0e01698 --- /dev/null +++ b/montepython/likelihoods/Planck20_Hillipop_TTTEEE/README.md @@ -0,0 +1,22 @@ +# Hillipop is a high-l polarized likelihood for Planck PR4 data + +Hillipop is a multifrequency CMB likelihood for Planck data. The likelihood is a spectrum-based Gaussian approximation for cross-correlation spectra from Planck 100, 143 and 217GHz split-frequency maps, with semi-analytic estimates of the Cl covariance matrix based on the data. The cross-spectra are debiased from the effects of the mask and the beam leakage using Xpol (a generalization to polarization of the algorithm presented in Tristram et al. 2005) before being compared to the model, which includes CMB and foreground residuals. They cover the multipoles from ℓ = 30 to 2500. + +Reference: +[Tristram et al., A&A, 2023](https://arxiv.org/abs/2309.10034) + +The code is available here: +[https://github.com/planck-npipe/hillipop](https://github.com/planck-npipe/hillipop) +This is a wrapper for MontePython. + +You need to install the code before: +``` +pip install planck-2020-hillipop +``` + +Then get the data, untar and set the variable $COBAYA_PACKAGES_PATH to the local directory: +``` +wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_hillipop_TTTEEE_v4.2.tar.gz +tar -zxvf planck_2020_hillipop_TTTEEE_v4.2.tar.gz --directory /path/to/data +export COBAYA_PACKAGES_PATH=/path/to/data +``` diff --git a/montepython/likelihoods/Planck20_Hillipop_TT_lite/README.md b/montepython/likelihoods/Planck20_Hillipop_TT_lite/README.md new file mode 100644 index 00000000..381debea --- /dev/null +++ b/montepython/likelihoods/Planck20_Hillipop_TT_lite/README.md @@ -0,0 +1,24 @@ +# Hillipop is a high-l polarized likelihood for Planck PR4 data (lite, i.e. binned version) + +Hillipop is a multifrequency CMB likelihood for Planck data. The likelihood is a spectrum-based Gaussian approximation for cross-correlation spectra from Planck 100, 143 and 217GHz split-frequency maps, with semi-analytic estimates of the Cl covariance matrix based on the data. The cross-spectra are debiased from the effects of the mask and the beam leakage using Xpol (a generalization to polarization of the algorithm presented in Tristram et al. 2005) before being compared to the model, which includes CMB and foreground residuals. They cover the multipoles from ℓ = 30 to 2500. + +Reference: +[Tristram et al., A&A, 2023](https://arxiv.org/abs/2309.10034) + +The code is available here: +[https://github.com/planck-npipe/hillipop](https://github.com/planck-npipe/hillipop) +This is a wrapper for MontePython. + +You need to install the code before: +``` +git clone https://github.com/planck-npipe/hillipop --branch v4.3 +cd hillipop +pip install . +``` + +Then get the data, untar and set the variable $COBAYA_PACKAGES_PATH to the local directory: +``` +wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_hillipop_TT_lite_v4.2.tar.gz +tar -zxvf planck_2020_hillipop_TT_lite_v4.2.tar.gz --directory /path/to/data +export COBAYA_PACKAGES_PATH=/path/to/data +``` diff --git a/montepython/likelihoods/Planck20_Lollipop_BB/README.md b/montepython/likelihoods/Planck20_Lollipop_BB/README.md new file mode 100644 index 00000000..358889ba --- /dev/null +++ b/montepython/likelihoods/Planck20_Lollipop_BB/README.md @@ -0,0 +1,30 @@ +# Lollipop is a low-l polarized likelihood for Planck PR4 data (BB spectrum) + +Lollipop is a Planck low-l polarization likelihood based on +cross-power-spectra for which the bias is zero when the noise is +uncorrelated between maps. It uses the approximation presented in +Hamimeche & Lewis (2008), modified as described in Mangilli et +al. (2015) to apply to cross-power spectra. This version is based on +the Planck PR4 data. Cross-spectra are computed on the CMB maps from +Commander component separation applied on each detset-split Planck +frequency maps. + +Reference: +[Tristram et al., A&A, 2021](https://arxiv.org/abs/2010.01139) +[Tristram et al., A&A, 2022](https://arxiv.org/abs/2112.07961) + +The code is available here: +[https://github.com/planck-npipe/lollipop](https://github.com/planck-npipe/lollipop) +This is a wrapper for MontePython. + +You need to install the code before: +``` +pip install planck-2020-lollipop +``` + +Then get the data, untar and set the variable $COBAYA_PACKAGES_PATH to the local directory: +``` +wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_lollipop.tar.gz +tar -zxvf planck_2020_lollipop.tar.gz --directory /path/to/data +export COBAYA_PACKAGES_PATH=/path/to/data +``` diff --git a/montepython/likelihoods/Planck20_Lollipop_EB/README.md b/montepython/likelihoods/Planck20_Lollipop_EB/README.md new file mode 100644 index 00000000..aaa2a52d --- /dev/null +++ b/montepython/likelihoods/Planck20_Lollipop_EB/README.md @@ -0,0 +1,31 @@ +# Lollipop is a low-l polarized likelihood for Planck PR4 data (EE and +BB spectra) + +Lollipop is a Planck low-l polarization likelihood based on +cross-power-spectra for which the bias is zero when the noise is +uncorrelated between maps. It uses the approximation presented in +Hamimeche & Lewis (2008), modified as described in Mangilli et +al. (2015) to apply to cross-power spectra. This version is based on +the Planck PR4 data. Cross-spectra are computed on the CMB maps from +Commander component separation applied on each detset-split Planck +frequency maps. + +Reference: +[Tristram et al., A&A, 2021](https://arxiv.org/abs/2010.01139) +[Tristram et al., A&A, 2022](https://arxiv.org/abs/2112.07961) + +The code is available here: +[https://github.com/planck-npipe/lollipop](https://github.com/planck-npipe/lollipop) +This is a wrapper for MontePython. + +You need to install the code before: +``` +pip install planck-2020-lollipop +``` + +Then get the data, untar and set the variable $COBAYA_PACKAGES_PATH to the local directory: +``` +wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_lollipop.tar.gz +tar -zxvf planck_2020_lollipop.tar.gz --directory /path/to/data +export COBAYA_PACKAGES_PATH=/path/to/data +``` diff --git a/montepython/likelihoods/Planck20_Lollipop_EE/README.md b/montepython/likelihoods/Planck20_Lollipop_EE/README.md new file mode 100644 index 00000000..d45ff971 --- /dev/null +++ b/montepython/likelihoods/Planck20_Lollipop_EE/README.md @@ -0,0 +1,31 @@ +# Lollipop is a low-l polarized likelihood for Planck PR4 data (EE spectrum) + +Lollipop is a Planck low-l polarization likelihood based on +cross-power-spectra for which the bias is zero when the noise is +uncorrelated between maps. It uses the approximation presented in +Hamimeche & Lewis (2008), modified as described in Mangilli et +al. (2015) to apply to cross-power spectra. This version is based on +the Planck PR4 data. Cross-spectra are computed on the CMB maps from +Commander component separation applied on each detset-split Planck +frequency maps. + +Reference: +[Tristram et al., A&A, 2021](https://arxiv.org/abs/2010.01139) +[Tristram et al., A&A, 2022](https://arxiv.org/abs/2112.07961) + +The code is available here: +[https://github.com/planck-npipe/lollipop](https://github.com/planck-npipe/lollipop) +This is a wrapper for MontePython. + +You need to install the code before: +``` +pip install planck-2020-lollipop +``` + +Then get the data, untar and set the variable $COBAYA_PACKAGES_PATH to the local directory: +``` +wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_lollipop.tar.gz +tar -zxvf planck_2020_lollipop.tar.gz --directory /path/to/data +export COBAYA_PACKAGES_PATH=/path/to/data +``` + From 9342809c20af00a5aa4c38b5033832c5b53ad15e Mon Sep 17 00:00:00 2001 From: Matthieu Tristram Date: Tue, 26 Dec 2023 16:37:40 +0100 Subject: [PATCH 18/26] delete text files --- .../likelihoods/Planck20_Hillipop_TT/README | 25 -------------- .../Planck20_Hillipop_TTTEEE/README | 25 -------------- .../Planck20_Hillipop_TTTEEE_lite/README | 34 ------------------- .../Planck20_Hillipop_TT_lite/README | 28 --------------- .../likelihoods/Planck20_Lollipop_BB/README | 23 ------------- .../likelihoods/Planck20_Lollipop_EB/README | 23 ------------- .../likelihoods/Planck20_Lollipop_EE/README | 23 ------------- 7 files changed, 181 deletions(-) delete mode 100644 montepython/likelihoods/Planck20_Hillipop_TT/README delete mode 100644 montepython/likelihoods/Planck20_Hillipop_TTTEEE/README delete mode 100644 montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README delete mode 100644 montepython/likelihoods/Planck20_Hillipop_TT_lite/README delete mode 100644 montepython/likelihoods/Planck20_Lollipop_BB/README delete mode 100644 montepython/likelihoods/Planck20_Lollipop_EB/README delete mode 100644 montepython/likelihoods/Planck20_Lollipop_EE/README diff --git a/montepython/likelihoods/Planck20_Hillipop_TT/README b/montepython/likelihoods/Planck20_Hillipop_TT/README deleted file mode 100644 index c5092ba6..00000000 --- a/montepython/likelihoods/Planck20_Hillipop_TT/README +++ /dev/null @@ -1,25 +0,0 @@ -Hillipop is a high-l polarized likelihood for Planck PR4 data. - -Hillipop is a multifrequency CMB likelihood for Planck data. The -likelihood is a spectrum-based Gaussian approximation for -cross-correlation spectra from Planck 100, 143 and 217GHz -split-frequency maps, with semi-analytic estimates of the Cl -covariance matrix based on the data. The cross-spectra are debiased -from the effects of the mask and the beam leakage using Xpol (a -generalization to polarization of the algorithm presented in Tristram -et al. 2005) before being compared to the model, which includes CMB -and foreground residuals. They cover the multipoles from ~=30 to ~=2500. - -The code is available here: -https://github.com/planck-npipe/hillipop - -This is a wrapper for MontePython. - -You need to install the code before: -> pip install planck-2020-hillipop - -Then get the data, untar and set the variable $COBAYA_PACKAGES_PATH to the local directory: -> wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_hillipop_TT_v4.2.tar.gz -> tar -zxvf planck_2020_hillipop_TT_v4.2.tar.gz --directory /path/to/data -> export COBAYA_PACKAGES_PATH=/path/to/data - diff --git a/montepython/likelihoods/Planck20_Hillipop_TTTEEE/README b/montepython/likelihoods/Planck20_Hillipop_TTTEEE/README deleted file mode 100644 index c6cc1bf7..00000000 --- a/montepython/likelihoods/Planck20_Hillipop_TTTEEE/README +++ /dev/null @@ -1,25 +0,0 @@ -Hillipop is a high-l polarized likelihood for Planck PR4 data. - -Hillipop is a multifrequency CMB likelihood for Planck data. The -likelihood is a spectrum-based Gaussian approximation for -cross-correlation spectra from Planck 100, 143 and 217GHz -split-frequency maps, with semi-analytic estimates of the Cl -covariance matrix based on the data. The cross-spectra are debiased -from the effects of the mask and the beam leakage using Xpol (a -generalization to polarization of the algorithm presented in Tristram -et al. 2005) before being compared to the model, which includes CMB -and foreground residuals. They cover the multipoles from ~=30 to ~=2500. - -The code is available here: -https://github.com/planck-npipe/hillipop - -This is a wrapper for MontePython. - -You need to install the code before: -> pip install planck-2020-hillipop - -Then get the data, untar and set the variable $COBAYA_PACKAGES_PATH to the local directory: -> wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_hillipop_TTTEEE_v4.2.tar.gz -> tar -zxvf planck_2020_hillipop_TTTEEE_v4.2.tar.gz --directory /path/to/data -> export COBAYA_PACKAGES_PATH=/path/to/data - diff --git a/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README b/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README deleted file mode 100644 index 4afc2ef2..00000000 --- a/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README +++ /dev/null @@ -1,34 +0,0 @@ -Hillipop is a high-l polarized likelihood for Planck PR4 data -(lite, i.e. binned version) - -Hillipop is a multifrequency CMB likelihood for Planck data. The -likelihood is a spectrum-based Gaussian approximation for -cross-correlation spectra from Planck 100, 143 and 217GHz -split-frequency maps, with semi-analytic estimates of the Cl -covariance matrix based on the data. The cross-spectra are debiased -from the effects of the mask and the beam leakage using Xpol (a -generalization to polarization of the algorithm presented in Tristram -et al. 2005) before being compared to the model, which includes CMB -and foreground residuals. They cover the multipoles from ~=30 to ~=2500. - -Reference: -[Tristram et al., A&A, 2023](https://arxiv.org/abs/2309.10034) - -The code is available here: -[https://github.com/planck-npipe/hillipop](https://github.com/planck-npipe/hillipop) - -This is a wrapper for MontePython. - -You need to install the code before: -``` -git clone https://github.com/planck-npipe/hillipop -cd hillipop -pip install . -``` - -Then get the data, untar and set the variable $COBAYA_PACKAGES_PATH to the local directory: -``` -wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_hillipop_TTTEEE_lite_v4.2.tar.gz -tar -zxvf planck_2020_hillipop_TTTEEE_lite_v4.2.tar.gz --directory /path/to/data -export COBAYA_PACKAGES_PATH=/path/to/data -``` diff --git a/montepython/likelihoods/Planck20_Hillipop_TT_lite/README b/montepython/likelihoods/Planck20_Hillipop_TT_lite/README deleted file mode 100644 index 81546c06..00000000 --- a/montepython/likelihoods/Planck20_Hillipop_TT_lite/README +++ /dev/null @@ -1,28 +0,0 @@ -Hillipop is a high-l polarized likelihood for Planck PR4 data. -(lite, i.e. binned version) - -Hillipop is a multifrequency CMB likelihood for Planck data. The -likelihood is a spectrum-based Gaussian approximation for -cross-correlation spectra from Planck 100, 143 and 217GHz -split-frequency maps, with semi-analytic estimates of the Cl -covariance matrix based on the data. The cross-spectra are debiased -from the effects of the mask and the beam leakage using Xpol (a -generalization to polarization of the algorithm presented in Tristram -et al. 2005) before being compared to the model, which includes CMB -and foreground residuals. They cover the multipoles from ~=30 to ~=2500. - -The code is available here: -https://github.com/planck-npipe/hillipop - -This is a wrapper for MontePython. - -You need to install the code before: -> git clone https://github.com/planck-npipe/hillipop -> cd hillipop -> pip install . - -Then get the data, untar and set the variable $COBAYA_PACKAGES_PATH to the local directory: -> wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_hillipop_TT_lite_v4.2.tar.gz -> tar -zxvf planck_2020_hillipop_TT_lite_v4.2.tar.gz --directory /path/to/data -> export COBAYA_PACKAGES_PATH=/path/to/data - diff --git a/montepython/likelihoods/Planck20_Lollipop_BB/README b/montepython/likelihoods/Planck20_Lollipop_BB/README deleted file mode 100644 index c84a951f..00000000 --- a/montepython/likelihoods/Planck20_Lollipop_BB/README +++ /dev/null @@ -1,23 +0,0 @@ -Lollipop is a low-l polarized likelihood for Planck PR4 data. - -Lollipop is a Planck low-l polarization likelihood based on -cross-power-spectra for which the bias is zero when the noise is -uncorrelated between maps. It uses the approximation presented in -Hamimeche & Lewis (2008), modified as described in Mangilli et -al. (2015) to apply to cross-power spectra. This version is based on -the Planck PR4 data. Cross-spectra are computed on the CMB maps from -Commander component separation applied on each detset-split Planck -frequency maps. - -The code is available here: -https://github.com/planck-npipe/lollipop - -This is a wrapper for MontePython. - -You need to install the code before: -> pip install planck-2020-lollipop - -Then get the data, untar and set the variable $COBAYA_PACKAGES_PATH to the local directory: -> wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_lollipop.tar.gz -> tar -zxvf planck_2020_lollipop.tar.gz --directory /path/to/data -> export COBAYA_PACKAGES_PATH=/path/to/data diff --git a/montepython/likelihoods/Planck20_Lollipop_EB/README b/montepython/likelihoods/Planck20_Lollipop_EB/README deleted file mode 100644 index c84a951f..00000000 --- a/montepython/likelihoods/Planck20_Lollipop_EB/README +++ /dev/null @@ -1,23 +0,0 @@ -Lollipop is a low-l polarized likelihood for Planck PR4 data. - -Lollipop is a Planck low-l polarization likelihood based on -cross-power-spectra for which the bias is zero when the noise is -uncorrelated between maps. It uses the approximation presented in -Hamimeche & Lewis (2008), modified as described in Mangilli et -al. (2015) to apply to cross-power spectra. This version is based on -the Planck PR4 data. Cross-spectra are computed on the CMB maps from -Commander component separation applied on each detset-split Planck -frequency maps. - -The code is available here: -https://github.com/planck-npipe/lollipop - -This is a wrapper for MontePython. - -You need to install the code before: -> pip install planck-2020-lollipop - -Then get the data, untar and set the variable $COBAYA_PACKAGES_PATH to the local directory: -> wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_lollipop.tar.gz -> tar -zxvf planck_2020_lollipop.tar.gz --directory /path/to/data -> export COBAYA_PACKAGES_PATH=/path/to/data diff --git a/montepython/likelihoods/Planck20_Lollipop_EE/README b/montepython/likelihoods/Planck20_Lollipop_EE/README deleted file mode 100644 index c84a951f..00000000 --- a/montepython/likelihoods/Planck20_Lollipop_EE/README +++ /dev/null @@ -1,23 +0,0 @@ -Lollipop is a low-l polarized likelihood for Planck PR4 data. - -Lollipop is a Planck low-l polarization likelihood based on -cross-power-spectra for which the bias is zero when the noise is -uncorrelated between maps. It uses the approximation presented in -Hamimeche & Lewis (2008), modified as described in Mangilli et -al. (2015) to apply to cross-power spectra. This version is based on -the Planck PR4 data. Cross-spectra are computed on the CMB maps from -Commander component separation applied on each detset-split Planck -frequency maps. - -The code is available here: -https://github.com/planck-npipe/lollipop - -This is a wrapper for MontePython. - -You need to install the code before: -> pip install planck-2020-lollipop - -Then get the data, untar and set the variable $COBAYA_PACKAGES_PATH to the local directory: -> wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_lollipop.tar.gz -> tar -zxvf planck_2020_lollipop.tar.gz --directory /path/to/data -> export COBAYA_PACKAGES_PATH=/path/to/data From 5f8e508b12380bbc03336209454aba65ed48935b Mon Sep 17 00:00:00 2001 From: Matthieu Tristram Date: Tue, 26 Dec 2023 16:41:02 +0100 Subject: [PATCH 19/26] Update readmes --- .../likelihoods/Planck20_Lollipop_BB/README.md | 8 ++++---- .../likelihoods/Planck20_Lollipop_EB/README.md | 11 +++++------ .../likelihoods/Planck20_Lollipop_EE/README.md | 8 ++++---- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/montepython/likelihoods/Planck20_Lollipop_BB/README.md b/montepython/likelihoods/Planck20_Lollipop_BB/README.md index 358889ba..3265c85f 100644 --- a/montepython/likelihoods/Planck20_Lollipop_BB/README.md +++ b/montepython/likelihoods/Planck20_Lollipop_BB/README.md @@ -9,12 +9,12 @@ the Planck PR4 data. Cross-spectra are computed on the CMB maps from Commander component separation applied on each detset-split Planck frequency maps. -Reference: -[Tristram et al., A&A, 2021](https://arxiv.org/abs/2010.01139) +References:\ +[Tristram et al., A&A, 2021](https://arxiv.org/abs/2010.01139)\ [Tristram et al., A&A, 2022](https://arxiv.org/abs/2112.07961) -The code is available here: -[https://github.com/planck-npipe/lollipop](https://github.com/planck-npipe/lollipop) +The code is available here:\ +[https://github.com/planck-npipe/lollipop](https://github.com/planck-npipe/lollipop)\ This is a wrapper for MontePython. You need to install the code before: diff --git a/montepython/likelihoods/Planck20_Lollipop_EB/README.md b/montepython/likelihoods/Planck20_Lollipop_EB/README.md index aaa2a52d..e5075e71 100644 --- a/montepython/likelihoods/Planck20_Lollipop_EB/README.md +++ b/montepython/likelihoods/Planck20_Lollipop_EB/README.md @@ -1,5 +1,4 @@ -# Lollipop is a low-l polarized likelihood for Planck PR4 data (EE and -BB spectra) +# Lollipop is a low-l polarized likelihood for Planck PR4 data (EE and BB spectra) Lollipop is a Planck low-l polarization likelihood based on cross-power-spectra for which the bias is zero when the noise is @@ -10,12 +9,12 @@ the Planck PR4 data. Cross-spectra are computed on the CMB maps from Commander component separation applied on each detset-split Planck frequency maps. -Reference: -[Tristram et al., A&A, 2021](https://arxiv.org/abs/2010.01139) +References:\ +[Tristram et al., A&A, 2021](https://arxiv.org/abs/2010.01139)\ [Tristram et al., A&A, 2022](https://arxiv.org/abs/2112.07961) -The code is available here: -[https://github.com/planck-npipe/lollipop](https://github.com/planck-npipe/lollipop) +The code is available here:\ +[https://github.com/planck-npipe/lollipop](https://github.com/planck-npipe/lollipop)\ This is a wrapper for MontePython. You need to install the code before: diff --git a/montepython/likelihoods/Planck20_Lollipop_EE/README.md b/montepython/likelihoods/Planck20_Lollipop_EE/README.md index d45ff971..539f802a 100644 --- a/montepython/likelihoods/Planck20_Lollipop_EE/README.md +++ b/montepython/likelihoods/Planck20_Lollipop_EE/README.md @@ -9,12 +9,12 @@ the Planck PR4 data. Cross-spectra are computed on the CMB maps from Commander component separation applied on each detset-split Planck frequency maps. -Reference: -[Tristram et al., A&A, 2021](https://arxiv.org/abs/2010.01139) +References:\ +[Tristram et al., A&A, 2021](https://arxiv.org/abs/2010.01139)\ [Tristram et al., A&A, 2022](https://arxiv.org/abs/2112.07961) -The code is available here: -[https://github.com/planck-npipe/lollipop](https://github.com/planck-npipe/lollipop) +The code is available here:\ +[https://github.com/planck-npipe/lollipop](https://github.com/planck-npipe/lollipop)\ This is a wrapper for MontePython. You need to install the code before: From 6d71546c61d4485617095a8efe6c9ca578a145ac Mon Sep 17 00:00:00 2001 From: Matthieu TRISTRAM Date: Tue, 26 Dec 2023 16:43:11 +0100 Subject: [PATCH 20/26] Update README.md --- montepython/likelihoods/Planck20_Hillipop_TTTEEE/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/montepython/likelihoods/Planck20_Hillipop_TTTEEE/README.md b/montepython/likelihoods/Planck20_Hillipop_TTTEEE/README.md index c0e01698..f267371e 100644 --- a/montepython/likelihoods/Planck20_Hillipop_TTTEEE/README.md +++ b/montepython/likelihoods/Planck20_Hillipop_TTTEEE/README.md @@ -2,11 +2,11 @@ Hillipop is a multifrequency CMB likelihood for Planck data. The likelihood is a spectrum-based Gaussian approximation for cross-correlation spectra from Planck 100, 143 and 217GHz split-frequency maps, with semi-analytic estimates of the Cl covariance matrix based on the data. The cross-spectra are debiased from the effects of the mask and the beam leakage using Xpol (a generalization to polarization of the algorithm presented in Tristram et al. 2005) before being compared to the model, which includes CMB and foreground residuals. They cover the multipoles from ℓ = 30 to 2500. -Reference: +Reference:\ [Tristram et al., A&A, 2023](https://arxiv.org/abs/2309.10034) -The code is available here: -[https://github.com/planck-npipe/hillipop](https://github.com/planck-npipe/hillipop) +The code is available here:\ +[https://github.com/planck-npipe/hillipop](https://github.com/planck-npipe/hillipop)\ This is a wrapper for MontePython. You need to install the code before: From db6a32b911fce61868012314552a19c0d39750a0 Mon Sep 17 00:00:00 2001 From: Matthieu TRISTRAM Date: Tue, 26 Dec 2023 16:43:33 +0100 Subject: [PATCH 21/26] Update README.md --- montepython/likelihoods/Planck20_Hillipop_TT/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/montepython/likelihoods/Planck20_Hillipop_TT/README.md b/montepython/likelihoods/Planck20_Hillipop_TT/README.md index a9820e2d..bc4e6a6d 100644 --- a/montepython/likelihoods/Planck20_Hillipop_TT/README.md +++ b/montepython/likelihoods/Planck20_Hillipop_TT/README.md @@ -2,11 +2,11 @@ Hillipop is a multifrequency CMB likelihood for Planck data. The likelihood is a spectrum-based Gaussian approximation for cross-correlation spectra from Planck 100, 143 and 217GHz split-frequency maps, with semi-analytic estimates of the Cl covariance matrix based on the data. The cross-spectra are debiased from the effects of the mask and the beam leakage using Xpol (a generalization to polarization of the algorithm presented in Tristram et al. 2005) before being compared to the model, which includes CMB and foreground residuals. They cover the multipoles from ℓ = 30 to 2500. -Reference: +Reference:\ [Tristram et al., A&A, 2023](https://arxiv.org/abs/2309.10034) -The code is available here: -[https://github.com/planck-npipe/hillipop](https://github.com/planck-npipe/hillipop) +The code is available here:\ +[https://github.com/planck-npipe/hillipop](https://github.com/planck-npipe/hillipop)\ This is a wrapper for MontePython. You need to install the code before: From 35cf41bf8eb6f1366026979ec4de69e77e15ba99 Mon Sep 17 00:00:00 2001 From: Matthieu TRISTRAM Date: Tue, 26 Dec 2023 16:43:47 +0100 Subject: [PATCH 22/26] Update README.md --- .../likelihoods/Planck20_Hillipop_TTTEEE_lite/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README.md b/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README.md index bb8b41eb..adc7d764 100644 --- a/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README.md +++ b/montepython/likelihoods/Planck20_Hillipop_TTTEEE_lite/README.md @@ -2,11 +2,11 @@ Hillipop is a multifrequency CMB likelihood for Planck data. The likelihood is a spectrum-based Gaussian approximation for cross-correlation spectra from Planck 100, 143 and 217GHz split-frequency maps, with semi-analytic estimates of the Cl covariance matrix based on the data. The cross-spectra are debiased from the effects of the mask and the beam leakage using Xpol (a generalization to polarization of the algorithm presented in Tristram et al. 2005) before being compared to the model, which includes CMB and foreground residuals. They cover the multipoles from ℓ = 30 to 2500. -Reference: +Reference:\ [Tristram et al., A&A, 2023](https://arxiv.org/abs/2309.10034) -The code is available here: -[https://github.com/planck-npipe/hillipop](https://github.com/planck-npipe/hillipop) +The code is available here:\ +[https://github.com/planck-npipe/hillipop](https://github.com/planck-npipe/hillipop)\ This is a wrapper for MontePython. You need to install the code before: From 97567babafe4d0d682fed39651e344ac49bdd622 Mon Sep 17 00:00:00 2001 From: Matthieu TRISTRAM Date: Tue, 26 Dec 2023 16:44:01 +0100 Subject: [PATCH 23/26] Update README.md --- montepython/likelihoods/Planck20_Hillipop_TT_lite/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/montepython/likelihoods/Planck20_Hillipop_TT_lite/README.md b/montepython/likelihoods/Planck20_Hillipop_TT_lite/README.md index 381debea..a0a1b915 100644 --- a/montepython/likelihoods/Planck20_Hillipop_TT_lite/README.md +++ b/montepython/likelihoods/Planck20_Hillipop_TT_lite/README.md @@ -2,11 +2,11 @@ Hillipop is a multifrequency CMB likelihood for Planck data. The likelihood is a spectrum-based Gaussian approximation for cross-correlation spectra from Planck 100, 143 and 217GHz split-frequency maps, with semi-analytic estimates of the Cl covariance matrix based on the data. The cross-spectra are debiased from the effects of the mask and the beam leakage using Xpol (a generalization to polarization of the algorithm presented in Tristram et al. 2005) before being compared to the model, which includes CMB and foreground residuals. They cover the multipoles from ℓ = 30 to 2500. -Reference: +Reference:\ [Tristram et al., A&A, 2023](https://arxiv.org/abs/2309.10034) -The code is available here: -[https://github.com/planck-npipe/hillipop](https://github.com/planck-npipe/hillipop) +The code is available here:\ +[https://github.com/planck-npipe/hillipop](https://github.com/planck-npipe/hillipop)\ This is a wrapper for MontePython. You need to install the code before: From 4071e321f21e2800ed629030627aa83a599c754d Mon Sep 17 00:00:00 2001 From: Matthieu TRISTRAM Date: Tue, 26 Dec 2023 17:52:11 +0100 Subject: [PATCH 24/26] Update README.md --- montepython/likelihoods/Planck20_Lollipop_EB/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/montepython/likelihoods/Planck20_Lollipop_EB/README.md b/montepython/likelihoods/Planck20_Lollipop_EB/README.md index e5075e71..a11333f1 100644 --- a/montepython/likelihoods/Planck20_Lollipop_EB/README.md +++ b/montepython/likelihoods/Planck20_Lollipop_EB/README.md @@ -1,4 +1,4 @@ -# Lollipop is a low-l polarized likelihood for Planck PR4 data (EE and BB spectra) +# Lollipop is a low-l polarized likelihood for Planck PR4 data (EE, BB, and EB spectra) Lollipop is a Planck low-l polarization likelihood based on cross-power-spectra for which the bias is zero when the noise is From 6947bdec4cb62513e35e039a1a5ebbab726eaffe Mon Sep 17 00:00:00 2001 From: Matthieu Tristram Date: Tue, 26 Dec 2023 18:02:38 +0100 Subject: [PATCH 25/26] Rename likelihood lollipop EE+BB+EB --- .../Planck20_Lollipop_EEBBEB.data | 17 ++++++ .../Planck20_Lollipop_EEBBEB.py | 59 +++++++++++++++++++ .../Planck20_Lollipop_EEBBEB/README.md | 30 ++++++++++ .../Planck20_Lollipop_EEBBEB/__init__.py | 1 + 4 files changed, 107 insertions(+) create mode 100755 montepython/likelihoods/Planck20_Lollipop_EEBBEB/Planck20_Lollipop_EEBBEB.data create mode 100644 montepython/likelihoods/Planck20_Lollipop_EEBBEB/Planck20_Lollipop_EEBBEB.py create mode 100644 montepython/likelihoods/Planck20_Lollipop_EEBBEB/README.md create mode 100644 montepython/likelihoods/Planck20_Lollipop_EEBBEB/__init__.py diff --git a/montepython/likelihoods/Planck20_Lollipop_EEBBEB/Planck20_Lollipop_EEBBEB.data b/montepython/likelihoods/Planck20_Lollipop_EEBBEB/Planck20_Lollipop_EEBBEB.data new file mode 100755 index 00000000..65aa2908 --- /dev/null +++ b/montepython/likelihoods/Planck20_Lollipop_EEBBEB/Planck20_Lollipop_EEBBEB.data @@ -0,0 +1,17 @@ +Planck20_Lollipop_EB.data_directory = '' +Planck20_Lollipop_EB.file = '' + +Planck20_Lollipop_EB.Nsim = 400 +Planck20_Lollipop_EB.lmin = 2 +Planck20_Lollipop_EB.lmax = 30 +Planck20_Lollipop_EB.use_nuisance = ['A_planck'] + +# note concerning the Planck likelihoods: +# This likelihood has a nuisance parameter A_planck that should be declared in +# your input parameter file. +# Usually this likelihood is used in combination with the highl likelihood, +# which imposes a gaussian prior on this nuisance parameter. +# If you run this likelihood alone (without any highl one), you need to +# impose the gaussian prior here. In that case, uncomment the two lines: +#Planck20_Lollipop_EB.A_planck_prior_center = 1 +#Planck20_Lollipop_EB.A_planck_prior_std = 0.0025 diff --git a/montepython/likelihoods/Planck20_Lollipop_EEBBEB/Planck20_Lollipop_EEBBEB.py b/montepython/likelihoods/Planck20_Lollipop_EEBBEB/Planck20_Lollipop_EEBBEB.py new file mode 100644 index 00000000..3ed6c1d0 --- /dev/null +++ b/montepython/likelihoods/Planck20_Lollipop_EEBBEB/Planck20_Lollipop_EEBBEB.py @@ -0,0 +1,59 @@ +from montepython.likelihood_class import Likelihood +import numpy as np +import planck_2020_lollipop +import os +import tempfile + +packages_path = os.environ.get("COBAYA_PACKAGES_PATH") or os.path.join( + tempfile.gettempdir(), "Lollipop_packages" +) + +hartlap_factor = False +marginalised_over_covariance = True + + +class Planck20_Lollipop_EB(Likelihood): + def __init__(self, path, data, command_line): + Likelihood.__init__(self, path, data, command_line) + + #Create Cobaya likelihood + self.lik = planck_2020_lollipop.lowlEB({"packages_path": packages_path, "Nsim": self.Nsim, "lmin":self.lmin, "lmax":self.lmax}) + + self.need_cosmo_arguments( + data, {'lensing': 'yes', 'output': 'pCl lCl', 'non_linear': 'halofit', 'l_max_scalars': self.lik.bins.lmax}) + + print( "Init Lollipop (lowlEB) done !") + + def loglkl(self, cosmo, data): + +# print( {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['cosmo'])}) + cls = self.get_cl(cosmo) + + data_params = {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['nuisance'])} +# print(data_params) + + #compute log-likelihood + lkl = self.lik.loglike(cls, **data_params) + + #Add priors + lkl = self.add_nuisance_prior(lkl, data) + + return lkl + + + def add_nuisance_prior(self, lkl, data): + # Recover the current value of the nuisance parameter. + for nuisance in self.use_nuisance: + nuisance_value = float( + data.mcmc_parameters[nuisance]['current'] * + data.mcmc_parameters[nuisance]['scale']) + + # add prior on nuisance parameters + if hasattr(self, "%s_prior_center" % nuisance) and getattr(self, "%s_prior_std" % nuisance) > 0: + # convenience variables + prior_center = getattr(self, "%s_prior_center" % nuisance) + prior_std = getattr(self, "%s_prior_std" % nuisance) + lkl += -0.5*((nuisance_value-prior_center)/prior_std)**2 + return lkl + + diff --git a/montepython/likelihoods/Planck20_Lollipop_EEBBEB/README.md b/montepython/likelihoods/Planck20_Lollipop_EEBBEB/README.md new file mode 100644 index 00000000..e5075e71 --- /dev/null +++ b/montepython/likelihoods/Planck20_Lollipop_EEBBEB/README.md @@ -0,0 +1,30 @@ +# Lollipop is a low-l polarized likelihood for Planck PR4 data (EE and BB spectra) + +Lollipop is a Planck low-l polarization likelihood based on +cross-power-spectra for which the bias is zero when the noise is +uncorrelated between maps. It uses the approximation presented in +Hamimeche & Lewis (2008), modified as described in Mangilli et +al. (2015) to apply to cross-power spectra. This version is based on +the Planck PR4 data. Cross-spectra are computed on the CMB maps from +Commander component separation applied on each detset-split Planck +frequency maps. + +References:\ +[Tristram et al., A&A, 2021](https://arxiv.org/abs/2010.01139)\ +[Tristram et al., A&A, 2022](https://arxiv.org/abs/2112.07961) + +The code is available here:\ +[https://github.com/planck-npipe/lollipop](https://github.com/planck-npipe/lollipop)\ +This is a wrapper for MontePython. + +You need to install the code before: +``` +pip install planck-2020-lollipop +``` + +Then get the data, untar and set the variable $COBAYA_PACKAGES_PATH to the local directory: +``` +wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_lollipop.tar.gz +tar -zxvf planck_2020_lollipop.tar.gz --directory /path/to/data +export COBAYA_PACKAGES_PATH=/path/to/data +``` diff --git a/montepython/likelihoods/Planck20_Lollipop_EEBBEB/__init__.py b/montepython/likelihoods/Planck20_Lollipop_EEBBEB/__init__.py new file mode 100644 index 00000000..8c9ab70d --- /dev/null +++ b/montepython/likelihoods/Planck20_Lollipop_EEBBEB/__init__.py @@ -0,0 +1 @@ +from .Planck20_Lollipop_EB import Planck20_Lollipop_EB From 29cf1e789209b1fc4e8ff0340f311f935c229537 Mon Sep 17 00:00:00 2001 From: Matthieu Tristram Date: Tue, 26 Dec 2023 18:03:10 +0100 Subject: [PATCH 26/26] Rename lollipop EB --- .../Planck20_Lollipop_EB.data | 17 ------ .../Planck20_Lollipop_EB.py | 59 ------------------- .../Planck20_Lollipop_EB/README.md | 30 ---------- .../Planck20_Lollipop_EB/__init__.py | 1 - 4 files changed, 107 deletions(-) delete mode 100755 montepython/likelihoods/Planck20_Lollipop_EB/Planck20_Lollipop_EB.data delete mode 100644 montepython/likelihoods/Planck20_Lollipop_EB/Planck20_Lollipop_EB.py delete mode 100644 montepython/likelihoods/Planck20_Lollipop_EB/README.md delete mode 100644 montepython/likelihoods/Planck20_Lollipop_EB/__init__.py diff --git a/montepython/likelihoods/Planck20_Lollipop_EB/Planck20_Lollipop_EB.data b/montepython/likelihoods/Planck20_Lollipop_EB/Planck20_Lollipop_EB.data deleted file mode 100755 index 65aa2908..00000000 --- a/montepython/likelihoods/Planck20_Lollipop_EB/Planck20_Lollipop_EB.data +++ /dev/null @@ -1,17 +0,0 @@ -Planck20_Lollipop_EB.data_directory = '' -Planck20_Lollipop_EB.file = '' - -Planck20_Lollipop_EB.Nsim = 400 -Planck20_Lollipop_EB.lmin = 2 -Planck20_Lollipop_EB.lmax = 30 -Planck20_Lollipop_EB.use_nuisance = ['A_planck'] - -# note concerning the Planck likelihoods: -# This likelihood has a nuisance parameter A_planck that should be declared in -# your input parameter file. -# Usually this likelihood is used in combination with the highl likelihood, -# which imposes a gaussian prior on this nuisance parameter. -# If you run this likelihood alone (without any highl one), you need to -# impose the gaussian prior here. In that case, uncomment the two lines: -#Planck20_Lollipop_EB.A_planck_prior_center = 1 -#Planck20_Lollipop_EB.A_planck_prior_std = 0.0025 diff --git a/montepython/likelihoods/Planck20_Lollipop_EB/Planck20_Lollipop_EB.py b/montepython/likelihoods/Planck20_Lollipop_EB/Planck20_Lollipop_EB.py deleted file mode 100644 index 3ed6c1d0..00000000 --- a/montepython/likelihoods/Planck20_Lollipop_EB/Planck20_Lollipop_EB.py +++ /dev/null @@ -1,59 +0,0 @@ -from montepython.likelihood_class import Likelihood -import numpy as np -import planck_2020_lollipop -import os -import tempfile - -packages_path = os.environ.get("COBAYA_PACKAGES_PATH") or os.path.join( - tempfile.gettempdir(), "Lollipop_packages" -) - -hartlap_factor = False -marginalised_over_covariance = True - - -class Planck20_Lollipop_EB(Likelihood): - def __init__(self, path, data, command_line): - Likelihood.__init__(self, path, data, command_line) - - #Create Cobaya likelihood - self.lik = planck_2020_lollipop.lowlEB({"packages_path": packages_path, "Nsim": self.Nsim, "lmin":self.lmin, "lmax":self.lmax}) - - self.need_cosmo_arguments( - data, {'lensing': 'yes', 'output': 'pCl lCl', 'non_linear': 'halofit', 'l_max_scalars': self.lik.bins.lmax}) - - print( "Init Lollipop (lowlEB) done !") - - def loglkl(self, cosmo, data): - -# print( {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['cosmo'])}) - cls = self.get_cl(cosmo) - - data_params = {par:data.mcmc_parameters[par]['current'] for par in data.get_mcmc_parameters(['nuisance'])} -# print(data_params) - - #compute log-likelihood - lkl = self.lik.loglike(cls, **data_params) - - #Add priors - lkl = self.add_nuisance_prior(lkl, data) - - return lkl - - - def add_nuisance_prior(self, lkl, data): - # Recover the current value of the nuisance parameter. - for nuisance in self.use_nuisance: - nuisance_value = float( - data.mcmc_parameters[nuisance]['current'] * - data.mcmc_parameters[nuisance]['scale']) - - # add prior on nuisance parameters - if hasattr(self, "%s_prior_center" % nuisance) and getattr(self, "%s_prior_std" % nuisance) > 0: - # convenience variables - prior_center = getattr(self, "%s_prior_center" % nuisance) - prior_std = getattr(self, "%s_prior_std" % nuisance) - lkl += -0.5*((nuisance_value-prior_center)/prior_std)**2 - return lkl - - diff --git a/montepython/likelihoods/Planck20_Lollipop_EB/README.md b/montepython/likelihoods/Planck20_Lollipop_EB/README.md deleted file mode 100644 index e5075e71..00000000 --- a/montepython/likelihoods/Planck20_Lollipop_EB/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# Lollipop is a low-l polarized likelihood for Planck PR4 data (EE and BB spectra) - -Lollipop is a Planck low-l polarization likelihood based on -cross-power-spectra for which the bias is zero when the noise is -uncorrelated between maps. It uses the approximation presented in -Hamimeche & Lewis (2008), modified as described in Mangilli et -al. (2015) to apply to cross-power spectra. This version is based on -the Planck PR4 data. Cross-spectra are computed on the CMB maps from -Commander component separation applied on each detset-split Planck -frequency maps. - -References:\ -[Tristram et al., A&A, 2021](https://arxiv.org/abs/2010.01139)\ -[Tristram et al., A&A, 2022](https://arxiv.org/abs/2112.07961) - -The code is available here:\ -[https://github.com/planck-npipe/lollipop](https://github.com/planck-npipe/lollipop)\ -This is a wrapper for MontePython. - -You need to install the code before: -``` -pip install planck-2020-lollipop -``` - -Then get the data, untar and set the variable $COBAYA_PACKAGES_PATH to the local directory: -``` -wget https://portal.nersc.gov/cfs/cmb/planck2020/likelihoods/planck_2020_lollipop.tar.gz -tar -zxvf planck_2020_lollipop.tar.gz --directory /path/to/data -export COBAYA_PACKAGES_PATH=/path/to/data -``` diff --git a/montepython/likelihoods/Planck20_Lollipop_EB/__init__.py b/montepython/likelihoods/Planck20_Lollipop_EB/__init__.py deleted file mode 100644 index 8c9ab70d..00000000 --- a/montepython/likelihoods/Planck20_Lollipop_EB/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .Planck20_Lollipop_EB import Planck20_Lollipop_EB