Commit e8e35562 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

more tweaks

parent e81b20be
...@@ -530,7 +530,7 @@ class GridderConfig ...@@ -530,7 +530,7 @@ class GridderConfig
double beta; double beta;
vector<double> cfu, cfv; vector<double> cfu, cfv;
size_t nthreads; size_t nthreads;
// double ushift, vshift; double ushift, vshift;
int maxiu0, maxiv0; int maxiu0, maxiv0;
complex<double> wscreen(double x, double y, double w, bool adjoint) const complex<double> wscreen(double x, double y, double w, bool adjoint) const
...@@ -554,7 +554,7 @@ class GridderConfig ...@@ -554,7 +554,7 @@ class GridderConfig
nu(max(2*nsafe,2*nx_dirty)), nv(max(2*nsafe,2*ny_dirty)), nu(max(2*nsafe,2*nx_dirty)), nv(max(2*nsafe,2*ny_dirty)),
beta(2.3*supp), beta(2.3*supp),
cfu(nx_dirty), cfv(ny_dirty), nthreads(nthreads_), cfu(nx_dirty), cfv(ny_dirty), nthreads(nthreads_),
// ushift(-supp*0.5+1), vshift(-supp*0.5+1), ushift(supp*(-0.5)+1+nu), vshift(supp*(-0.5)+1+nv),
maxiu0((nu+nsafe)-supp), maxiv0((nv+nsafe)-supp) maxiu0((nu+nsafe)-supp), maxiv0((nv+nsafe)-supp)
{ {
myassert((nx_dirty&1)==0, "nx_dirty must be even"); myassert((nx_dirty&1)==0, "nx_dirty must be even");
...@@ -673,12 +673,10 @@ class GridderConfig ...@@ -673,12 +673,10 @@ class GridderConfig
void getpix(double u_in, double v_in, double &u, double &v, int &iu0, int &iv0) const void getpix(double u_in, double v_in, double &u, double &v, int &iu0, int &iv0) const
{ {
u=fmod1(u_in*psx)*nu, u=fmod1(u_in*psx)*nu;
iu0 = int(u-supp*0.5 + 1 + nu) - nu; iu0 = min(int(u+ushift)-int(nu), maxiu0);
iu0 = min(iu0, maxiu0);
v=fmod1(v_in*psy)*nv; v=fmod1(v_in*psy)*nv;
iv0 = int(v-supp*0.5 + 1 + nv) - nv; iv0 = min(int(v+vshift)-int(nv), maxiv0);
iv0 = min(iv0, maxiv0);
} }
template<typename T> void apply_wscreen(const const_mav<complex<T>,2> &dirty, template<typename T> void apply_wscreen(const const_mav<complex<T>,2> &dirty,
......
...@@ -587,9 +587,9 @@ template<typename T> pyarr<complex<T>> Pygrid2vis_c( ...@@ -587,9 +587,9 @@ template<typename T> pyarr<complex<T>> Pygrid2vis_c(
auto wgt2 = make_const_mav<1>(wgt); auto wgt2 = make_const_mav<1>(wgt);
auto res = makeArray<complex<T>>({nvis}); auto res = makeArray<complex<T>>({nvis});
auto vis = make_mav<1>(res); auto vis = make_mav<1>(res);
vis.fill(0);
{ {
py::gil_scoped_release release; py::gil_scoped_release release;
vis.fill(0);
grid2vis_c<T>(baselines, gconf, idx2, grid2, vis, wgt2); grid2vis_c<T>(baselines, gconf, idx2, grid2, vis, wgt2);
} }
return res; return res;
......
...@@ -102,7 +102,7 @@ def test_adjointness_ms2dirty(nxdirty, nydirty, nrow, nchan, epsilon, singleprec ...@@ -102,7 +102,7 @@ def test_adjointness_ms2dirty(nxdirty, nydirty, nrow, nchan, epsilon, singleprec
if wgt is not None: if wgt is not None:
wgt = wgt.astype("f4") wgt = wgt.astype("f4")
dirty2 = ng.ms2dirty(uvw, freq, ms, wgt, nxdirty, nydirty, pixsizex, dirty2 = ng.ms2dirty(uvw, freq, ms, wgt, nxdirty, nydirty, pixsizex,
pixsizey, epsilon, wstacking, nthreads, 2).astype("f8") pixsizey, epsilon, wstacking, nthreads, 0).astype("f8")
ms2 = ng.dirty2ms(uvw, freq, dirty, wgt, pixsizex, pixsizey, epsilon, ms2 = ng.dirty2ms(uvw, freq, dirty, wgt, pixsizex, pixsizey, epsilon,
wstacking, nthreads, 0).astype("c16") wstacking, nthreads, 0).astype("c16")
tol = 5e-5 if singleprec else 5e-13 tol = 5e-5 if singleprec else 5e-13
......
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