Skip to content

Commit

Permalink
return sum over grid axis in _compute_counts
Browse files Browse the repository at this point in the history
  • Loading branch information
landmanbester committed Jul 15, 2024
1 parent dae6886 commit cc12cf1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pfb/utils/weighting.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
def compute_counts(dsl,
nx, ny,
cell_size_x, cell_size_y,
tbid=0,
k=6,
nthreads=1):
'''
Expand Down Expand Up @@ -53,10 +54,10 @@ def compute_counts(dsl,
futures.append(fut)

for fut in cf.as_completed(futures):
# sum over number of grids and number of datasets
# sum over number of datasets
counts += fut.result().sum(axis=0)

return counts
return counts, tbid



Expand Down Expand Up @@ -127,7 +128,7 @@ def _compute_counts(uvw, freq, mask, wgt, nx, ny,
u_idx = int(np.floor(ug))
v_idx = int(np.floor(vg))
counts[g, u_idx, v_idx] += 1.0
return counts
return counts.sum(axis=0)


@njit(nogil=True, cache=True, inline='always')
Expand Down
2 changes: 2 additions & 0 deletions pfb/workers/fluxmop.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ def _fluxmop(ddsi=None, **kw):
residual[b] = r
n_launched += 1

print("\n") # after progressbar above

residual_mfs = np.sum(residual/wsum, axis=0)
rms = np.std(residual_mfs)
rmax = np.abs(residual_mfs).max()
Expand Down
1 change: 1 addition & 0 deletions pfb/workers/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ def _grid(xdsi=None, **kw):
ds_dct['dsl'],
nx, ny,
cell_rad, cell_rad,
tbid=tbid,
nthreads=opts.nthreads,
workers=wname)

Expand Down

0 comments on commit cc12cf1

Please sign in to comment.