Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Division by zero in fields #121

Open
ntessore opened this issue Apr 12, 2024 · 0 comments
Open

Division by zero in fields #121

ntessore opened this issue Apr 12, 2024 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@ntessore
Copy link
Contributor

The mean and bias calculation in fields contains potential divisions by zero when the catalogue is empty:

# Positions

        # normalize map
        pos /= nbar

        # compute bias of number counts
        bias = ngal / (4 * np.pi) * mapper.area**2 / nbar**2

# ScalarField

        # normalise the map
        val /= wbar

        # compute bias from variance (per object)
        bias = 4 * np.pi * vbar**2 * (var / wmean**2) / ngal

# ComplexField

        # normalise the map
        val /= wbar

        # bias from measured variance, for E/B decomposition
        bias = 2 * np.pi * vbar**2 * (var / wmean**2) / ngal

# Weights

        # normalise the map
        wht /= wbar

        # bias from weights
        bias = 4 * np.pi * vbar**2 * (w2mean / wmean**2) / ngal
@ntessore ntessore added the bug Something isn't working label Apr 12, 2024
@ucapbba ucapbba self-assigned this May 22, 2024
@ntessore ntessore added this to the v24.2 milestone Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants