Commit 2fdb003b authored by Martin Reinecke's avatar Martin Reinecke

add submodule

parent 6a0cdd90
Pipeline #76164 passed with stages
in 13 minutes and 5 seconds
......@@ -58,6 +58,7 @@ include python/wgridder.cc
include python/alm.h
include python/totalconvolve.h
include python/totalconvolve.cc
include python/misc.cc
include python/test/test_fft.py
include python/test/test_healpix.py
......
......@@ -132,7 +132,7 @@ in <https://arxiv.org/abs/astro-ph/0008227> vie the `conviqt` code
- the code uses `ducc.sht` SHTs and `ducc.fft` FFTs to compute the data cube
- shared-memory parallelization is provided via standard C++ threads.
- for interpolation, the algorithm and kernel described in
https://arxiv.org/abs/1808.06736 are used. This allows very efficient
<https://arxiv.org/abs/1808.06736> are used. This allows very efficient
interpolation with user-adjustable accuracy.
......@@ -151,9 +151,9 @@ as the `wgridder` component.
### Numerical aspects
- uses the analytical gridding kernel presented in
https://arxiv.org/abs/1808.06736
<https://arxiv.org/abs/1808.06736>
- uses the "improved W-stacking method" described in
https://www.repository.cam.ac.uk/handle/1810/292298 (p. 139ff)
<https://www.repository.cam.ac.uk/handle/1810/292298> (p. 139ff)
- in combination these two aspects allow extremely accurate gridding/degridding
operations (L2 error compared to explicit DFTs can go below 1e-12) with
reasonable resource consumption
......@@ -18,6 +18,7 @@
#include "python/totalconvolve.cc"
#include "python/wgridder.cc"
#include "python/healpix.cc"
#include "python/misc.cc"
using namespace mr;
......@@ -28,4 +29,5 @@ PYBIND11_MODULE(PKGNAME, m)
add_totalconvolve(m);
add_wgridder(m);
add_healpix(m);
add_misc(m);
}
......@@ -36,12 +36,11 @@
#include "mr_util/infra/mav.h"
#include "mr_util/math/es_kernel.h"
namespace gridder {
namespace mr {
namespace detail {
namespace detail_gridder {
using namespace std;
using namespace mr;
template<size_t ndim> void checkShape
(const array<size_t, ndim> &shp1, const array<size_t, ndim> &shp2)
......@@ -1116,11 +1115,12 @@ template<typename T> void dirty2ms(const mav<double,2> &uvw,
dirty2x(gconf, dirty, serv, do_wstacking, verbosity);
}
} // namespace detail
} // namespace detail_gridder
// public names
using detail::ms2dirty;
using detail::dirty2ms;
} // namespace gridder
using detail_gridder::ms2dirty;
using detail_gridder::dirty2ms;
} // namespace mr
#endif
......@@ -44,7 +44,6 @@ namespace mr {
namespace detail_pymodule_healpix {
using namespace std;
using namespace mr;
namespace py = pybind11;
......
/*
* This file is part of DUCC.
*
* DUCC is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* DUCC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DUCC; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* For more information about HEALPix, see http://healpix.sourceforge.net
*/
/*
* DUCC is being developed at the Max-Planck-Institut fuer Astrophysik
*/
/*
* Copyright (C) 2020 Max-Planck-Society
* Author: Martin Reinecke
*/
#include <pybind11/pybind11.h>
#include <pybind11/numpy.h>
#include <vector>
#include "mr_util/math/constants.h"
#include "mr_util/math/gl_integrator.h"
namespace mr {
namespace detail_pymodule_misc {
using namespace std;
namespace py = pybind11;
using a_d_c = py::array_t<double, py::array::c_style | py::array::forcecast>;
a_d_c GL_weights(int64_t nlat, int64_t nlon)
{
a_d_c res(nlat);
auto rr=res.mutable_unchecked<1>();
GL_Integrator integ(nlat);
auto wgt = integ.weights();
for (size_t i=0; i<size_t(rr.shape(0)); ++i)
rr[i] = wgt[i]*twopi/nlon;
return res;
}
a_d_c GL_thetas(int64_t nlat)
{
a_d_c res(nlat);
auto rr=res.mutable_unchecked<1>();
GL_Integrator integ(nlat);
auto x = integ.coords();
for (size_t i=0; i<size_t(rr.shape(0)); ++i)
rr[i] = acos(-x[i]);
return res;
}
const char *misc_DS = R"""(
Various unsorted utilities
)""";
void add_misc(py::module &msup)
{
using namespace pybind11::literals;
auto m = msup.def_submodule("misc");
m.doc() = misc_DS;
m.def("GL_weights",&GL_weights, "nlat"_a, "nlon"_a);
m.def("GL_thetas",&GL_thetas, "nlat"_a);
}
}
using detail_pymodule_misc::add_misc;
}
......@@ -47,7 +47,6 @@ namespace mr {
namespace detail_pymodule_sht {
using namespace std;
using namespace mr;
namespace py = pybind11;
......
......@@ -12,7 +12,6 @@ namespace mr {
namespace detail_pymodule_totalconvolve {
using namespace std;
using namespace mr;
namespace py = pybind11;
......
......@@ -29,8 +29,6 @@ namespace mr {
namespace detail_pymodule_wgridder {
using namespace std;
using namespace gridder;
using namespace mr;
namespace py = pybind11;
......
......@@ -51,7 +51,6 @@ namespace detail_sharp {
#pragma GCC visibility push(hidden)
using namespace mr;
using namespace std;
using Tv=native_simd<double>;
......
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