Commit 85c43c0e by Martin Reinecke

### seems to be working

parent 0e0d5f18
 ... ... @@ -594,9 +594,6 @@ template class GridderConfig complex wscreen(double x, double y, double w, bool adjoint) const { constexpr double pi = 3.141592653589793238462643383279502884197; // PhD : sqrt (1-x*x-y*y)) - 1 //here 1 - sin(sqrt(x*x+y*y))**2/(1.+cos(sqrt(x*x+y*y))) // == (cos(sqrt(x*x+y*y))**2 +cos(sqrt(x*x+y*y))) / (1.+cos(sqrt(x*x+y*y))) double eps = sqrt(x+y); double s = sin(eps); double nm1 = -s*s/(1.+cos(eps)); ... ... @@ -605,19 +602,6 @@ template class GridderConfig if (adjoint) phase *= -1; return complex(cos(phase)*xn, sin(phase)*xn); } complex wscreen_nonorm(double x, double y, double w, bool adjoint) const { constexpr double pi = 3.141592653589793238462643383279502884197; // PhD : sqrt (1-x*x-y*y)) - 1 //here 1 - sin(sqrt(x*x+y*y))**2/(1.+cos(sqrt(x*x+y*y))) // == (cos(sqrt(x*x+y*y))**2 +cos(sqrt(x*x+y*y))) / (1.+cos(sqrt(x*x+y*y))) double eps = sqrt(x+y); double s = sin(eps); double nm1 = -s*s/(1.+cos(eps)); double phase = 2*pi*w*nm1; if (adjoint) phase *= -1; return complex(cos(phase), sin(phase)); } public: GridderConfig(size_t nxdirty, size_t nydirty, double epsilon, ... ... @@ -816,43 +800,6 @@ template class GridderConfig res[ny_dirty*i+j2] = dirty[ny_dirty*i+j2]*ws; // upper left } } } } return res_; } pyarr_c> apply_wscreen_nonorm(const pyarr_c> &dirty_, double w, bool adjoint) const { checkArray(dirty_, "dirty", {nx_dirty, ny_dirty}); auto dirty = dirty_.data(); auto res_ = makeArray>({nx_dirty, ny_dirty}); auto res = res_.mutable_data(); double x0 = -0.5*nx_dirty*psx, y0 = -0.5*ny_dirty*psy; { py::gil_scoped_release release; #pragma omp parallel num_threads(nthreads) { #pragma omp for schedule(static) for (size_t i=0; i<=nx_dirty/2; ++i) { double fx = x0+i*psx; fx *= fx; for (size_t j=0; j<=ny_dirty/2; ++j) { double fy = y0+j*psy; auto ws = wscreen_nonorm(fx, fy*fy, w, adjoint); 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)&&(i0)&&(j0)&&(j pyarr_c> vis2dirty_wstack(const Baselines &ba cout << "data w range: " << wmin << " to " << wmax << endl; //FIXME temporary double FCT; double dw; { double x0 = -0.5*nx_dirty*psx, y0 = -0.5*ny_dirty*psy; double nmin = sqrt(max(1.-x0*x0-y0*y0,0.))-1.; cout << abs(-0.5) << endl; cout << nmin << endl; FCT=0.25/nmin; dw = 0.25/abs(nmin); { double nwtmp=(wmax-wmin)/dw; double dntmp=abs(nmin)/nwtmp; cout << "NW: " << nwtmp << endl; cout << "DN: " << dntmp << endl; } double du=abs(1./x0)*nx_dirty; cout << "TEST: " << du << " " << dw << " " << du/dw<< endl; } cout << "delta w: " << dw << endl; ... ... @@ -1568,17 +1503,15 @@ cout << "w_supp: " << w_supp << endl; auto beta=2.3*w_supp; wmin -= 0.5*w_supp*dw; wmax += 0.5*w_supp*dw; size_t nplanes = size_t((wmax-wmin)/dw)+1; size_t nplanes = size_t((wmax-wmin)/dw)+2; cout << "nplanes: " << nplanes << endl; double dwmax=0.5*w_supp*dw; vector nvis_plane(nplanes,0); for (size_t ipart=0; ipart(0,iplane-w_supp); i(nplanes,iplane+w_supp+1); ++i) if (abs(wval[ipart]-(wmin+i*dw))(0,iplane-w_supp); i(nplanes,iplane+w_supp+1); ++i) // if (abs(wval[ipart]-(wmin+i*dw)) x, wgt; legendre_prep(2*p,x,wgt); auto psi = x; ... ... @@ -1643,25 +1568,16 @@ cout << "applying correction for gridding in w direction" << endl; #pragma omp for schedule(static) for (size_t i=0; i<=nx_dirty/2; ++i) { double fx = (-0.25+i*.5/nx_dirty); fx = x0+i*psx; double fx = x0+i*psx; fx *= fx; for (size_t j=0; j<=ny_dirty/2; ++j) { double fy = (-0.25+j*.5/ny_dirty); fy = y0+j*psy; double fy = y0+j*psy; fy*=fy; if (i==0 && j==0) cout << fx << " " << fy << " " << sqrt(1.-fx-fy)-1. << endl; if (i==nx_dirty/2 && j==ny_dirty/2) cout << fx << " " << fy << endl; auto n=sqrt(1.-fx-fy)-1.; // circle profile // auto n=cos(sqrt(fx+fy)) -1; // cosine profile n*=FCT;//[4.03;4.05] for cosine profile //n*=xfct;//[3.8;3.9] for circle profile auto n=cos(sqrt(fx+fy)) -1; // cosine profile double fct = 0.; for (int ix=0; ix
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!