-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/joezuntz/cosmosis-standard-…
- Loading branch information
Showing
6 changed files
with
167 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[cosmological_parameters] | ||
n_s = gaussian 0.96 0.02 | ||
ombh2 = gaussian 0.0222 0.0005 | ||
|
||
|
||
[planck] | ||
a_planck = gaussian 1.0 0.0025 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
[planck] | ||
a_planck = 0.9 1.0 1.1 ; Total Planck calibration (relative to 1) at map level, scales all channels | ||
|
||
|
||
[cosmological_parameters] | ||
cosmomc_theta = 0.9 1.040909 1.2 ; this is actually 100 * theta_mc | ||
;h0 = 0.4 0.7 1.0 | ||
omch2 = 0.05 0.12 0.2 | ||
log1e10As = 2.9 3.0448 3.1 ; structure amplitude parameter | ||
|
||
ombh2 = 0.020 0.0222 0.025 | ||
n_s = 0.9 0.96 1.02 | ||
|
||
|
||
omega_k = 0.0 ;spatial curvature | ||
|
||
;reionization | ||
tau = 0.055 ;reionization optical depth | ||
|
||
|
||
;neutrinos | ||
mnu = 0.06 | ||
nnu = 3.046 | ||
num_massive_neutrinos = 1 | ||
|
||
;helium | ||
yhe = 0.245341 ;helium mass fraction | ||
|
||
|
||
k_s = 0.05 ;Power spectrum pivot scale | ||
n_run = 0.0 ;running of scalar spectrum | ||
r_t = 0.0 ;tensor to scalar ratio | ||
n_t = 0.0 ;tensor spectral index | ||
|
||
;dark energy equation of state | ||
w = -1.0 ;equation of state of dark energy | ||
wa = 0.0 ;equation of state of dark energy (redshift dependency) | ||
|
||
|
||
[halo_model_parameters] | ||
A = 3.13 | ||
eta = 0.603 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
[runtime] | ||
sampler = test | ||
root = ${PWD} | ||
verbosity = standard | ||
|
||
[nautilus] | ||
n_live = 1000 | ||
verbose = T | ||
|
||
|
||
|
||
[test] | ||
save_dir=output/npipe | ||
fatal_errors=T | ||
|
||
|
||
[output] | ||
filename = output/npipe.txt | ||
|
||
[DEFAULT] | ||
; This value is used below as %(planck_path)s | ||
planck_path = likelihood/planck2018/baseline/plc_3.0 | ||
|
||
|
||
[pipeline] | ||
; these names refer to sections later in the file: | ||
modules = consistency camb planck_npipe | ||
values = examples/npipe-values.ini | ||
priors = examples/npipe-priors.ini | ||
debug=T | ||
timing=F | ||
extra_output = cosmological_parameters/sigma_8 cosmological_parameters/omega_m cosmological_parameters/h0 | ||
|
||
[planck_npipe] | ||
;Planck 2018 high ell TT,TE and EE + low ell TT + low ell EE (in Planck notations = TT+lowE) | ||
;without CMB lensing | ||
file = likelihood/planck-npipe/npipe_interface.py | ||
use_marginalized = T | ||
|
||
; The consistency module translates between our chosen parameterization | ||
; and any other that modules in the pipeline may want (e.g. camb) | ||
[consistency] | ||
file = ./utility/consistency/consistency_interface.py | ||
cosmomc_theta = T | ||
|
||
|
||
[camb] | ||
file = boltzmann/camb/camb_interface.py | ||
mode = cmb | ||
lmax = 2800 ;max ell to use for cmb calculation | ||
feedback=0 ;amount of output to print | ||
AccuracyBoost=1.1 ;CAMB accuracy boost parameter | ||
do_tensors = True ;include tensor modes | ||
do_lensing = true ;lensing is required w/ Planck data | ||
NonLinear = lens | ||
accurate_massive_neutrino_transfers = T | ||
theta_H0_range = "40 100" | ||
halofit_version = mead | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
from cosmosis.datablock import option_section | ||
try: | ||
from planckpr4lensing import PlanckPR4LensingMarged, PlanckPR4Lensing | ||
except ImportError: | ||
raise ImportError("Please install the planckpr4lensing with: pip install git+https://github.com/carronj/planck_PR4_lensing") | ||
import numpy as np | ||
|
||
|
||
|
||
def setup(options): | ||
marged = options.get_bool(option_section, "use_marginalized", default=True) | ||
if marged: | ||
calculator = PlanckPR4LensingMarged() | ||
print("Using primary CMB-marginalized PR4 likelihood. TT, EE, TE, BB, will not be used") | ||
else: | ||
calculator = PlanckPR4Lensing() | ||
print("NOT using primary CMB-marginalized PR4 likelihood. TT, EE, TE, BB, will be used") | ||
return calculator, marged | ||
|
||
|
||
|
||
def execute(block, config): | ||
calculator, marged = config | ||
ell = block['cmb_cl', 'ell'] | ||
A = block['planck', 'a_planck'] | ||
|
||
# Convert from D_ell to the PP pre-factor, ell**2 (ell+1)**2 / 2pi | ||
pp = block['cmb_cl', 'pp'] * ell * (ell + 1.) | ||
cl = {"pp":pp} | ||
|
||
# If we are not using the marginalized version, we need to provide the full set of Cls | ||
# If we are using the marginalized version these are pre-marginalized over | ||
if not marged: | ||
cl["tt"] = block['cmb_cl', 'tt'] | ||
cl["te"] = block['cmb_cl', 'te'] | ||
cl["ee"] = block['cmb_cl', 'ee'] | ||
cl["bb"] = block['cmb_cl', 'bb'] | ||
|
||
|
||
# npipe wants to start at zero | ||
if ell[0] == 2: | ||
ell = np.concatenate([[0, 1], ell]) | ||
for key in cl: | ||
cl[key] = np.concatenate([[0.0, 0.0], cl[key]]) | ||
|
||
block["likelihoods", "npipe_like"] = calculator.log_likelihood(cl, A_planck=A) | ||
|
||
|
||
return 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters