Commit f122e045 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

rearrangements and comments

parent b60b3b60
......@@ -552,6 +552,15 @@ template<typename T> class GridderConfig
T beta;
vector<T> cfu, cfv;
complex<T> wscreen(double x, double y, double w, bool adjoint) const
{
constexpr double pi = 3.141592653589793238462643383279502884197;
double n = cos(sqrt(x+y)), xn = 1./n;
double phase = 2*pi*w*(n-1);
if (adjoint) phase *= -1;
return complex<T>(cos(phase)*xn, sin(phase)*xn);
}
public:
GridderConfig(size_t nxdirty, size_t nydirty, double epsilon,
double pixsize_x, double pixsize_y)
......@@ -707,14 +716,6 @@ template<typename T> class GridderConfig
}
return tmp;
}
complex<T> wscreen(double x, double y, double w, bool adjoint) const
{
constexpr double pi = 3.141592653589793238462643383279502884197;
double n = cos(sqrt(x+y)), xn = 1./n;
double phase = 2*pi*w*(n-1);
if (adjoint) phase *= -1;
return complex<T>(cos(phase)*xn, sin(phase)*xn);
}
inline void getpix(T u_in, T v_in, T &u, T &v, int &iu0, int &iv0) const
{
u=fmodulo(u_in*psx, T(1))*nu,
......@@ -745,17 +746,16 @@ template<typename T> class GridderConfig
{
double fy = y0+j*psy;
auto ws = wscreen(fx, fy*fy, w, adjoint);
res[ny_dirty*i+j] = dirty[ny_dirty*i+j]*ws;
size_t i2 = nx_dirty-i,
j2 = ny_dirty-j;
res[ny_dirty*i+j] = dirty[ny_dirty*i+j]*ws; // lower left
size_t i2 = nx_dirty-i, j2 = ny_dirty-j;
if ((i>0)&&(i<i2))
{
res[ny_dirty*i2+j] = dirty[ny_dirty*i2+j]*ws;
res[ny_dirty*i2+j] = dirty[ny_dirty*i2+j]*ws; // lower right
if ((j>0)&&(j<j2))
res[ny_dirty*i2+j2] = dirty[ny_dirty*i2+j2]*ws;
res[ny_dirty*i2+j2] = dirty[ny_dirty*i2+j2]*ws; // upper right
}
if ((j>0)&&(j<j2))
res[ny_dirty*i+j2] = dirty[ny_dirty*i+j2]*ws;
res[ny_dirty*i+j2] = dirty[ny_dirty*i+j2]*ws; // upper left
}
}
}
......
Supports Markdown
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