LCOV - code coverage report
Current view: top level - synthesis/TransformMachines - AWProjectFT.FORTRANSTUFF (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 0 176 0.0 %
Date: 2024-10-10 19:51:30 Functions: 0 3 0.0 %

          Line data    Source code
       1             : //-*- C++ -*-
       2             : #define NEED_UNDERSCORES
       3             : #if defined(NEED_UNDERSCORES)
       4             : #define gpbwproj gpbwproj_
       5             : #define dpbwproj dpbwproj_
       6             : #define dpbwgrad dpbwgrad_
       7             : #endif
       8             :   
       9             :   extern "C" { 
      10             :     void gpbwproj(Double *uvw,
      11             :                   Double *dphase,
      12             :                   const Complex *values,
      13             :                   Int *nvispol,
      14             :                   Int *nvischan,
      15             :                   Int *dopsf,
      16             :                   const Int *flag,
      17             :                   const Int *rflag,
      18             :                   const Float *weight,
      19             :                   Int *nrow,
      20             :                   Int *rownum,
      21             :                   Double *scale,
      22             :                   Double *offset,
      23             :                   Complex *grid,
      24             :                   Int *nx,
      25             :                   Int *ny,
      26             :                   Int *npol,
      27             :                   Int *nchan,
      28             :                   const Double *freq,
      29             :                   const Double *c,
      30             :                   Int *support,
      31             :                   Int *convsize,
      32             :                   Int *sampling,
      33             :                   Int *wconvsize,
      34             :                   Complex *convfunc,
      35             :                   Int *chanmap,
      36             :                   Int *polmap,
      37             :                   Int *polused,
      38             :                   Double *sumwt,
      39             :                   Int *ant1,
      40             :                   Int *ant2,
      41             :                   Int *nant,
      42             :                   Int *scanno,
      43             :                   Double *sigma,
      44             :                   Float *raoff,
      45             :                   Float *decoff,
      46             :                   Double *area,
      47             :                   Int *doGrad,
      48             :                   Int *doPointingCorrection,
      49             :                   Int *nPA,
      50             :                   Int *paIndex,
      51             :                   Int *CFMap,
      52             :                   Int *ConjCFMap,
      53             :                   Double *currentCFPA, Double *actualPA,Double *cfRefFreq_p);
      54             :     void dpbwproj(Double *uvw,
      55             :                   Double *dphase,
      56             :                   Complex *values,
      57             :                   Int *nvispol,
      58             :                   Int *nvischan,
      59             :                   const Int *flag,
      60             :                   const Int *rflag,
      61             :                   Int *nrow,
      62             :                   Int *rownum,
      63             :                   Double *scale,
      64             :                   Double *offset,
      65             :                   const Complex *grid,
      66             :                   Int *nx,
      67             :                   Int *ny,
      68             :                   Int *npol,
      69             :                   Int *nchan,
      70             :                   const Double *freq,
      71             :                   const Double *c,
      72             :                   Int *support,
      73             :                   Int *convsize,
      74             :                   Int *sampling,
      75             :                   Int *wconvsize,
      76             :                   Complex *convfunc,
      77             :                   Int *chanmap,
      78             :                   Int *polmap,
      79             :                   Int *polused,
      80             :                   Int *ant1, 
      81             :                   Int *ant2, 
      82             :                   Int *nant, 
      83             :                   Int *scanno,
      84             :                   Double *sigma, 
      85             :                   Float *raoff, Float *decoff,
      86             :                   Double *area, 
      87             :                   Int *dograd,
      88             :                   Int *doPointingCorrection,
      89             :                   Int *nPA,
      90             :                   Int *paIndex,
      91             :                   Int *CFMap,
      92             :                   Int *ConjCFMap,
      93             :                   Double *currentCFPA, Double *actualPA, Double *cfRefFreq_p);
      94             :     void dpbwgrad(Double *uvw,
      95             :                   Double *dphase,
      96             :                   Complex *values,
      97             :                   Int *nvispol,
      98             :                   Int *nvischan,
      99             :                   Complex *gazvalues,
     100             :                   Complex *gelvalues,
     101             :                   Int *doconj,
     102             :                   const Int *flag,
     103             :                   const Int *rflag,
     104             :                   Int *nrow,
     105             :                   Int *rownum,
     106             :                   Double *scale,
     107             :                   Double *offset,
     108             :                   const Complex *grid,
     109             :                   Int *nx,
     110             :                   Int *ny,
     111             :                   Int *npol,
     112             :                   Int *nchan,
     113             :                   const Double *freq,
     114             :                   const Double *c,
     115             :                   Int *support,
     116             :                   Int *convsize,
     117             :                   Int *sampling,
     118             :                   Int *wconvsize,
     119             :                   Complex *convfunc,
     120             :                   Int *chanmap,
     121             :                   Int *polmap,
     122             :                   Int *polused,
     123             :                   Int *ant1, 
     124             :                   Int *ant2, 
     125             :                   Int *nant, 
     126             :                   Int *scanno,
     127             :                   Double *sigma, 
     128             :                   Float *raoff, Float *decoff,
     129             :                   Double *area, 
     130             :                   Int *dograd,
     131             :                   Int *doPointingCorrection,
     132             :                   Int *nPA,
     133             :                   Int *paIndex,
     134             :                   Int *CFMap,
     135             :                   Int *ConjCFMap,
     136             :                   Double *currentCFPA, Double *actualPA, Double *cfRefFreq_p);
     137             :   }
     138             :   //
     139             :   //----------------------------------------------------------------------
     140             :   //
     141           0 :   void AWProjectFT::runFortranGet(Matrix<Double>& uvw,Vector<Double>& dphase,
     142             :                                    Cube<Complex>& visdata,
     143             :                                    IPosition& s,
     144             :                                    //                           Cube<Complex>& gradVisAzData,
     145             :                                    //                           Cube<Complex>& gradVisElData,
     146             :                                    //                           IPosition& gradS,
     147             :                                    Int& Conj,
     148             :                                    Cube<Int>& flags,Vector<Int>& rowFlags,
     149             :                                    Int& rownr,Vector<Double>& actualOffset,
     150             :                                    Array<Complex>* dataPtr,
     151             :                                    Int& aNx, Int& aNy, Int& npol, Int& nchan,
     152             :                                    VisBuffer& vb,Int& Nant_p, Int& scanNo,
     153             :                                    Double& sigma,
     154             :                                    Array<Float>& l_off,
     155             :                                    Array<Float>& m_off,
     156             :                                    Double area,
     157             :                                    Int& doGrad,
     158             :                                    Int paIndex)
     159             :   {
     160           0 :     LogIO log_l(LogOrigin("AWProjectFT", "runFortranGet"));
     161             :     (void)Conj; //To supress the warning
     162             :     enum whichGetStorage {RAOFF,DECOFF,UVW,DPHASE,VISDATA,GRADVISAZ,GRADVISEL,
     163             :                           FLAGS,ROWFLAGS,UVSCALE,ACTUALOFFSET,DATAPTR,VBFREQ,
     164             :                           CONVSUPPORT,CONVFUNC,CHANMAP,POLMAP,VBANT1,VBANT2,CONJCFMAP,CFMAP};
     165           0 :     Vector<Bool> deleteThem(21);
     166             :     
     167             :     Double *uvw_p, *dphase_p, *actualOffset_p, *vb_freq_p, *uvScale_p;
     168             :     Complex *visdata_p, *dataPtr_p, *f_convFunc_p;
     169             :     Int *flags_p, *rowFlags_p, *chanMap_p, *polMap_p, *convSupport_p, *vb_ant1_p, *vb_ant2_p,
     170             :       *ConjCFMap_p, *CFMap_p;
     171             :     Float *l_off_p, *m_off_p;
     172             :     Double actualPA;
     173             :     
     174           0 :     Vector<Int> ConjCFMap, CFMap;
     175             :     /*
     176             :       ConjCFMap = CFMap = polMap;
     177             :       CFMap = makeConjPolMap(vb);
     178             :     */
     179             :     Int N;
     180           0 :     actualPA = getVBPA(vb);
     181             : 
     182           0 :     N=polMap.nelements();
     183           0 :     CFMap = polMap; ConjCFMap = polMap;
     184           0 :     for(Int i=0;i<N;i++) CFMap[i] = polMap[N-i-1];
     185             :     
     186           0 :     Array<Complex> rotatedConvFunc;
     187             : //     SynthesisUtils::rotateComplexArray(log_l, convFunc_p, cfs_p.coordSys,
     188             : //                                     rotatedConvFunc,(currentCFPA-actualPA),"CUBIC");
     189             :     // SynthesisUtils::rotateComplexArray(log_l, convFunc_p, cfs_p.coordSys,
     190             :     //                                 rotatedConvFunc,0.0,"LINEAR");
     191           0 :     SynthesisUtils::rotateComplexArray(log_l, *(cfs_p.data), /*convFunc_p,*/ cfs_p.coordSys,
     192           0 :                                        rotatedConvFunc,(currentCFPA-actualPA),"LINEAR");
     193             : 
     194           0 :     ConjCFMap = polMap;
     195           0 :     makeCFPolMap(vb,cfStokes_p,CFMap);
     196           0 :     makeConjPolMap(vb,CFMap,ConjCFMap);
     197             : 
     198             :     
     199           0 :     ConjCFMap_p     = ConjCFMap.getStorage(deleteThem(CONJCFMAP));
     200           0 :     CFMap_p         = CFMap.getStorage(deleteThem(CFMAP));
     201             :     
     202           0 :     uvw_p           = uvw.getStorage(deleteThem(UVW));
     203           0 :     dphase_p        = dphase.getStorage(deleteThem(DPHASE));
     204           0 :     visdata_p       = visdata.getStorage(deleteThem(VISDATA));
     205             :     //  gradVisAzData_p = gradVisAzData.getStorage(deleteThem(GRADVISAZ));
     206             :     //  gradVisElData_p = gradVisElData.getStorage(deleteThem(GRADVISEL));
     207           0 :     flags_p         = flags.getStorage(deleteThem(FLAGS));
     208           0 :     rowFlags_p      = rowFlags.getStorage(deleteThem(ROWFLAGS));
     209           0 :     uvScale_p       = uvScale.getStorage(deleteThem(UVSCALE));
     210           0 :     actualOffset_p  = actualOffset.getStorage(deleteThem(ACTUALOFFSET));
     211           0 :     dataPtr_p       = dataPtr->getStorage(deleteThem(DATAPTR));
     212           0 :     vb_freq_p       = vb.frequency().getStorage(deleteThem(VBFREQ));
     213           0 :     convSupport_p   = cfs_p.xSupport.getStorage(deleteThem(CONVSUPPORT));
     214             :     //    f_convFunc_p      = convFunc_p.getStorage(deleteThem(CONVFUNC));
     215           0 :     f_convFunc_p      = rotatedConvFunc.getStorage(deleteThem(CONVFUNC));
     216           0 :     chanMap_p       = chanMap.getStorage(deleteThem(CHANMAP));
     217           0 :     polMap_p        = polMap.getStorage(deleteThem(POLMAP));
     218           0 :     vb_ant1_p       = vb.antenna1().getStorage(deleteThem(VBANT1));
     219           0 :     vb_ant2_p       = vb.antenna2().getStorage(deleteThem(VBANT2));
     220           0 :     l_off_p     = l_off.getStorage(deleteThem(RAOFF));
     221           0 :     m_off_p    = m_off.getStorage(deleteThem(DECOFF));
     222             :     
     223             :     //    Int npa=convSupport.shape()(2),actualConvSize;
     224           0 :     Int npa=1,actualConvSize;
     225           0 :     Int paIndex_Fortran = paIndex;
     226           0 :     actualConvSize = cfs_p.data->shape()(0);
     227             :     
     228             :     //    IPosition shp=convSupport.shape();
     229             :     
     230           0 :     dpbwproj(uvw_p,
     231             :              dphase_p,
     232             :              //           vb.modelVisCube().getStorage(del),
     233             :              visdata_p,
     234           0 :              &s.asVector()(0),
     235           0 :              &s.asVector()(1),
     236             :              //    gradVisAzData_p,
     237             :              //    gradVisElData_p,
     238             :              //     &gradS(0),
     239             :              //     &gradS(1),
     240             :              //    &Conj,
     241             :              flags_p,
     242             :              rowFlags_p,
     243           0 :              &s.asVector()(2),
     244             :              &rownr,
     245             :              uvScale_p,
     246             :              actualOffset_p,
     247             :              dataPtr_p,
     248             :              &aNx,
     249             :              &aNy,
     250             :              &npol,
     251             :              &nchan,
     252             :              vb_freq_p,
     253             :              &C::c,
     254             :              convSupport_p,
     255             :              &actualConvSize,
     256             :              &convSampling,
     257             :              &wConvSize,
     258             :              f_convFunc_p,
     259             :              chanMap_p,
     260             :              polMap_p,
     261             :              &polInUse_p,
     262             :              vb_ant1_p,
     263             :              vb_ant2_p,
     264             :              &Nant_p,
     265             :              &scanNo,
     266             :              &sigma,
     267             :              l_off_p, m_off_p,
     268             :              &area,
     269             :              &doGrad,
     270             :              &doPointing,
     271             :              &npa,
     272             :              &paIndex_Fortran,
     273             :              CFMap_p,
     274             :              ConjCFMap_p,
     275             :              &currentCFPA
     276             :              ,&actualPA,&cfRefFreq_p
     277             :              );
     278             :     
     279           0 :     ConjCFMap.freeStorage((const Int *&)ConjCFMap_p,deleteThem(CONJCFMAP));
     280           0 :     CFMap.freeStorage((const Int *&)CFMap_p,deleteThem(CFMAP));
     281             :     
     282           0 :     l_off.freeStorage((const Float*&)l_off_p,deleteThem(RAOFF));
     283           0 :     m_off.freeStorage((const Float*&)m_off_p,deleteThem(DECOFF));
     284           0 :     uvw.freeStorage((const Double*&)uvw_p,deleteThem(UVW));
     285           0 :     dphase.freeStorage((const Double*&)dphase_p,deleteThem(DPHASE));
     286           0 :     visdata.putStorage(visdata_p,deleteThem(VISDATA));
     287           0 :     flags.freeStorage((const Int*&) flags_p,deleteThem(FLAGS));
     288           0 :     rowFlags.freeStorage((const Int *&)rowFlags_p,deleteThem(ROWFLAGS));
     289           0 :     actualOffset.freeStorage((const Double*&)actualOffset_p,deleteThem(ACTUALOFFSET));
     290           0 :     dataPtr->freeStorage((const Complex *&)dataPtr_p,deleteThem(DATAPTR));
     291           0 :     uvScale.freeStorage((const Double*&) uvScale_p,deleteThem(UVSCALE));
     292           0 :     vb.frequency().freeStorage((const Double*&)vb_freq_p,deleteThem(VBFREQ));
     293           0 :     cfs_p.xSupport.freeStorage((const Int*&)convSupport_p,deleteThem(CONVSUPPORT));
     294             :     //    convFunc_p.freeStorage((const Complex *&)f_convFunc_p,deleteThem(CONVFUNC));
     295           0 :     chanMap.freeStorage((const Int*&)chanMap_p,deleteThem(CHANMAP));
     296           0 :     polMap.freeStorage((const Int*&) polMap_p,deleteThem(POLMAP));
     297           0 :     vb.antenna1().freeStorage((const Int*&) vb_ant1_p,deleteThem(VBANT1));
     298           0 :     vb.antenna2().freeStorage((const Int*&) vb_ant2_p,deleteThem(VBANT2));
     299           0 :   }
     300             :   //
     301             :   //----------------------------------------------------------------------
     302             :   //
     303           0 :   void AWProjectFT::runFortranGetGrad(Matrix<Double>& uvw,Vector<Double>& dphase,
     304             :                                        Cube<Complex>& visdata,
     305             :                                        IPosition& s,
     306             :                                        Cube<Complex>& gradVisAzData,
     307             :                                        Cube<Complex>& gradVisElData,
     308             :                                        //                                    IPosition& gradS,
     309             :                                        Int& Conj,
     310             :                                        Cube<Int>& flags,Vector<Int>& rowFlags,
     311             :                                        Int& rownr,Vector<Double>& actualOffset,
     312             :                                        Array<Complex>* dataPtr,
     313             :                                        Int& aNx, Int& aNy, Int& npol, Int& nchan,
     314             :                                        VisBuffer& vb,Int& Nant_p, Int& scanNo,
     315             :                                        Double& sigma,
     316             :                                        Array<Float>& l_off,
     317             :                                        Array<Float>& m_off,
     318             :                                        Double area,
     319             :                                        Int& doGrad,
     320             :                                        Int paIndex)
     321             :   {
     322           0 :     LogIO log_l(LogOrigin("AWProjectFT", "runFortranGetGrad"));
     323             :     enum whichGetStorage {RAOFF,DECOFF,UVW,DPHASE,VISDATA,GRADVISAZ,GRADVISEL,
     324             :                           FLAGS,ROWFLAGS,UVSCALE,ACTUALOFFSET,DATAPTR,VBFREQ,
     325             :                           CONVSUPPORT,CONVFUNC,CHANMAP,POLMAP,VBANT1,VBANT2,CONJCFMAP,CFMAP};
     326           0 :     Vector<Bool> deleteThem(21);
     327             :     
     328             :     Double *uvw_p, *dphase_p, *actualOffset_p, *vb_freq_p, *uvScale_p;
     329             :     Complex *visdata_p, *dataPtr_p, *f_convFunc_p;
     330             :     Complex *gradVisAzData_p, *gradVisElData_p;
     331             :     Int *flags_p, *rowFlags_p, *chanMap_p, *polMap_p, *convSupport_p, *vb_ant1_p, *vb_ant2_p,
     332             :       *ConjCFMap_p, *CFMap_p;
     333             :     Float *l_off_p, *m_off_p;
     334             :     Double actualPA;
     335             : 
     336           0 :     Vector<Int> ConjCFMap, CFMap;
     337           0 :     actualPA = getVBPA(vb);
     338           0 :     ConjCFMap = polMap;
     339           0 :     makeCFPolMap(vb,cfStokes_p,CFMap);
     340           0 :     makeConjPolMap(vb,CFMap,ConjCFMap);
     341             : 
     342           0 :     Array<Complex> rotatedConvFunc;
     343             : //     SynthesisUtils::rotateComplexArray(log_l, convFunc_p, cfs_p.coordSys,
     344             : //                                     rotatedConvFunc,(currentCFPA-actualPA),"LINEAR");
     345           0 :     SynthesisUtils::rotateComplexArray(log_l, *(cfs_p.data) /*convFunc_p*/, cfs_p.coordSys,
     346             :                                        rotatedConvFunc,0.0);
     347             :     // SynthesisUtils::rotateComplexArray(log_l, convFunc_p, cfs_p.coordSys,
     348             :     //                                 rotatedConvFunc,(currentCFPA-actualPA),"LINEAR");
     349             : 
     350           0 :     ConjCFMap_p     = ConjCFMap.getStorage(deleteThem(CONJCFMAP));
     351           0 :     CFMap_p         = CFMap.getStorage(deleteThem(CFMAP));
     352             :     
     353           0 :     uvw_p           = uvw.getStorage(deleteThem(UVW));
     354           0 :     dphase_p        = dphase.getStorage(deleteThem(DPHASE));
     355           0 :     visdata_p       = visdata.getStorage(deleteThem(VISDATA));
     356           0 :     gradVisAzData_p = gradVisAzData.getStorage(deleteThem(GRADVISAZ));
     357           0 :     gradVisElData_p = gradVisElData.getStorage(deleteThem(GRADVISEL));
     358           0 :     flags_p         = flags.getStorage(deleteThem(FLAGS));
     359           0 :     rowFlags_p      = rowFlags.getStorage(deleteThem(ROWFLAGS));
     360           0 :     uvScale_p       = uvScale.getStorage(deleteThem(UVSCALE));
     361           0 :     actualOffset_p  = actualOffset.getStorage(deleteThem(ACTUALOFFSET));
     362           0 :     dataPtr_p       = dataPtr->getStorage(deleteThem(DATAPTR));
     363           0 :     vb_freq_p       = vb.frequency().getStorage(deleteThem(VBFREQ));
     364           0 :     convSupport_p   = cfs_p.xSupport.getStorage(deleteThem(CONVSUPPORT));
     365             :     //    f_convFunc_p      = convFunc_p.getStorage(deleteThem(CONVFUNC));
     366           0 :     f_convFunc_p      = rotatedConvFunc.getStorage(deleteThem(CONVFUNC));
     367           0 :     chanMap_p       = chanMap.getStorage(deleteThem(CHANMAP));
     368           0 :     polMap_p        = polMap.getStorage(deleteThem(POLMAP));
     369           0 :     vb_ant1_p       = vb.antenna1().getStorage(deleteThem(VBANT1));
     370           0 :     vb_ant2_p       = vb.antenna2().getStorage(deleteThem(VBANT2));
     371           0 :     l_off_p     = l_off.getStorage(deleteThem(RAOFF));
     372           0 :     m_off_p    = m_off.getStorage(deleteThem(DECOFF));
     373             :     
     374             :     //    Int npa=convSupport.shape()(2),actualConvSize;
     375           0 :     Int npa=1,actualConvSize;
     376           0 :     Int paIndex_Fortran = paIndex;
     377           0 :     actualConvSize = cfs_p.data->shape()(0);
     378             :     
     379             :     //    IPosition shp=convSupport.shape();
     380             : 
     381           0 :     dpbwgrad(uvw_p,
     382             :              dphase_p,
     383             :              //           vb.modelVisCube().getStorage(del),
     384             :              visdata_p,
     385           0 :              &s.asVector()(0),
     386           0 :              &s.asVector()(1),
     387             :              gradVisAzData_p,
     388             :              gradVisElData_p,
     389             :              //     &gradS(0),
     390             :              //     &gradS(1),
     391             :              &Conj,
     392             :              flags_p,
     393             :              rowFlags_p,
     394           0 :              &s.asVector()(2),
     395             :              &rownr,
     396             :              uvScale_p,
     397             :              actualOffset_p,
     398             :              dataPtr_p,
     399             :              &aNx,
     400             :              &aNy,
     401             :              &npol,
     402             :              &nchan,
     403             :              vb_freq_p,
     404             :              &C::c,
     405             :              convSupport_p,
     406             :              &actualConvSize,
     407             :              &convSampling,
     408             :              &wConvSize,
     409             :              f_convFunc_p,
     410             :              chanMap_p,
     411             :              polMap_p,
     412             :              &polInUse_p,
     413             :              vb_ant1_p,
     414             :              vb_ant2_p,
     415             :              &Nant_p,
     416             :              &scanNo,
     417             :              &sigma,
     418             :              l_off_p, m_off_p,
     419             :              &area,
     420             :              &doGrad,
     421             :              &doPointing,
     422             :              &npa,
     423             :              &paIndex_Fortran,
     424             :              CFMap_p,
     425             :              ConjCFMap_p,
     426             :              &currentCFPA
     427             :              ,&actualPA,&cfRefFreq_p
     428             :              );
     429             : 
     430           0 :     ConjCFMap.freeStorage((const Int *&)ConjCFMap_p,deleteThem(CONJCFMAP));
     431           0 :     CFMap.freeStorage((const Int *&)CFMap_p,deleteThem(CFMAP));
     432             :     
     433           0 :     l_off.freeStorage((const Float*&)l_off_p,deleteThem(RAOFF));
     434           0 :     m_off.freeStorage((const Float*&)m_off_p,deleteThem(DECOFF));
     435           0 :     uvw.freeStorage((const Double*&)uvw_p,deleteThem(UVW));
     436           0 :     dphase.freeStorage((const Double*&)dphase_p,deleteThem(DPHASE));
     437           0 :     visdata.putStorage(visdata_p,deleteThem(VISDATA));
     438           0 :     gradVisAzData.putStorage(gradVisAzData_p,deleteThem(GRADVISAZ));
     439           0 :     gradVisElData.putStorage(gradVisElData_p,deleteThem(GRADVISEL));
     440           0 :     flags.freeStorage((const Int*&) flags_p,deleteThem(FLAGS));
     441           0 :     rowFlags.freeStorage((const Int *&)rowFlags_p,deleteThem(ROWFLAGS));
     442           0 :     actualOffset.freeStorage((const Double*&)actualOffset_p,deleteThem(ACTUALOFFSET));
     443           0 :     dataPtr->freeStorage((const Complex *&)dataPtr_p,deleteThem(DATAPTR));
     444           0 :     uvScale.freeStorage((const Double*&) uvScale_p,deleteThem(UVSCALE));
     445           0 :     vb.frequency().freeStorage((const Double*&)vb_freq_p,deleteThem(VBFREQ));
     446           0 :     cfs_p.xSupport.freeStorage((const Int*&)convSupport_p,deleteThem(CONVSUPPORT));
     447             :     //    convFunc_p.freeStorage((const Complex *&)f_convFunc_p,deleteThem(CONVFUNC));
     448           0 :     chanMap.freeStorage((const Int*&)chanMap_p,deleteThem(CHANMAP));
     449           0 :     polMap.freeStorage((const Int*&) polMap_p,deleteThem(POLMAP));
     450           0 :     vb.antenna1().freeStorage((const Int*&) vb_ant1_p,deleteThem(VBANT1));
     451           0 :     vb.antenna2().freeStorage((const Int*&) vb_ant2_p,deleteThem(VBANT2));
     452           0 :   }
     453             :   //
     454             :   //----------------------------------------------------------------------
     455             :   //
     456           0 :   void AWProjectFT::runFortranPut(Matrix<Double>& uvw,Vector<Double>& dphase,
     457             :                                    const Complex& visdata,
     458             :                                    IPosition& s,
     459             :                                    //                           Cube<Complex>& gradVisAzData,
     460             :                                    //                           Cube<Complex>& gradVisElData,
     461             :                                    //                           IPosition& gradS,
     462             :                                    Int& Conj,
     463             :                                    Cube<Int>& flags,Vector<Int>& rowFlags,
     464             :                                    const Matrix<Float>& weight,
     465             :                                    Int& rownr,Vector<Double>& actualOffset,
     466             :                                    Array<Complex>& dataPtr,
     467             :                                    Int& aNx, Int& aNy, Int& npol, Int& nchan,
     468             :                                    const VisBuffer& vb,Int& Nant_p, Int& scanNo,
     469             :                                    Double& sigma,
     470             :                                    Array<Float>& l_off,
     471             :                                    Array<Float>& m_off,
     472             :                                    Matrix<Double>& sumWeight,
     473             :                                    Double& area,
     474             :                                    Int& doGrad,
     475             :                                    Int& doPSF,
     476             :                                    Int paIndex)
     477             :   {
     478           0 :     LogIO log_l(LogOrigin("AWProjectFT", "runFortranPut"));
     479             : 
     480             :     (void)Conj; //To supress the warning
     481             :     enum whichGetStorage {RAOFF,DECOFF,UVW,DPHASE,VISDATA,GRADVISAZ,GRADVISEL,
     482             :                           FLAGS,ROWFLAGS,UVSCALE,ACTUALOFFSET,DATAPTR,VBFREQ,
     483             :                           CONVSUPPORT,CONVFUNC,CHANMAP,POLMAP,VBANT1,VBANT2,WEIGHT,
     484             :                           SUMWEIGHT,CONJCFMAP,CFMAP};
     485           0 :     Vector<Bool> deleteThem(23);
     486             :     
     487             :     Double *uvw_p, *dphase_p, *actualOffset_p, *vb_freq_p, *uvScale_p;
     488             :     Complex *dataPtr_p, *f_convFunc_p;
     489             :     //  Complex *gradVisAzData_p, *gradVisElData_p;
     490             :     Int *flags_p, *rowFlags_p, *chanMap_p, *polMap_p, *convSupport_p, *vb_ant1_p, *vb_ant2_p,
     491             :       *ConjCFMap_p, *CFMap_p;
     492             :     Float *l_off_p, *m_off_p;
     493             :     Float *weight_p;Double *sumwt_p;
     494             :     Double actualPA;
     495           0 :     const Complex *visdata_p=&visdata;
     496             :     
     497           0 :     Vector<Int> ConjCFMap, CFMap;
     498           0 :     actualPA = getVBPA(vb);
     499           0 :     ConjCFMap = polMap;
     500             : 
     501           0 :     Array<Complex> rotatedConvFunc;
     502             : //    SynthesisUtils::rotateComplexArray(log_l, convFunc_p, cfs_p.coordSys,
     503             : //                                     rotatedConvFunc,(currentCFPA-actualPA),"LINEAR");
     504           0 :     SynthesisUtils::rotateComplexArray(log_l, *(cfs_p.data) /*convFunc_p*/, cfs_p.coordSys,
     505             :                                        rotatedConvFunc,0.0,"LINEAR");
     506             : 
     507             :     /*
     508             :     CFMap = polMap; ConjCFMap = polMap;
     509             :     CFMap = makeConjPolMap(vb);
     510             :     */
     511           0 :     makeCFPolMap(vb,cfStokes_p,CFMap);
     512           0 :     makeConjPolMap(vb,CFMap,ConjCFMap);
     513             : 
     514           0 :     ConjCFMap_p     = ConjCFMap.getStorage(deleteThem(CONJCFMAP));
     515           0 :     CFMap_p         = CFMap.getStorage(deleteThem(CFMAP));
     516             :     
     517           0 :     uvw_p           = uvw.getStorage(deleteThem(UVW));
     518           0 :     dphase_p        = dphase.getStorage(deleteThem(DPHASE));
     519             :     //  visdata_p       = visdata.getStorage(deleteThem(VISDATA));
     520             :     //  gradVisAzData_p = gradVisAzData.getStorage(deleteThem(GRADVISAZ));
     521             :     //  gradVisElData_p = gradVisElData.getStorage(deleteThem(GRADVISEL));
     522           0 :     flags_p         = flags.getStorage(deleteThem(FLAGS));
     523           0 :     rowFlags_p      = rowFlags.getStorage(deleteThem(ROWFLAGS));
     524           0 :     uvScale_p       = uvScale.getStorage(deleteThem(UVSCALE));
     525           0 :     actualOffset_p  = actualOffset.getStorage(deleteThem(ACTUALOFFSET));
     526           0 :     dataPtr_p       = dataPtr.getStorage(deleteThem(DATAPTR));
     527           0 :     vb_freq_p       = (Double *)(vb.frequency().getStorage(deleteThem(VBFREQ)));
     528           0 :     convSupport_p   = cfs_p.xSupport.getStorage(deleteThem(CONVSUPPORT));
     529             :     //    f_convFunc_p      = convFunc_p.getStorage(deleteThem(CONVFUNC));
     530           0 :     f_convFunc_p      = rotatedConvFunc.getStorage(deleteThem(CONVFUNC));
     531           0 :     chanMap_p       = chanMap.getStorage(deleteThem(CHANMAP));
     532           0 :     polMap_p        = polMap.getStorage(deleteThem(POLMAP));
     533           0 :     vb_ant1_p       = (Int *)(vb.antenna1().getStorage(deleteThem(VBANT1)));
     534           0 :     vb_ant2_p       = (Int *)(vb.antenna2().getStorage(deleteThem(VBANT2)));
     535           0 :     l_off_p     = l_off.getStorage(deleteThem(RAOFF));
     536           0 :     m_off_p    = m_off.getStorage(deleteThem(DECOFF));
     537           0 :     weight_p        = (Float *)(weight.getStorage(deleteThem(WEIGHT)));
     538           0 :     sumwt_p         = sumWeight.getStorage(deleteThem(SUMWEIGHT));
     539             :     
     540             :     
     541             :     //    Int npa=convSupport.shape()(2),actualConvSize;
     542           0 :     Int npa=1,actualConvSize;
     543           0 :     Int paIndex_Fortran = paIndex; 
     544           0 :     actualConvSize = cfs_p.data->shape()(0);
     545             :     
     546             :     //    IPosition shp=convSupport.shape();
     547             :     
     548           0 :     gpbwproj(uvw_p,
     549             :              dphase_p,
     550             :              //           vb.modelVisCube().getStorage(del),
     551             :              visdata_p,
     552           0 :              &s.asVector()(0),
     553           0 :              &s.asVector()(1),
     554             :              //    gradVisAzData_p,
     555             :              //    gradVisElData_p,
     556             :              //     &gradS(0),
     557             :              //     &gradS(1),
     558             :              //    &Conj,
     559             :              &doPSF,
     560             :              flags_p,
     561             :              rowFlags_p,
     562             :              weight_p,
     563           0 :              &s.asVector()(2),
     564             :              &rownr,
     565             :              uvScale_p,
     566             :              actualOffset_p,
     567             :              dataPtr_p,
     568             :              &aNx,
     569             :              &aNy,
     570             :              &npol,
     571             :              &nchan,
     572             :              vb_freq_p,
     573             :              &C::c,
     574             :              convSupport_p,
     575             :              &actualConvSize,
     576             :              &convSampling,
     577             :              &wConvSize,
     578             :              f_convFunc_p,
     579             :              chanMap_p,
     580             :              polMap_p,
     581             :              &polInUse_p,
     582             :              sumwt_p,
     583             :              vb_ant1_p,
     584             :              vb_ant2_p,
     585             :              &Nant_p,
     586             :              &scanNo,
     587             :              &sigma,
     588             :              l_off_p, m_off_p,
     589             :              &area,
     590             :              &doGrad,
     591             :              &doPointing,
     592             :              &npa,
     593             :              &paIndex_Fortran,
     594             :              CFMap_p,
     595             :              ConjCFMap_p,
     596             :              &currentCFPA
     597             :              ,&actualPA,&cfRefFreq_p
     598             :              );
     599             :     
     600           0 :     ConjCFMap.freeStorage((const Int *&)ConjCFMap_p,deleteThem(CONJCFMAP));
     601           0 :     CFMap.freeStorage((const Int *&)CFMap_p,deleteThem(CFMAP));
     602             :     
     603           0 :     l_off.freeStorage((const Float*&)l_off_p,deleteThem(RAOFF));
     604           0 :     m_off.freeStorage((const Float*&)m_off_p,deleteThem(DECOFF));
     605           0 :     uvw.freeStorage((const Double*&)uvw_p,deleteThem(UVW));
     606           0 :     dphase.freeStorage((const Double*&)dphase_p,deleteThem(DPHASE));
     607             :     //  visdata.putStorage(visdata_p,deleteThem(VISDATA));
     608             :     //  gradVisAzData.putStorage(gradVisAzData_p,deleteThem(GRADVISAZ));
     609             :     //  gradVisElData.putStorage(gradVisElData_p,deleteThem(GRADVISEL));
     610           0 :     flags.freeStorage((const Int*&) flags_p,deleteThem(FLAGS));
     611           0 :     rowFlags.freeStorage((const Int *&)rowFlags_p,deleteThem(ROWFLAGS));
     612           0 :     actualOffset.freeStorage((const Double*&)actualOffset_p,deleteThem(ACTUALOFFSET));
     613           0 :     dataPtr.freeStorage((const Complex *&)dataPtr_p,deleteThem(DATAPTR));
     614           0 :     uvScale.freeStorage((const Double*&) uvScale_p,deleteThem(UVSCALE));
     615           0 :     vb.frequency().freeStorage((const Double*&)vb_freq_p,deleteThem(VBFREQ));
     616           0 :     cfs_p.xSupport.freeStorage((const Int*&)convSupport_p,deleteThem(CONVSUPPORT));
     617             :     //    convFunc_p.freeStorage((const Complex *&)f_convFunc_p,deleteThem(CONVFUNC));
     618           0 :     chanMap.freeStorage((const Int*&)chanMap_p,deleteThem(CHANMAP));
     619           0 :     polMap.freeStorage((const Int*&) polMap_p,deleteThem(POLMAP));
     620           0 :     vb.antenna1().freeStorage((const Int*&) vb_ant1_p,deleteThem(VBANT1));
     621           0 :     vb.antenna2().freeStorage((const Int*&) vb_ant2_p,deleteThem(VBANT2));
     622           0 :     weight.freeStorage((const Float*&)weight_p,deleteThem(WEIGHT));
     623           0 :     sumWeight.putStorage(sumwt_p,deleteThem(SUMWEIGHT));
     624           0 :   }

Generated by: LCOV version 1.16