Skip to content

Commit

Permalink
feat(senswaterfall): handle cases where weights are 0
Browse files Browse the repository at this point in the history
- invert_or_zero will either return an inversion, or a zero if the value
is a 0
    - handles divide-by-zero errors
  • Loading branch information
anjakefala committed Oct 28, 2019
1 parent f9aa361 commit d44f441
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions draco/synthesis/noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,11 @@ def process(self, data):
"""

data.redistribute("freq")

vis = data.vis[:]

# data.weight elements are inverse variances
# we want the standard deviation
vis_weight_std = np.sqrt(1.0 / np.copy(data.weight))
vis_weight_std = np.sqrt(tools.invert_no_zero(data.weight))

# create a random generator, and create a local seed state
rg = randomgen.generator.RandomGenerator()
Expand Down

0 comments on commit d44f441

Please sign in to comment.