Commit 380afd2c authored by Martin Reinecke's avatar Martin Reinecke
Browse files

add get_taper() function

parent e2093551
......@@ -310,6 +310,31 @@ vector<double> correction_factors (size_t n, size_t nval, size_t w)
return res;
constexpr auto get_taper_DS = R"""(
Returns the correction coefficients.
ndirty : integer
the number of pixels on the dirty image in the desired direction
epsilon : np.float64
the gridder epsilon
np.array((ndirty,), dtype=np.float64)
the correction factors.
pyarr_c<double> get_taper(size_t ndirty, double epsilon)
auto tmp = correction_factors(2*ndirty, ndirty, get_w(epsilon));
auto res = makeArray<double>({ndirty});
auto vres = res.mutable_data();
for (size_t i=0; i<ndirty; ++i)
vres[i] = tmp[i];
return res;
template<typename T> struct UVW
T u, v, w;
......@@ -1412,4 +1437,5 @@ PYBIND11_MODULE(nifty_gridder, m)
"idx"_a, "grid"_a, "wgt"_a, "ms_in"_a=None);
m.def("apply_holo",&apply_holo<double>, "baselines"_a, "gconf"_a, "idx"_a,
m.def("get_taper",&get_taper, get_taper_DS, "n"_a, "epsilon"_a);
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