Skip to content

Commit

Permalink
autofind number of bins
Browse files Browse the repository at this point in the history
  • Loading branch information
jessmuir committed Jan 8, 2024
2 parents b1c8068 + f6f61d0 commit db35988
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions modules_desy6/add_xlens_2pt.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,27 @@ def setup(options):
# Get the name of the xlens section
x_section = options.get_string(option_section,"xlens", "xlens")

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

return x_section, galaxy_shear_section


def execute(block, config):

x_section = config
x_section, galaxy_shear_section = config

xlens_val = block[x_section, 'xlens_all']

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

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_section,ggl_bin_label]
ggl_xlens = xlens_val*ggl
block[galaxy_shear_section, ggl_bin_label] = ggl_xlens
ggl_bin_label = 'bin_'+str(i)+'_'+str(j)
ggl = block[galaxy_shear_section,ggl_bin_label]
ggl_xlens = xlens_val*ggl
block[galaxy_shear_section, ggl_bin_label] = ggl_xlens

return 0

Expand Down

0 comments on commit db35988

Please sign in to comment.