From 3e52d27a7c80c32bc3d01b12993e37d3aa05a0e5 Mon Sep 17 00:00:00 2001 From: Martin Reinecke <martin@mpa-garching.mpg.de> Date: Tue, 27 Aug 2019 11:20:02 +0200 Subject: [PATCH] make wstacker dirty images real-only --- gridder_cxx.h | 10 +++++----- nifty_gridder.cc | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gridder_cxx.h b/gridder_cxx.h index 8ee77b3..9737f41 100644 --- a/gridder_cxx.h +++ b/gridder_cxx.h @@ -965,8 +965,8 @@ template<typename T> void get_correlations } -template<typename T> void apply_wcorr(const GridderConfig<T> &gconf, - mav<complex<T>,2> &dirty, const EC_Kernel_with_correction<T> &kernel, double dw) +template<typename T, typename T2> void apply_wcorr(const GridderConfig<T> &gconf, + mav<T2,2> &dirty, const EC_Kernel_with_correction<T> &kernel, double dw) { auto nx_dirty=gconf.Nxdirty(); auto ny_dirty=gconf.Nydirty(); @@ -1001,7 +1001,7 @@ template<typename T> void apply_wcorr(const GridderConfig<T> &gconf, template<typename T> void vis2dirty_wstack(const Baselines<T> &baselines, const GridderConfig<T> &gconf, const const_mav<uint32_t,1> &idx, - const const_mav<complex<T>,1> &vis, mav<complex<T>,2> &dirty) + const const_mav<complex<T>,1> &vis, mav<T,2> &dirty) { auto nx_dirty=gconf.Nxdirty(); auto ny_dirty=gconf.Nydirty(); @@ -1086,7 +1086,7 @@ cout << "blip3" << endl; cout << "blip4" << endl; for (size_t i=0; i<nx_dirty; ++i) for (size_t j=0; j<ny_dirty; ++j) - dirty(i,j) += tdirty(i,j); + dirty(i,j) += tdirty(i,j).real(); } } // correct for w gridding @@ -1097,7 +1097,7 @@ cout << "applying correction for gridding in w direction" << endl; template<typename T> void dirty2vis_wstack(const Baselines<T> &baselines, const GridderConfig<T> &gconf, const const_mav<uint32_t,1> &idx, - const const_mav<complex<T>,2> &dirty, mav<complex<T>,1> &vis) + const const_mav<T,2> &dirty, mav<complex<T>,1> &vis) { auto nx_dirty=gconf.Nxdirty(); auto ny_dirty=gconf.Nydirty(); diff --git a/nifty_gridder.cc b/nifty_gridder.cc index 38be25f..295dee8 100644 --- a/nifty_gridder.cc +++ b/nifty_gridder.cc @@ -681,7 +681,7 @@ template<typename T> pyarr<uint32_t> getIndices(const PyBaselines<T> &baselines, return res; } -template<typename T> pyarr<complex<T>> Pyvis2dirty_wstack(const PyBaselines<T> &baselines, +template<typename T> pyarr<T> Pyvis2dirty_wstack(const PyBaselines<T> &baselines, const PyGridderConfig<T> &gconf, const pyarr<uint32_t> &idx_, const pyarr<complex<T>> &vis_) { @@ -689,7 +689,7 @@ template<typename T> pyarr<complex<T>> Pyvis2dirty_wstack(const PyBaselines<T> & auto ny_dirty=gconf.Nydirty(); auto idx2=make_const_mav<1>(idx_); auto vis2=make_const_mav<1>(vis_); - auto dirty = makeArray<complex<T>>({nx_dirty, ny_dirty}); + auto dirty = makeArray<T>({nx_dirty, ny_dirty}); auto dirty2=make_mav<2>(dirty); { py::gil_scoped_release release; @@ -700,7 +700,7 @@ template<typename T> pyarr<complex<T>> Pyvis2dirty_wstack(const PyBaselines<T> & template<typename T> pyarr<complex<T>> Pydirty2vis_wstack(const PyBaselines<T> &baselines, const PyGridderConfig<T> &gconf, const pyarr<uint32_t> &idx_, - const pyarr<complex<T>> &dirty_) + const pyarr<T> &dirty_) { auto idx2=make_const_mav<1>(idx_); auto nvis = idx2.shape(0); -- GitLab