Skip to content

Commit

Permalink
Update bias marg for lens nbins.
Browse files Browse the repository at this point in the history
  • Loading branch information
aferte committed Oct 13, 2023
1 parent b166075 commit 894da1c
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions modules_desy6/bias_marg.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
BIAS_MODELS = ["linear", "oneloop_eul_bk"]

def setup(options):
number_lens_bins = options.get_int(option_section,
"nbins",6)
#Get the name of the bias section
#By default look for 'bias_lens' which is
#what will be used for Y3
bias_section = options.get_string(option_section,
bias_section = options.get_string(option_section,
"bias_section", "bias_lens")
#Get the name of the bias model
#By default look for 'oneloop_eul_bk' which is
Expand All @@ -20,19 +22,19 @@ def setup(options):
except AssertionError:
print("bias model should be in: "%BIAS_MODELS)
raise(e)
return bias_section, bias_model
return number_lens_bins, bias_section, bias_model

def execute(block, config):

bias_section, bias_model = config
number_lens_bins, bias_section, bias_model = config

#Read in sigma_8
sigma_8 = block[names.cosmological_parameters, "sigma_8"]

nbins = 0
#nbins = 0
#loop through bins, reading in b1_i * sigma_8 values,
#where b1_i is the linear bias for bin i
for i in range(1,9999):
for i in range(1,number_lens_bins+1):
if bias_model == "linear":
b1_label = "b%d"%i
b1_sig8_label = "b%d_sig8"%i
Expand All @@ -45,12 +47,12 @@ def execute(block, config):
b1_i_sig8 = block[bias_section, b1_sig8_label]
b1_i = b1_i_sig8 / sigma_8
block[bias_section, b1_label] = b1_i
nbins += 1
if nbins == 0:
raise ValueError("we found zero bins, this seems wrong so let's raise an error")
#nbins += 1
# if nbins == 0:
# raise ValueError("we found zero bins, this seems wrong so let's raise an error")

if bias_model != "linear":
for i in range(1,nbins+1):
for i in range(1,number_lens_bins+1):
b2_label = "b2E_bin%d"%i
b2_sig8sq_label = "b2E_sig8sq_bin%d"%i
b2_sig8sq_i = block[bias_section, b2_sig8sq_label]
Expand Down

0 comments on commit 894da1c

Please sign in to comment.