1 #ifndef PURIFY_WIDE_FIELD_UTILITIES_H 
    2 #define PURIFY_WIDE_FIELD_UTILITIES_H 
    4 #include "purify/config.h" 
    8 #include <sopt/mpi/communicator.h> 
   13 t_int 
w_support(
const t_real w, 
const t_real du, 
const t_int min, 
const t_int max);
 
   15 t_real 
pixel_to_lambda(
const t_real cell, 
const t_uint imsize, 
const t_real oversample_ratio);
 
   17 t_real 
estimate_cell_size(
const t_real max_u, 
const t_uint imsize, 
const t_real oversample_ratio);
 
   20                                    const t_real oversample_ratio);
 
   23                                           const t_real cellx, 
const t_real celly,
 
   24                                           const t_uint imsizex, 
const t_uint imsizey,
 
   25                                           const t_real oversample_ratio, 
const t_real scale);
 
   28                                          const t_real cellx, 
const t_real celly,
 
   29                                          const t_uint imsizex, 
const t_uint imsizey,
 
   30                                          const t_real oversample_ratio, 
const t_real scale);
 
   34                                          const t_real cellx, 
const t_real celly,
 
   35                                          const t_uint imsizex, 
const t_uint imsizey,
 
   36                                          const t_real oversample_ratio, 
const t_real scale,
 
   37                                          const sopt::mpi::Communicator &comm);
 
   40 t_real 
fov_cosine(t_real 
const cell, t_uint 
const imsize);
 
   43 Matrix<t_complex> 
generate_dde(
const DDE &dde, 
const t_real cell_x, 
const t_real cell_y,
 
   44                                const t_uint x_size, 
const t_uint y_size, 
const t_real stop_gap) {
 
   45   assert(stop_gap <= 1);
 
   49   const t_real delt_x = L / x_size;
 
   50   const t_real delt_y = M / y_size;
 
   51   Image<t_complex> output = Image<t_complex>::Zero(y_size, x_size);
 
   53   for (t_int l = 0; l < x_size; ++l)
 
   54     for (t_int m = 0; m < y_size; ++m) {
 
   55       const t_real x = (l - x_size * 0.5) * delt_x;
 
   56       const t_real y = (m - y_size * 0.5) * delt_y;
 
   57       output(m, l) = ((x * x + y * y) < 1 - stop_gap) ? dde(y, x) : 0.;
 
   64 Matrix<t_complex> 
generate_chirp(
const DDE &dde, 
const t_real w_rate, 
const t_real cell_x,
 
   65                                  const t_real cell_y, 
const t_uint x_size, 
const t_uint y_size,
 
   66                                  const t_real stop_gap = 0.1) {
 
   67   const t_real nz = y_size * x_size;
 
   68   const t_complex 
I(0, 1);
 
   69   const auto chirp = [=](
const t_real y, 
const t_real x) {
 
   71            (std::exp(-2 * 
constant::pi * 
I * w_rate * (std::sqrt(1 - x * x - y * y) - 1))) /
 
   72            std::sqrt(1 - x * x - y * y) / nz;
 
   74   return generate_dde(chirp, cell_x, cell_y, x_size, y_size, stop_gap);
 
   77 Matrix<t_complex> 
generate_chirp(
const t_real w_rate, 
const t_real cell_x, 
const t_real cell_y,
 
   78                                  const t_uint x_size, 
const t_uint y_size);
 
const std::vector< t_real > u
data for u coordinate
const std::vector< t_real > v
data for v coordinate
const t_real pi
mathematical constant
t_real fov_cosine(t_real const cell, t_uint const imsize)
Work out max L and M directional cosines from image parameters.
Matrix< t_complex > generate_dde(const DDE &dde, const t_real cell_x, const t_real cell_y, const t_uint x_size, const t_uint y_size, const t_real stop_gap)
Generate image of DDE for aw-stacking.
t_int w_support(const t_real w, const t_real du, const t_int min, const t_int max)
estimate support size of w given u resolution du
t_real equivalent_miriad_cell_size(const t_real cell, const t_uint imsize, const t_real oversample_ratio)
for a given purify cell size in arcsec provide the equivalent miriad cell size in arcsec
Vector< t_complex > sample_density_weights(const Vector< t_real > &u, const Vector< t_real > &v, const t_real cellx, const t_real celly, const t_uint imsizex, const t_uint imsizey, const t_real oversample_ratio, const t_real scale)
create sample density weights for a given field of view, uniform weighting
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
Matrix< t_complex > estimate_sample_density(const Vector< t_real > &u, const Vector< t_real > &v, const t_real cellx, const t_real celly, const t_uint imsizex, const t_uint imsizey, const t_real oversample_ratio, const t_real scale)
estimate sample desity grid for a given field of view
Matrix< t_complex > generate_chirp(const t_real w_rate, const t_real cell_x, const t_real cell_y, const t_uint x_size, const t_uint y_size)
Generates image of chirp.
t_real estimate_cell_size(const t_real max_u, const t_uint imsize, const t_real oversample_ratio)
return cell size from the bandwidth