Commit 00fb5b31 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

tweaks

parent ed1b72fa
......@@ -61,20 +61,36 @@ wgt = 1/np.sum(1/wgt, axis=1)
# WEIGHT -> WEIGHT_SPECTRUM
wgt = np.repeat(wgt[:, None], len(freq), axis=1)
# FLAGGED -> WGT=0
wgt[flags] = 0
npixdirty = 4096
# flip visibilities with w<0
mask = uvw[:,2]<0
uvw[mask]*=-1
uvw[mask]*=-1
uvw[mask]*=-1
vis = np.conj(vis)*mask.reshape(-1,1) + vis*(1-mask.reshape(-1,1))
npixdirty = 756
DEG2RAD = np.pi/180
pixsize = 2.3/npixdirty*DEG2RAD
nthreads = 4
epsilon = 1e-4
epsilon = 6e-6
t0 = time()
print('Start gridding...')
dirty = ng.full_gridding(uvw, freq, vis, wgt, npixdirty, npixdirty, pixsize,
pixsize, epsilon, nthreads)
if (epsilon>5e-6):
dirty = ng.full_gridding_f(
uvw.astype("f4"), freq.astype("f4"), vis.astype("c8"),
wgt.astype("f4"), npixdirty, npixdirty, pixsize, pixsize, epsilon,
nthreads,verbosity=2)
else:
dirty = ng.full_gridding(
uvw, freq, vis, wgt, npixdirty, npixdirty, pixsize, pixsize, epsilon,
nthreads,verbosity=2)
print('Done')
t = time() - t0
print("{} s".format(t))
print("{} visibilities/nthreads/s".format(np.sum(wgt != 0)/nthreads/t))
print("{} visibilities/thread/s".format(np.sum(wgt != 0)/nthreads/t))
plt.imshow(dirty.real)
plt.show()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment