Skip to content

Commit

Permalink
fix(GaussianNoiseDataset): explicitly operate on local_array
Browse files Browse the repository at this point in the history
  • Loading branch information
sjforeman committed Aug 16, 2024
1 parent f3c2650 commit bae3d8c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions draco/synthesis/noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,17 @@ def process(self, data):
data.redistribute("freq")

# Replace visibilities with noise
dset = data[dataset_name][:]
dset = data[dataset_name][:].local_array
weight = data.weight[:].local_array
if np.iscomplexobj(dset):
random.complex_normal(
scale=tools.invert_no_zero(data.weight[:]) ** 0.5,
scale=tools.invert_no_zero(weight) ** 0.5,
out=dset,
rng=self.rng,
)
else:
self.rng.standard_normal(out=dset)
dset *= tools.invert_no_zero(data.weight[:]) ** 0.5
dset *= tools.invert_no_zero(weight) ** 0.5

# We need to loop to ensure the autos are real and have the correct variance
if dataset_name == "vis":
Expand Down

0 comments on commit bae3d8c

Please sign in to comment.