PURIFY
Next-generation radio interferometric imaging
kernels.h
Go to the documentation of this file.
1 #ifndef PURIFY_KERNELS_H
2 #define PURIFY_KERNELS_H
3 
4 #include "purify/config.h"
5 #include "purify/types.h"
6 #include <array>
7 #include <map>
8 #include <tuple>
9 #include <boost/math/special_functions/bessel.hpp>
10 #include <boost/math/special_functions/sinc.hpp>
11 
12 namespace purify {
13 
14 namespace kernels {
16 const std::map<std::string, kernel> kernel_from_string = {{"kb", kernel::kb},
17  {"gauss", kernel::gauss},
18  {"box", kernel::box},
19  {"pswf", kernel::pswf},
20  {"kbmin", kernel::kbmin},
21  {"kb_presample", kernel::kb_presample},
22  {"gauss_alt", kernel::gauss_alt}};
23 
25 t_real kaiser_bessel(const t_real x, const t_real J);
27 t_real kaiser_bessel_general(const t_real x, const t_real J, const t_real alpha);
29 t_real ft_kaiser_bessel_general(const t_real x, const t_real J, const t_real alpha);
31 t_real ft_kaiser_bessel(const t_real x, const t_real J);
33 t_real gaussian(const t_real x, const t_real J);
35 t_real ft_gaussian(const t_real x, const t_real J);
44 t_real calc_for_pswf(const t_real x, const t_real J, const t_real alpha);
46 t_real pswf(const t_real x, const t_real J);
48 t_real ft_pswf(const t_real x, const t_real J);
50 std::vector<t_real> kernel_samples(const t_int total_samples,
51  const std::function<t_real(t_real)> kernelu);
53 t_real kernel_zero_interp(const std::vector<t_real> &samples, const t_real x, const t_real J);
55 t_real kernel_linear_interp(const Vector<t_real> &samples, const t_real x, const t_real J);
57 t_real pill_box(const t_real x, const t_real J);
59 t_real ft_pill_box(const t_real x, const t_real J);
61 t_real gaussian_general(const t_real x, const t_real J, const t_real sigma);
63 t_real ft_gaussian_general(const t_real x, const t_real J, const t_real sigma);
64 } // namespace kernels
65 std::tuple<std::function<t_real(t_real)>, std::function<t_real(t_real)>,
66  std::function<t_real(t_real)>, std::function<t_real(t_real)>>
67 create_kernels(const kernels::kernel kernel_name, const t_uint Ju_, const t_uint Jv_,
68  const t_real ftsizeu_, const t_real ftsizev_, const t_real oversample_ratio);
69 std::tuple<std::function<t_real(t_real)>, std::function<t_real(t_real)>> create_radial_ftkernel(
70  const kernels::kernel kernel_name_, const t_uint Ju_, const t_real oversample_ratio);
71 } // namespace purify
72 
73 #endif
const std::map< std::string, kernel > kernel_from_string
Definition: kernels.h:16
t_real ft_kaiser_bessel(const t_real x, const t_real J)
Fourier transform of kaiser bessel kernel.
Definition: kernels.cc:40
t_real ft_gaussian_general(const t_real x, const t_real J, const t_real sigma)
Fourier transform of general Gaussian kernel.
Definition: kernels.cc:233
std::vector< t_real > kernel_samples(const t_int total_samples, const std::function< t_real(t_real)> kernelu)
Calculates samples of a kernel.
Definition: kernels.cc:144
t_real kaiser_bessel(const t_real x, const t_real J)
Kaiser-Bessel kernel.
Definition: kernels.cc:7
t_real kernel_zero_interp(const std::vector< t_real > &samples, const t_real x, const t_real J)
zeroth order interpolates from samples of kernel
Definition: kernels.cc:156
t_real pill_box(const t_real x, const t_real J)
Box car function for kernel.
Definition: kernels.cc:202
t_real ft_pswf(const t_real x, const t_real J)
Fourier transform of PSWF kernel.
Definition: kernels.cc:124
t_real gaussian_general(const t_real x, const t_real J, const t_real sigma)
Fourier transform of general Gaussian kernel.
Definition: kernels.cc:220
t_real kaiser_bessel_general(const t_real x, const t_real J, const t_real alpha)
More general Kaiser-Bessel kernel.
Definition: kernels.cc:15
t_real calc_for_pswf(const t_real eta0, const t_real J, const t_real alpha)
Calculates Horner's Rule the standard PSWF for radio astronomy, with a support of J = 6 and alpha = 1...
Definition: kernels.cc:71
t_real ft_pill_box(const t_real x, const t_real J)
Fourier transform of box car function, a Sinc function.
Definition: kernels.cc:211
t_real gaussian(const t_real x, const t_real J)
Gaussian kernel.
Definition: kernels.cc:49
t_real kernel_linear_interp(const Vector< t_real > &samples, const t_real x, const t_real J)
linearly interpolates from samples of kernel
Definition: kernels.cc:171
t_real pswf(const t_real x, const t_real J)
PSWF kernel.
Definition: kernels.cc:107
t_real ft_gaussian(const t_real x, const t_real J)
Fourier transform of Gaussian kernel.
Definition: kernels.cc:60
t_real ft_kaiser_bessel_general(const t_real x, const t_real J, const t_real alpha)
Fourier transform of more general Kaiser-Bessel kernel.
Definition: kernels.cc:25
std::tuple< std::function< t_real(t_real)>, std::function< t_real(t_real)> > create_radial_ftkernel(const kernels::kernel kernel_name_, const t_uint Ju_, const t_real oversample_ratio)
Definition: kernels.cc:347
std::tuple< std::function< t_real(t_real)>, std::function< t_real(t_real)>, std::function< t_real(t_real)>, std::function< t_real(t_real)> > create_kernels(const kernels::kernel kernel_name_, const t_uint Ju_, const t_uint Jv_, const t_real imsizey_, const t_real imsizex_, const t_real oversample_ratio)
Definition: kernels.cc:249