Skip to content

Commit

Permalink
final change to ws
Browse files Browse the repository at this point in the history
  • Loading branch information
JaimeRZP committed Nov 27, 2024
1 parent 63d34f6 commit 75512fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions heracles/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,9 @@ async def __call__(
wht /= wbar

# bias from weights
musq = w2mean / wmean**2 # 1.0
dens = ngal / (4 * np.pi * fsky)
musq = 1.0
deff = w2mean / wmean**2
dens = ngal / (4 * np.pi * fsky) / deff
bias = fsky * musq / dens

# set metadata of array
Expand Down
7 changes: 4 additions & 3 deletions tests/test_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,8 @@ def test_weights(mapper, catalog):
v1 = w.sum()
wmean = v1 / (4.0 * npix)
w2mean = v2 / (4.0 * npix)
musq = w2mean / wmean**2
deff = w2mean / wmean**2
dens = npix / np.pi / deff

assert m.shape == (12 * mapper.nside**2,)
assert m.dtype.metadata == {
Expand All @@ -402,8 +403,8 @@ def test_weights(mapper, catalog):
"nside": mapper.nside,
"lmax": mapper.lmax,
"deconv": mapper.deconvolve,
"musq": pytest.approx(musq),
"dens": pytest.approx(npix / np.pi),
"musq": 1.0,
"dens": pytest.approx(dens),
"fsky": 1.0,
"bias": pytest.approx(bias / wbar**2),
}
Expand Down

0 comments on commit 75512fb

Please sign in to comment.