Skip to content
Snippets Groups Projects
Commit 52f8ea9e authored by Landman Bester's avatar Landman Bester
Browse files

Reproduce apply_taper error

parent ee492217
No related branches found
No related tags found
No related merge requests found
import nifty_gridder as ng
import numpy as np
def _init_gridder(nxdirty, nydirty, epsilon, nchan, nrow):
pixsize = np.pi/180/60/nxdirty
conf = ng.GridderConfig(nxdirty=nxdirty,
nydirty=nydirty,
epsilon=epsilon,
pixsize_x=0.368*pixsize,
pixsize_y=pixsize)
speedoflight, f0 = 299792458., 1e9
freq = f0 + np.arange(nchan)*(f0/nchan)
uvw = (np.random.rand(nrow, 3)-0.5)/(pixsize*f0/speedoflight)
baselines = ng.Baselines(coord=uvw, freq=freq)
flags = np.zeros((nrow, nchan), dtype=np.bool)
idx = ng.getIndices(baselines, conf, flags)
return baselines, conf, idx
nx, ny, eps, nchan, nrow = 256, 256, 1e-7, 1, 10000
bl, conf, idx = _init_gridder(nxdirty=nx, nydirty=ny, epsilon=eps, nchan=nchan, nrow=nrow)
# test apply_taper on image of all ones
img = np.ones((nx, ny), dtype=np.float64)
print(img.dtype)
test = conf.apply_taper(img, divide=True)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment