2 #include "purify/config.h"
5 #include "purify/directories.h"
12 #include "purify/directories.h"
21 int main(
int nargs,
char const **args) {
22 auto const output_name = (nargs > 2) ?
static_cast<std::string
>(args[1]) :
"kernel";
23 #define ARGS_MACRO(NAME, ARGN, VALUE, TYPE) \
25 static_cast<TYPE>((nargs > ARGN) ? std::stod(static_cast<std::string>(args[ARGN])) : VALUE);
37 const t_real oversample_ratio = 2;
44 const t_uint max_evaluations = 1e8;
45 const t_real relative_error = 0;
50 0, 0, 0, du, du, oversample_ratio, normu, normu, 1e9, 0, 1e-8,
53 0, 0, 0, du, oversample_ratio, normu, 1e9, 0, 1e-7,
integration::method::h, e));
54 auto const ftkernelu = [=](
const t_real l) -> t_real {
61 t_real
const upsample = 5;
62 t_int
const Ju_max = std::floor(Ju * upsample);
65 Vector<t_complex>
kernel = Vector<t_complex>::Zero(Ju_max * Jw_max);
66 Vector<t_real> evals = Vector<t_real>::Zero(Ju_max * Jw_max);
67 Vector<t_real> support = Vector<t_real>::Zero(Jw_max);
72 #pragma omp parallel for collapse(2)
73 for (
int i = 0; i < Jw_max; i++) {
74 for (
int j = 0; j < Ju_max; j++) {
75 t_uint evaluations = 0;
76 t_uint revaluations = 0;
81 j / upsample, 0, w * i / Jw_max, du, du, oversample_ratio, ftkernelu, ftkernelv,
84 j / upsample, 0, w * i / Jw_max, du, oversample_ratio, ftkernelu,
86 evals(j * Jw_max + i) = evaluations;
87 #pragma omp critical(print)
94 throw std::runtime_error(
"Kernel value is a nan.");
#define PURIFY_LOW_LOG(...)
Low priority message.
t_real ft_kaiser_bessel(const t_real x, const t_real J)
Fourier transform of kaiser bessel kernel.
void set_level(const std::string &level)
Method to set the logging level of the default Log object.
void write2d(const Image< t_real > &eigen_image, const pfitsio::header_params &header, const bool &overwrite)
Write image to fits file.
t_complex exact_w_projection_integration_1d(const t_real u, const t_real v, const t_real w, const t_real du, const t_real oversample_ratio, const std::function< t_complex(t_real)> &ftkerneluv, const t_uint &max_evaluations, const t_real &absolute_error, const t_real &relative_error, const integration::method method, t_uint &evaluations)
t_complex exact_w_projection_integration(const t_real u, const t_real v, const t_real w, const t_real du, const t_real dv, const t_real oversample_ratio, const std::function< t_complex(t_real)> &ftkernelu, const std::function< t_complex(t_real)> &ftkernelv, const t_uint &max_evaluations, const t_real &absolute_error, const t_real &relative_error, const integration::method method, t_uint &evaluations)
numerical integration of chirp and kernel in image domain
t_real pixel_to_lambda(const t_real cell, const t_uint imsize, const t_real oversample_ratio)
return factors to convert between arcsecond pixel size image space and lambda for uv space
#define ARGS_MACRO(NAME, ARGN, VALUE, TYPE)
int main(int nargs, char const **args)