Line data Source code
1 0 : subroutine faccumulateFromGrid(nvalue, norm,grid, convFuncV,
2 : $ wVal, scaledSupport, scaledSampling,
3 : $ off, convOrigin, cfShape, loc,
4 : $ igrdpos, sinDPA, cosDPA,
5 : $ finitePointingOffset,
6 0 : $ phaseGrad,
7 : $ phasor,
8 : $ imNX, imNY, imNP, imNC,
9 : $ cfNX, cfNY, cfNP, cfNC,
10 : $ phNX, phNY)
11 :
12 : implicit none
13 : integer imNX, imNY, imNC, imNP,
14 : $ vNX, vNY, vNC, vNP,
15 : $ cfNX, cfNY, cfNP, cfNC,
16 : $ phNX, phNY
17 :
18 : complex grid(imNX, imNY, imNP, imNC)
19 : complex convFuncV(cfNX, cfNY, cfNP, cfNC)
20 : complex nvalue
21 : double precision wVal
22 : integer scaledSupport(2)
23 : real scaledSampling(2)
24 : double precision off(2)
25 : integer convOrigin(4), cfShape(4), loc(4), igrdpos(4)
26 : double precision sinDPA, cosDPA
27 : integer finitePointingOffset
28 : complex norm
29 : complex phaseGrad(phNX, phNY),phasor
30 :
31 : integer l_phaseGradOriginX, l_phaseGradOriginY
32 : integer iloc(4), iCFPos(4)
33 : complex wt
34 : integer ix,iy
35 : integer l_igrdpos(4)
36 :
37 : data iloc/1,1,1,1/, iCFPos/1,1,1,1/
38 0 : l_igrdpos(3) = igrdpos(3)+1
39 0 : l_igrdpos(4) = igrdpos(4)+1
40 0 : l_phaseGradOriginX=phNX/2 + 1
41 0 : l_phaseGradOriginY=phNY/2 + 1
42 :
43 0 : do iy=-scaledSupport(2),scaledSupport(2)
44 0 : iloc(2)=nint(scaledSampling(2)*iy+off(2)-1)
45 0 : iCFPos(2)=iloc(2)+convOrigin(2)+1
46 0 : l_igrdpos(2) = loc(2)+iy+1
47 0 : do ix=-scaledSupport(1),scaledSupport(1)
48 0 : iloc(1)=nint(scaledSampling(1)*ix+off(1)-1)
49 0 : iCFPos(1) = iloc(1) + convOrigin(1) + 1
50 0 : l_igrdpos(1) = loc(1) + ix + 1
51 : C
52 : C Conjugate the CF to account for the W-term and poln. squint. This is
53 : C the equivalent of the A^\dag operator in the A-Projection paper (A&A 487,
54 : C 419-429 (2008); http://arxiv.org/abs/0805.0834) for the antenna optics (plus
55 : C geometric effects like the w-term)
56 : C
57 : wt = convFuncV(iCFPos(1), iCFPos(2),
58 0 : $ iCFPos(3), iCFPos(4))
59 0 : if (wVal .le. 0.0) wt = conjg(wt)
60 :
61 0 : norm = norm + (wt)
62 : C
63 : C Apply the conjugate of the phase gradient. This, along with
64 : C conjg(phasor) later, is the equivalent of applying the A^\dag
65 : C operator in the A-Projection paper for mosaic imaging.
66 : C
67 0 : if (finitePointingOffset .eq. 1) then
68 : wt = wt * conjg(phaseGrad(iloc(1) + l_phaseGradOriginX,
69 0 : $ iloc(2) + l_phaseGradOriginY))
70 : endif
71 :
72 : nvalue = nvalue + wt * grid(l_igrdpos(1), l_igrdpos(2),
73 0 : $ l_igrdpos(3), l_igrdpos(4))
74 :
75 : enddo
76 : enddo
77 : c nvalue = nvalue *conjg(phasor)/norm
78 : c Normalization by norm is done in the Mueller loop in AWVR.
79 0 : nvalue = nvalue *conjg(phasor)
80 0 : end
|