Skip to content

Commit

Permalink
Merge pull request #91 from joezuntz/s8_sample
Browse files Browse the repository at this point in the history
Allow sampling in S_8
  • Loading branch information
joezuntz authored Aug 11, 2023
2 parents 7e65feb + 0c92ee8 commit c3c6bc2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ jobs:
run: |
source cosmosis-configure
cosmosis examples/des-y3-shear.ini | tee output/des-y3-shear.log
grep -e 'Likelihood = 2957.03' -e 'Likelihood = 2957.12' output/des-y3-shear.log
grep -e 'Likelihood = 2957.03' -e 'Likelihood = 2957.12' -e 'Likelihood = 2957.11' output/des-y3-shear.log
- name: DES Y3 likelihood with Mira Titan
Expand Down
6 changes: 5 additions & 1 deletion examples/des-y3-shear-values.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ omega_m = 0.1 0.3 0.9
h0 = 0.55 0.69 0.91
omega_b = 0.03 0.048 0.07
n_s = 0.87 0.97 1.07
A_s = 0.5e-09 2.19e-9 5.0e-09
w = -1.0

; This is here to test S_8 sampling, not to recommend it.
; Don't just put a flat prior on whatever the most convenient
; parameter is.
S_8 = 0.7 0.8256338136297622 0.84

; Old parameter names from original cosmosis version
; omnuh2 = 0.0006 0.00083 0.00644
; massive_nu = 3
Expand Down
12 changes: 12 additions & 0 deletions utility/consistency/consistency_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,16 @@ def execute(block, config):
section = cosmo
block[section, param] = value

if block.has_value(cosmo, "S_8") and block.has_value(cosmo, "omega_m"):
sigma_8 = block[cosmo, "S_8"] / (block[cosmo, "omega_m"] / 0.3)**0.5

if block.has_value(cosmo, "sigma_8"):
sigma8_check = block[cosmo, 'sigma_8']
if not np.isclose(sigma_8, sigma8_check):
raise ValueError("Inconsistent values of sigma_8 and S_8.")
elif cons.verbose:
print(f"Calculated sigma_8 = {sigma_8} from S_8/(Omega_m/0.3)**0.5")

block[cosmo, "sigma_8"] = sigma_8

return 0

0 comments on commit c3c6bc2

Please sign in to comment.