Commit 4e97d7e2 authored by Philipp Arras's avatar Philipp Arras
Browse files

Merge branch 'better_wscreen' into tests

parents 2a78a9ef 75c0ccbc
......@@ -594,8 +594,11 @@ template<typename T> class GridderConfig
complex<T> wscreen(double x, double y, double w, bool adjoint) const
{
constexpr double pi = 3.141592653589793238462643383279502884197;
double n = cos(sqrt(x+y)), xn = 1./n;
double phase = 2*pi*w*(n-1);
double eps = sqrt(x+y);
double s = sin(eps);
double nm1 = -s*s/(1.+cos(eps));
double n = nm1+1., xn = 1./n;
double phase = 2*pi*w*nm1;
if (adjoint) phase *= -1;
return complex<T>(cos(phase)*xn, sin(phase)*xn);
}
......
......@@ -171,10 +171,11 @@ def test_pickling():
@pmp('nx', [4, 18, 54])
@pmp('dx', [1., 0.13, 132])
@pmp('fov', [0.1, 1, 5]) # deg
@pmp('w', [0, 10, 8489])
def test_wstacking(nx, dx, w):
def test_wstacking(nx, fov, w):
np.random.seed(42)
dx = fov*np.pi/180/nx
ny, dy = nx, dx
conf = ng.GridderConfig(nx, ny, 1e-7, dx, dy)
x, y = conf.Nu(), conf.Nv()
......
Supports Markdown
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