Skip to content

Commit

Permalink
jm edits fixing ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
jessmuir committed Jan 8, 2024
1 parent d426b80 commit b1c8068
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions modules_desy6/add_xlens_2pt.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,28 @@ def execute(block, config):

xlens_val = block[x_section, 'xlens_all']

galaxy_shear_section = options.get_string(option_section, "galaxy_shear_secton", default="galaxy_shear_xi")

for i in range(1,6):
for j in range(1,4):
n_a, n_b = get_nbins(block, galaxy_shear_section)
# I default setup, a is lens, b is source, but this could change
# sample_a and sample_b values will contain this info in the block

for i in range(1,n_a+1):
for j in range(1,n_b+1):
if j >= i:
ggl_bin_label = 'bin_'+str(i)+'_'+str(j)
ggl = block['galaxy_shear_xi',ggl_bin_label]
ggl = block[galaxy_shear_section,ggl_bin_label]
ggl_xlens = xlens_val*ggl
block['galaxy_shear_xi', ggl_bin_label] = ggl_xlens
block[galaxy_shear_section, ggl_bin_label] = ggl_xlens

return 0


def get_nbins(block, section):
if block.has_value(section, "nbin_a"):
n_a = block[section, "nbin_a"]
n_b = block[section, "nbin_b"]
else:
n_a = block[section, "nbin"]
n_b = n_a
return n_a, n_b

0 comments on commit b1c8068

Please sign in to comment.