Commit 9df6b03c authored by Martin Reinecke's avatar Martin Reinecke

merge

parents 63791924 f22c1e84
Pipeline #50116 failed with stages
in 4 minutes and 58 seconds
......@@ -24,7 +24,7 @@ import numpy as np
class GridderMaker(object):
def __init__(self, dirty_domain, uvw, channel_fact, eps=2e-13):
def __init__(self, dirty_domain, uvw, channel_fact, flags, eps=2e-13):
import nifty_gridder
dirty_domain = makeDomain(dirty_domain)
if (len(dirty_domain) != 1 or not isinstance(dirty_domain[0], RGSpace)
......@@ -32,19 +32,18 @@ class GridderMaker(object):
raise ValueError("need dirty_domain with exactly one 2D RGSpace")
if channel_fact.ndim != 1:
raise ValueError("channel_fact must be a 1D array")
bl = nifty_gridder.Baselines(
uvw, channel_fact,
np.zeros((uvw.shape[0], channel_fact.shape[0]), dtype=np.bool))
bl = nifty_gridder.Baselines(uvw, channel_fact, flags)
nxdirty, nydirty = dirty_domain.shape
gconf = nifty_gridder.GridderConfig(nxdirty, nydirty, eps, 1., 1.)
nu = gconf.Nu()
nv = gconf.Nv()
idx = nifty_gridder.getIndices(bl, gconf)
self._idx = nifty_gridder.getIndices(bl, gconf)
self._bl = bl
grid_domain = RGSpace([nu, nv], distances=[1, 1], harmonic=False)
self._rest = _RestOperator(dirty_domain, grid_domain, gconf)
self._gridder = RadioGridder(grid_domain, bl, gconf, idx)
self._gridder = RadioGridder(grid_domain, bl, gconf, self._idx)
def getGridder(self):
return self._gridder
......@@ -55,6 +54,9 @@ class GridderMaker(object):
def getFull(self):
return self.getRest() @ self._gridder
def ms2vis(self, x):
return self._bl.ms2vis(x, self._idx)
class _RestOperator(LinearOperator):
def __init__(self, dirty_domain, grid_domain, gconf):
......
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