Scheduled maintenance on Monday 2019-06-24 between 10:00-11:00 CEST

Commit d4c14850 authored by Martin Reinecke's avatar Martin Reinecke

sync with gridder changes

parent 8288276d
Pipeline #48789 passed with stages
in 17 minutes and 25 seconds
......@@ -27,6 +27,7 @@ from ..sugar import from_global_data, makeDomain
class GridderMaker(object):
def __init__(self, domain, eps=1e-15):
from nifty_gridder import get_w
domain = makeDomain(domain)
if (len(domain) != 1 or not isinstance(domain[0], RGSpace) or
not len(domain.shape) == 2):
......@@ -35,7 +36,7 @@ class GridderMaker(object):
if nu % 2 != 0 or nv % 2 != 0:
raise ValueError("dimensions must be even")
nu2, nv2 = 2*nu, 2*nv
w = int(-np.log10(eps)+1.9999)
w = get_w(eps)
nsafe = (w+1)//2
nu2 = max([nu2, 2*nsafe])
nv2 = max([nv2, 2*nsafe])
......@@ -111,15 +112,11 @@ class RadioGridder(LinearOperator):
self._uv = uv # FIXME: should we write-protect this?
def apply(self, x, mode):
from nifty_gridder import (to_grid, to_grid_post,
from_grid, from_grid_pre)
from nifty_gridder import to_grid, from_grid
self._check_input(x, mode)
nu2, nv2 = self._target.shape
x = x.to_global_data()
if mode == self.TIMES:
res = to_grid(self._uv, x, nu2, nv2, self._eps)
res = to_grid_post(res)
nu2, nv2 = self._target.shape
res = to_grid(self._uv, x.to_global_data(), nu2, nv2, self._eps)
else:
x = from_grid_pre(x)
res = from_grid(self._uv, x, nu2, nv2, self._eps)
res = from_grid(self._uv, x.to_global_data(), self._eps)
return from_global_data(self._tgt(mode), res)
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