Commits
1 1 | |
2 2 | |
3 3 | |
4 4 | template <class T> |
5 5 | void AWVisResampler::accumulateFromGrid(T& nvalue, |
6 + | Complex& norm, |
6 7 | const T* __restrict__& grid, Vector<Int>& iGrdPos, |
7 8 | Complex* __restrict__& convFuncV, Double& wVal, |
8 9 | Vector<Int>& scaledSupport, Vector<Float>& scaledSampling, |
9 10 | Vector<Double>& offset, Vector<Int>& convOrigin, Vector<Int>& cfShape, |
10 11 | Vector<Int>& loc, Complex& phasor, Double& sinDPA, Double& cosDPA, |
11 12 | Bool& finitePointingOffset, Matrix<Complex>& cached_phaseGrad_p) |
12 13 | { |
13 14 | (void)sinDPA; (void)cosDPA; (void)cfShape; // Keep the compiler warnings off for now |
14 - | Complex wt, norm=0.0; |
15 + | Complex wt;//, norm=0.0; |
15 16 | Vector<Int> iCFPos(4,0),iLoc(4,0); |
16 17 | |
17 18 | // cerr << scaledSupport << endl |
18 19 | // << scaledSampling << endl |
19 20 | // << offset << endl |
20 21 | // << cfShape << endl |
21 22 | // << convOrigin << endl; |
22 23 | IPosition phaseGradOrigin_l; |
23 24 | phaseGradOrigin_l = cached_phaseGrad_p.shape()/2; |
24 25 | |
31 32 | for(Int ix=-scaledSupport[0]; ix <= scaledSupport[0]; ix++) |
32 33 | { |
33 34 | iLoc[0] = static_cast<int>(scaledSampling[0]*ix+offset[0]); |
34 35 | iCFPos[0] = iLoc[0] + convOrigin[0]; |
35 36 | iGrdPos[0] = loc[0]+ix; |
36 37 | |
37 38 | { |
38 39 | wt = getFrom4DArray((const Complex* __restrict__ &) convFuncV, |
39 40 | iCFPos,cfInc_p); |
40 41 | // wt = convFuncV(iCFPos); |
41 - | if (wVal > 0.0) wt = conj(wt); |
42 + | if (wVal <= 0.0) wt = conj(wt); |
42 43 | |
43 44 | norm+=(wt); |
44 45 | if (finitePointingOffset) |
45 46 | wt *= cached_phaseGrad_p(iLoc[0]+phaseGradOrigin_l[0], |
46 47 | iLoc[1]+phaseGradOrigin_l[1]); |
47 48 | // nvalue+=wt*grid(iGrdPos); |
48 49 | nvalue += wt * getFrom4DArray(grid, iGrdPos, gridInc_p); |
49 50 | } |
50 51 | } |
51 52 | } |
52 - | nvalue *= conj(phasor)/norm; |
53 + | nvalue *= conj(phasor);///norm; |
53 54 | } |
54 55 | |
55 56 | // |
56 57 | //----------------------------------------------------------------------------------- |
57 58 | // |
58 59 | template <class T> |
59 60 | void AWVisResampler::accumulateFromGrid(T& nvalue, |
60 61 | const T* __restrict__& grid, Vector<Int>& iGrdPos, |
61 62 | Complex* __restrict__& convFuncV, Double& wVal, |
62 63 | Vector<Int>& scaledSupport, Vector<Float>& scaledSampling, |