Commit bf7017e6 authored by Martin Reinecke's avatar Martin Reinecke

expose more functions

parent a7c9bb60
......@@ -386,7 +386,7 @@ template<typename T> class GridderConfig
{
private:
size_t nx_dirty, ny_dirty;
T ucorr, vcorr;
double eps, psx, psy;
size_t w, nsafe, nu, nv;
T beta;
vector<T> cfu, cfv;
......@@ -394,8 +394,8 @@ template<typename T> class GridderConfig
public:
GridderConfig(size_t nxdirty, size_t nydirty, double epsilon,
double pixsize_x, double pixsize_y)
: nx_dirty(nxdirty), ny_dirty(nydirty),
ucorr(pixsize_x), vcorr(pixsize_y),
: nx_dirty(nxdirty), ny_dirty(nydirty), eps(epsilon),
psx(pixsize_x), psy(pixsize_y),
w(get_w(epsilon)), nsafe((w+1)/2),
nu(max(2*nsafe,2*nx_dirty)), nv(max(2*nsafe,2*ny_dirty)),
beta(2.3*w),
......@@ -421,6 +421,11 @@ template<typename T> class GridderConfig
cfv[ny_dirty/2-i] = cfv[ny_dirty/2+i] = tmp[i];
}
}
size_t Nxdirty() const { return nx_dirty; }
size_t Nydirty() const { return ny_dirty; }
double Epsilon() const { return eps; }
double Pixsize_x() const { return psx; }
double Pixsize_y() const { return psy; }
size_t Nu() const { return nu; }
size_t Nv() const { return nv; }
size_t W() const { return w; }
......@@ -522,10 +527,10 @@ template<typename T> class GridderConfig
}
inline void getpix(T u_in, T v_in, T &u, T &v, int &iu0, int &iv0) const
{
u=fmodulo(u_in*ucorr, T(1))*nu,
u=fmodulo(u_in*psx, T(1))*nu,
iu0 = int(u-w*0.5 + 1 + nu) - nu;
if (iu0+w>nu+nsafe) iu0 = nu+nsafe-w;
v=fmodulo(v_in*vcorr, T(1))*nv;
v=fmodulo(v_in*psy, T(1))*nv;
iv0 = int(v-w*0.5 + 1 + nv) - nv;
if (iv0+w>nv+nsafe) iv0 = nv+nsafe-w;
}
......@@ -1074,6 +1079,11 @@ PYBIND11_MODULE(nifty_gridder, m)
py::class_<GridderConfig<double>> (m, "GridderConfig", GridderConfig_DS)
.def(py::init<size_t, size_t, double, double, double>(),"nxdirty"_a,
"nydirty"_a, "epsilon"_a, "pixsize_x"_a, "pixsize_y"_a)
.def("Nxdirty", &GridderConfig<double>::Nxdirty)
.def("Nydirty", &GridderConfig<double>::Nydirty)
.def("Epsilon", &GridderConfig<double>::Epsilon)
.def("Pixsize_x", &GridderConfig<double>::Pixsize_x)
.def("Pixsize_y", &GridderConfig<double>::Pixsize_y)
.def("Nu", &GridderConfig<double>::Nu)
.def("Nv", &GridderConfig<double>::Nv)
.def("grid2dirty", &GridderConfig<double>::grid2dirty, grid2dirty_DS,
......
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