LCOV - code coverage report
Current view: top level - synthesis/TransformMachines2 - AWProjectFT.FORTRANSTUFF (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 0 180 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(const Double *uvw,
      11             :                   const 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             :                   const Double *scale,
      22             :                   const Double *offset,
      23             :                   const Complex *grid,
      24             :                   Int *nx,
      25             :                   Int *ny,
      26             :                   Int *npol,
      27             :                   Int *nchan,
      28             :                   const Double *freq,
      29             :                   const Double *c,
      30             :                   const Int *support,
      31             :                   const Int *convsize,
      32             :                   Int *sampling,
      33             :                   Int *wconvsize,
      34             :                   Complex *convfunc,
      35             :                   const Int *chanmap,
      36             :                   const Int *polmap,
      37             :                   const Int *polused,
      38             :                   const Double *sumwt,
      39             :                   const Int *ant1,
      40             :                   const Int *ant2,
      41             :                   const 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(const Double *uvw,
      55             :                   const 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             :                   const Double *scale,
      64             :                   const 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             :                   const Int *support,
      73             :                   const Int *convsize,
      74             :                   Int *sampling,
      75             :                   Int *wconvsize,
      76             :                   Complex *convfunc,
      77             :                   const Int *chanmap,
      78             :                   const Int *polmap,
      79             :                   const Int *polused,
      80             :                   const Int *ant1, 
      81             :                   const Int *ant2, 
      82             :                   const 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(const Double *uvw,
      95             :                   const Double *dphase,
      96             :                   const 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             :                   const Double *scale,
     107             :                   const 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             :                   const Int *support,
     116             :                   Int *convsize,
     117             :                   Int *sampling,
     118             :                   Int *wconvsize,
     119             :                   Complex *convfunc,
     120             :                   const Int *chanmap,
     121             :                   const Int *polmap,
     122             :                   const Int *polused,
     123             :                   const Int *ant1, 
     124             :                   const 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             :                                    VisBuffer2& 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             :     const Double *uvw_p, *dphase_p, *actualOffset_p, *vb_freq_p, *uvScale_p;
     168             :     Complex *visdata_p;
     169             :     Complex *dataPtr_p, *f_convFunc_p;
     170             :     const Int *flags_p, *rowFlags_p, *chanMap_p, *polMap_p, *convSupport_p, *vb_ant1_p, *vb_ant2_p;
     171             :     Int *ConjCFMap_p, *CFMap_p;
     172             :     Float *l_off_p, *m_off_p;
     173             :     Double actualPA;
     174             :     
     175           0 :     Vector<Int> ConjCFMap, CFMap;
     176             :     /*
     177             :       ConjCFMap = CFMap = polMap;
     178             :       CFMap = makeConjPolMap(vb);
     179             :     */
     180             :     Int N;
     181           0 :     actualPA = getVBPA(vb);
     182             : 
     183           0 :     N=polMap.nelements();
     184           0 :     CFMap = polMap; ConjCFMap = polMap;
     185           0 :     for(Int i=0;i<N;i++) CFMap[i] = polMap[N-i-1];
     186             :     
     187           0 :     Array<Complex> rotatedConvFunc;
     188             : //     SynthesisUtils::rotateComplexArray(log_l, convFunc_p, cfs_p.coordSys,
     189             : //                                     rotatedConvFunc,(currentCFPA-actualPA),"CUBIC");
     190             :     // SynthesisUtils::rotateComplexArray(log_l, convFunc_p, cfs_p.coordSys,
     191             :     //                                 rotatedConvFunc,0.0,"LINEAR");
     192           0 :     SynthesisUtils::rotateComplexArray(log_l, *(cfs_p.data), /*convFunc_p,*/ cfs_p.coordSys,
     193           0 :                                        rotatedConvFunc,(currentCFPA-actualPA),"LINEAR");
     194             : 
     195           0 :     ConjCFMap = polMap;
     196           0 :     makeCFPolMap(vb,cfStokes_p,CFMap);
     197           0 :     makeConjPolMap(vb,CFMap,ConjCFMap);
     198             : 
     199             :     
     200           0 :     ConjCFMap_p     = ConjCFMap.getStorage(deleteThem(CONJCFMAP));
     201           0 :     CFMap_p         = CFMap.getStorage(deleteThem(CFMAP));
     202             :     
     203           0 :     uvw_p           = uvw.getStorage(deleteThem(UVW));
     204           0 :     dphase_p        = dphase.getStorage(deleteThem(DPHASE));
     205           0 :     visdata_p       = (Complex *)visdata.getStorage(deleteThem(VISDATA));
     206             :     //  gradVisAzData_p = gradVisAzData.getStorage(deleteThem(GRADVISAZ));
     207             :     //  gradVisElData_p = gradVisElData.getStorage(deleteThem(GRADVISEL));
     208           0 :     flags_p         = flags.getStorage(deleteThem(FLAGS));
     209           0 :     rowFlags_p      = rowFlags.getStorage(deleteThem(ROWFLAGS));
     210           0 :     uvScale_p       = uvScale.getStorage(deleteThem(UVSCALE));
     211           0 :     actualOffset_p  = actualOffset.getStorage(deleteThem(ACTUALOFFSET));
     212           0 :     dataPtr_p       = dataPtr->getStorage(deleteThem(DATAPTR));
     213             :     //vb_freq_p       = vb.frequency().getStorage(deleteThem(VBFREQ));
     214           0 :     vb_freq_p       = vb.getFrequencies(0).getStorage(deleteThem(VBFREQ));
     215           0 :     convSupport_p   = cfs_p.xSupport.getStorage(deleteThem(CONVSUPPORT));
     216             :     //    f_convFunc_p      = convFunc_p.getStorage(deleteThem(CONVFUNC));
     217           0 :     f_convFunc_p      = rotatedConvFunc.getStorage(deleteThem(CONVFUNC));
     218           0 :     chanMap_p       = chanMap.getStorage(deleteThem(CHANMAP));
     219           0 :     polMap_p        = polMap.getStorage(deleteThem(POLMAP));
     220           0 :     vb_ant1_p       = vb.antenna1().getStorage(deleteThem(VBANT1));
     221           0 :     vb_ant2_p       = vb.antenna2().getStorage(deleteThem(VBANT2));
     222           0 :     l_off_p     = l_off.getStorage(deleteThem(RAOFF));
     223           0 :     m_off_p    = m_off.getStorage(deleteThem(DECOFF));
     224             :     
     225             :     //    Int npa=convSupport.shape()(2),actualConvSize;
     226           0 :     Int npa=1,actualConvSize;
     227           0 :     Int paIndex_Fortran = paIndex;
     228           0 :     actualConvSize = cfs_p.data->shape()(0);
     229             :     
     230             :     //    IPosition shp=convSupport.shape();
     231             :     
     232           0 :     dpbwproj(uvw_p,
     233             :              dphase_p,
     234             :              //           vb.modelVisCube().getStorage(del),
     235             :              visdata_p,
     236           0 :              &s.asVector()(0),
     237           0 :              &s.asVector()(1),
     238             :              //    gradVisAzData_p,
     239             :              //    gradVisElData_p,
     240             :              //     &gradS(0),
     241             :              //     &gradS(1),
     242             :              //    &Conj,
     243             :              flags_p,
     244             :              rowFlags_p,
     245           0 :              &s.asVector()(2),
     246             :              &rownr,
     247             :              uvScale_p,
     248             :              actualOffset_p,
     249             :              dataPtr_p,
     250             :              &aNx,
     251             :              &aNy,
     252             :              &npol,
     253             :              &nchan,
     254             :              vb_freq_p,
     255             :              &C::c,
     256             :              convSupport_p,
     257             :              &actualConvSize,
     258             :              &convSampling,
     259             :              &wConvSize,
     260             :              f_convFunc_p,
     261             :              chanMap_p,
     262             :              polMap_p,
     263           0 :              &polInUse_p,
     264             :              vb_ant1_p,
     265             :              vb_ant2_p,
     266             :              &Nant_p,
     267             :              &scanNo,
     268             :              &sigma,
     269             :              l_off_p, m_off_p,
     270             :              &area,
     271             :              &doGrad,
     272             :              &doPointing,
     273             :              &npa,
     274             :              &paIndex_Fortran,
     275             :              CFMap_p,
     276             :              ConjCFMap_p,
     277             :              &currentCFPA
     278             :              ,&actualPA,&cfRefFreq_p
     279             :              );
     280             :     
     281           0 :     ConjCFMap.freeStorage((const Int *&)ConjCFMap_p,deleteThem(CONJCFMAP));
     282           0 :     CFMap.freeStorage((const Int *&)CFMap_p,deleteThem(CFMAP));
     283             :     
     284           0 :     l_off.freeStorage((const Float*&)l_off_p,deleteThem(RAOFF));
     285           0 :     m_off.freeStorage((const Float*&)m_off_p,deleteThem(DECOFF));
     286           0 :     uvw.freeStorage((const Double*&)uvw_p,deleteThem(UVW));
     287           0 :     dphase.freeStorage((const Double*&)dphase_p,deleteThem(DPHASE));
     288           0 :     visdata.putStorage(visdata_p,deleteThem(VISDATA));
     289           0 :     flags.freeStorage((const Int*&) flags_p,deleteThem(FLAGS));
     290           0 :     rowFlags.freeStorage((const Int *&)rowFlags_p,deleteThem(ROWFLAGS));
     291           0 :     actualOffset.freeStorage((const Double*&)actualOffset_p,deleteThem(ACTUALOFFSET));
     292           0 :     dataPtr->freeStorage((const Complex *&)dataPtr_p,deleteThem(DATAPTR));
     293           0 :     uvScale.freeStorage((const Double*&) uvScale_p,deleteThem(UVSCALE));
     294           0 :     vb.getFrequencies(0).freeStorage((const Double*&)vb_freq_p,deleteThem(VBFREQ));
     295           0 :     cfs_p.xSupport.freeStorage((const Int*&)convSupport_p,deleteThem(CONVSUPPORT));
     296             :     //    convFunc_p.freeStorage((const Complex *&)f_convFunc_p,deleteThem(CONVFUNC));
     297           0 :     chanMap.freeStorage((const Int*&)chanMap_p,deleteThem(CHANMAP));
     298           0 :     polMap.freeStorage((const Int*&) polMap_p,deleteThem(POLMAP));
     299           0 :     vb.antenna1().freeStorage((const Int*&) vb_ant1_p,deleteThem(VBANT1));
     300           0 :     vb.antenna2().freeStorage((const Int*&) vb_ant2_p,deleteThem(VBANT2));
     301           0 :   }
     302             :   //
     303             :   //----------------------------------------------------------------------
     304             :   //
     305           0 :   void AWProjectFT::runFortranGetGrad(Matrix<Double>& uvw,Vector<Double>& dphase,
     306             :                                       Cube<Complex>& visdata,
     307             :                                        IPosition& s,
     308             :                                        Cube<Complex>& gradVisAzData,
     309             :                                        Cube<Complex>& gradVisElData,
     310             :                                        //                                    IPosition& gradS,
     311             :                                        Int& Conj,
     312             :                                        Cube<Int>& flags,Vector<Int>& rowFlags,
     313             :                                        Int& rownr,Vector<Double>& actualOffset,
     314             :                                        Array<Complex>* dataPtr,
     315             :                                        Int& aNx, Int& aNy, Int& npol, Int& nchan,
     316             :                                        VisBuffer2& vb,Int& Nant_p, Int& scanNo,
     317             :                                        Double& sigma,
     318             :                                        Array<Float>& l_off,
     319             :                                        Array<Float>& m_off,
     320             :                                        Double area,
     321             :                                        Int& doGrad,
     322             :                                        Int paIndex)
     323             :   {
     324           0 :     LogIO log_l(LogOrigin("AWProjectFT", "runFortranGetGrad"));
     325             :     enum whichGetStorage {RAOFF,DECOFF,UVW,DPHASE,VISDATA,GRADVISAZ,GRADVISEL,
     326             :                           FLAGS,ROWFLAGS,UVSCALE,ACTUALOFFSET,DATAPTR,VBFREQ,
     327             :                           CONVSUPPORT,CONVFUNC,CHANMAP,POLMAP,VBANT1,VBANT2,CONJCFMAP,CFMAP};
     328           0 :     Vector<Bool> deleteThem(21);
     329             :     
     330             :     const Double *uvw_p, *dphase_p, *actualOffset_p, *vb_freq_p, *uvScale_p;
     331             :     Complex *visdata_p;
     332             :     Complex *dataPtr_p, *f_convFunc_p;
     333             :     Complex *gradVisAzData_p, *gradVisElData_p;
     334             :     const Int *flags_p, *rowFlags_p, *chanMap_p, *polMap_p, *convSupport_p, *vb_ant1_p, *vb_ant2_p;
     335             :     Int *ConjCFMap_p, *CFMap_p;
     336             :     Float *l_off_p, *m_off_p;
     337             :     Double actualPA;
     338             : 
     339           0 :     Vector<Int> ConjCFMap, CFMap;
     340           0 :     actualPA = getVBPA(vb);
     341           0 :     ConjCFMap = polMap;
     342           0 :     makeCFPolMap(vb,cfStokes_p,CFMap);
     343           0 :     makeConjPolMap(vb,CFMap,ConjCFMap);
     344             : 
     345           0 :     Array<Complex> rotatedConvFunc;
     346             : //     SynthesisUtils::rotateComplexArray(log_l, convFunc_p, cfs_p.coordSys,
     347             : //                                     rotatedConvFunc,(currentCFPA-actualPA),"LINEAR");
     348           0 :     SynthesisUtils::rotateComplexArray(log_l, *(cfs_p.data) /*convFunc_p*/, cfs_p.coordSys,
     349             :                                        rotatedConvFunc,0.0);
     350             :     // SynthesisUtils::rotateComplexArray(log_l, convFunc_p, cfs_p.coordSys,
     351             :     //                                 rotatedConvFunc,(currentCFPA-actualPA),"LINEAR");
     352             : 
     353           0 :     ConjCFMap_p     = ConjCFMap.getStorage(deleteThem(CONJCFMAP));
     354           0 :     CFMap_p         = CFMap.getStorage(deleteThem(CFMAP));
     355             :     
     356           0 :     uvw_p           = uvw.getStorage(deleteThem(UVW));
     357           0 :     dphase_p        = dphase.getStorage(deleteThem(DPHASE));
     358           0 :     visdata_p       = visdata.getStorage(deleteThem(VISDATA));
     359           0 :     gradVisAzData_p = gradVisAzData.getStorage(deleteThem(GRADVISAZ));
     360           0 :     gradVisElData_p = gradVisElData.getStorage(deleteThem(GRADVISEL));
     361           0 :     flags_p         = flags.getStorage(deleteThem(FLAGS));
     362           0 :     rowFlags_p      = rowFlags.getStorage(deleteThem(ROWFLAGS));
     363           0 :     uvScale_p       = uvScale.getStorage(deleteThem(UVSCALE));
     364           0 :     actualOffset_p  = actualOffset.getStorage(deleteThem(ACTUALOFFSET));
     365           0 :     dataPtr_p       = dataPtr->getStorage(deleteThem(DATAPTR));
     366           0 :     vb_freq_p       = vb.getFrequencies(0).getStorage(deleteThem(VBFREQ));
     367           0 :     convSupport_p   = cfs_p.xSupport.getStorage(deleteThem(CONVSUPPORT));
     368             :     //    f_convFunc_p      = convFunc_p.getStorage(deleteThem(CONVFUNC));
     369           0 :     f_convFunc_p      = rotatedConvFunc.getStorage(deleteThem(CONVFUNC));
     370           0 :     chanMap_p       = chanMap.getStorage(deleteThem(CHANMAP));
     371           0 :     polMap_p        = polMap.getStorage(deleteThem(POLMAP));
     372           0 :     vb_ant1_p       = vb.antenna1().getStorage(deleteThem(VBANT1));
     373           0 :     vb_ant2_p       = vb.antenna2().getStorage(deleteThem(VBANT2));
     374           0 :     l_off_p     = l_off.getStorage(deleteThem(RAOFF));
     375           0 :     m_off_p    = m_off.getStorage(deleteThem(DECOFF));
     376             :     
     377             :     //    Int npa=convSupport.shape()(2),actualConvSize;
     378           0 :     Int npa=1,actualConvSize;
     379           0 :     Int paIndex_Fortran = paIndex;
     380           0 :     actualConvSize = cfs_p.data->shape()(0);
     381             :     
     382             :     //    IPosition shp=convSupport.shape();
     383             : 
     384           0 :     dpbwgrad(uvw_p,
     385             :              dphase_p,
     386             :              //           vb.modelVisCube().getStorage(del),
     387             :              visdata_p,
     388           0 :              &s.asVector()(0),
     389           0 :              &s.asVector()(1),
     390             :              gradVisAzData_p,
     391             :              gradVisElData_p,
     392             :              //     &gradS(0),
     393             :              //     &gradS(1),
     394             :              &Conj,
     395             :              flags_p,
     396             :              rowFlags_p,
     397           0 :              &s.asVector()(2),
     398             :              &rownr,
     399             :              uvScale_p,
     400             :              actualOffset_p,
     401             :              dataPtr_p,
     402             :              &aNx,
     403             :              &aNy,
     404             :              &npol,
     405             :              &nchan,
     406             :              vb_freq_p,
     407             :              &C::c,
     408             :              convSupport_p,
     409             :              &actualConvSize,
     410             :              &convSampling,
     411             :              &wConvSize,
     412             :              f_convFunc_p,
     413             :              chanMap_p,
     414             :              polMap_p,
     415           0 :              &polInUse_p,
     416             :              vb_ant1_p,
     417             :              vb_ant2_p,
     418             :              &Nant_p,
     419             :              &scanNo,
     420             :              &sigma,
     421             :              l_off_p, m_off_p,
     422             :              &area,
     423             :              &doGrad,
     424             :              &doPointing,
     425             :              &npa,
     426             :              &paIndex_Fortran,
     427             :              CFMap_p,
     428             :              ConjCFMap_p,
     429             :              &currentCFPA
     430             :              ,&actualPA,&cfRefFreq_p
     431             :              );
     432             : 
     433           0 :     ConjCFMap.freeStorage((const Int *&)ConjCFMap_p,deleteThem(CONJCFMAP));
     434           0 :     CFMap.freeStorage((const Int *&)CFMap_p,deleteThem(CFMAP));
     435             :     
     436           0 :     l_off.freeStorage((const Float*&)l_off_p,deleteThem(RAOFF));
     437           0 :     m_off.freeStorage((const Float*&)m_off_p,deleteThem(DECOFF));
     438           0 :     uvw.freeStorage((const Double*&)uvw_p,deleteThem(UVW));
     439           0 :     dphase.freeStorage((const Double*&)dphase_p,deleteThem(DPHASE));
     440           0 :     Bool tmp=deleteThem(VISDATA);
     441           0 :     visdata.putStorage(visdata_p,tmp);
     442           0 :     gradVisAzData.putStorage(gradVisAzData_p,deleteThem(GRADVISAZ));
     443           0 :     gradVisElData.putStorage(gradVisElData_p,deleteThem(GRADVISEL));
     444           0 :     flags.freeStorage((const Int*&) flags_p,deleteThem(FLAGS));
     445           0 :     rowFlags.freeStorage((const Int *&)rowFlags_p,deleteThem(ROWFLAGS));
     446           0 :     actualOffset.freeStorage((const Double*&)actualOffset_p,deleteThem(ACTUALOFFSET));
     447           0 :     dataPtr->freeStorage((const Complex *&)dataPtr_p,deleteThem(DATAPTR));
     448           0 :     uvScale.freeStorage((const Double*&) uvScale_p,deleteThem(UVSCALE));
     449           0 :     vb.getFrequencies(0).freeStorage((const Double*&)vb_freq_p,deleteThem(VBFREQ));
     450           0 :     cfs_p.xSupport.freeStorage((const Int*&)convSupport_p,deleteThem(CONVSUPPORT));
     451             :     //    convFunc_p.freeStorage((const Complex *&)f_convFunc_p,deleteThem(CONVFUNC));
     452           0 :     chanMap.freeStorage((const Int*&)chanMap_p,deleteThem(CHANMAP));
     453           0 :     polMap.freeStorage((const Int*&) polMap_p,deleteThem(POLMAP));
     454           0 :     vb.antenna1().freeStorage((const Int*&) vb_ant1_p,deleteThem(VBANT1));
     455           0 :     vb.antenna2().freeStorage((const Int*&) vb_ant2_p,deleteThem(VBANT2));
     456           0 :   }
     457             :   //
     458             :   //----------------------------------------------------------------------
     459             :   //
     460           0 :   void AWProjectFT::runFortranPut(Matrix<Double>& uvw,Vector<Double>& dphase,
     461             :                                    const Complex& visdata,
     462             :                                    IPosition& s,
     463             :                                    //                           Cube<Complex>& gradVisAzData,
     464             :                                    //                           Cube<Complex>& gradVisElData,
     465             :                                    //                           IPosition& gradS,
     466             :                                    Int& Conj,
     467             :                                    Cube<Int>& flags,Vector<Int>& rowFlags,
     468             :                                    const Matrix<Float>& weight,
     469             :                                    Int& rownr,Vector<Double>& actualOffset,
     470             :                                    Array<Complex>& dataPtr,
     471             :                                    Int& aNx, Int& aNy, Int& npol, Int& nchan,
     472             :                                    const VisBuffer2& vb,Int& Nant_p, Int& scanNo,
     473             :                                    Double& sigma,
     474             :                                    Array<Float>& l_off,
     475             :                                    Array<Float>& m_off,
     476             :                                    Matrix<Double>& sumWeight,
     477             :                                    Double& area,
     478             :                                    Int& doGrad,
     479             :                                    Int& doPSF,
     480             :                                    Int paIndex)
     481             :   {
     482           0 :     LogIO log_l(LogOrigin("AWProjectFT", "runFortranPut"));
     483             : 
     484             :     (void)Conj; //To supress the warning
     485             :     enum whichGetStorage {RAOFF,DECOFF,UVW,DPHASE,VISDATA,GRADVISAZ,GRADVISEL,
     486             :                           FLAGS,ROWFLAGS,UVSCALE,ACTUALOFFSET,DATAPTR,VBFREQ,
     487             :                           CONVSUPPORT,CONVFUNC,CHANMAP,POLMAP,VBANT1,VBANT2,WEIGHT,
     488             :                           SUMWEIGHT,CONJCFMAP,CFMAP};
     489           0 :     Vector<Bool> deleteThem(23);
     490             :     
     491             :     const Double *uvw_p, *dphase_p, *actualOffset_p, *vb_freq_p, *uvScale_p;
     492             :     Complex *dataPtr_p, *f_convFunc_p;
     493             :     //  Complex *gradVisAzData_p, *gradVisElData_p;
     494             :     const Int *flags_p, *rowFlags_p, *chanMap_p, *polMap_p, *convSupport_p, *vb_ant1_p, *vb_ant2_p;
     495             :     Int *ConjCFMap_p, *CFMap_p;
     496             :     Float *l_off_p, *m_off_p;
     497             :     Float *weight_p;Double *sumwt_p;
     498             :     Double actualPA;
     499           0 :     const Complex *visdata_p=&visdata;
     500             :     
     501           0 :     Vector<Int> ConjCFMap, CFMap;
     502           0 :     actualPA = getVBPA(vb);
     503           0 :     ConjCFMap = polMap;
     504             : 
     505           0 :     Array<Complex> rotatedConvFunc;
     506             : //    SynthesisUtils::rotateComplexArray(log_l, convFunc_p, cfs_p.coordSys,
     507             : //                                     rotatedConvFunc,(currentCFPA-actualPA),"LINEAR");
     508           0 :     SynthesisUtils::rotateComplexArray(log_l, *(cfs_p.data) /*convFunc_p*/, cfs_p.coordSys,
     509             :                                        rotatedConvFunc,0.0,"LINEAR");
     510             : 
     511             :     /*
     512             :     CFMap = polMap; ConjCFMap = polMap;
     513             :     CFMap = makeConjPolMap(vb);
     514             :     */
     515           0 :     makeCFPolMap(vb,cfStokes_p,CFMap);
     516           0 :     makeConjPolMap(vb,CFMap,ConjCFMap);
     517             : 
     518           0 :     ConjCFMap_p     = ConjCFMap.getStorage(deleteThem(CONJCFMAP));
     519           0 :     CFMap_p         = CFMap.getStorage(deleteThem(CFMAP));
     520             :     
     521           0 :     uvw_p           = uvw.getStorage(deleteThem(UVW));
     522           0 :     dphase_p        = dphase.getStorage(deleteThem(DPHASE));
     523             :     //  visdata_p       = visdata.getStorage(deleteThem(VISDATA));
     524             :     //  gradVisAzData_p = gradVisAzData.getStorage(deleteThem(GRADVISAZ));
     525             :     //  gradVisElData_p = gradVisElData.getStorage(deleteThem(GRADVISEL));
     526           0 :     flags_p         = flags.getStorage(deleteThem(FLAGS));
     527           0 :     rowFlags_p      = rowFlags.getStorage(deleteThem(ROWFLAGS));
     528           0 :     uvScale_p       = uvScale.getStorage(deleteThem(UVSCALE));
     529           0 :     actualOffset_p  = actualOffset.getStorage(deleteThem(ACTUALOFFSET));
     530           0 :     dataPtr_p       = dataPtr.getStorage(deleteThem(DATAPTR));
     531           0 :     vb_freq_p       = (Double *)(vb.getFrequencies(0).getStorage(deleteThem(VBFREQ)));
     532           0 :     convSupport_p   = cfs_p.xSupport.getStorage(deleteThem(CONVSUPPORT));
     533             :     //    f_convFunc_p      = convFunc_p.getStorage(deleteThem(CONVFUNC));
     534           0 :     f_convFunc_p      = rotatedConvFunc.getStorage(deleteThem(CONVFUNC));
     535           0 :     chanMap_p       = chanMap.getStorage(deleteThem(CHANMAP));
     536           0 :     polMap_p        = polMap.getStorage(deleteThem(POLMAP));
     537           0 :     vb_ant1_p       = (Int *)(vb.antenna1().getStorage(deleteThem(VBANT1)));
     538           0 :     vb_ant2_p       = (Int *)(vb.antenna2().getStorage(deleteThem(VBANT2)));
     539           0 :     l_off_p     = l_off.getStorage(deleteThem(RAOFF));
     540           0 :     m_off_p    = m_off.getStorage(deleteThem(DECOFF));
     541           0 :     weight_p        = (Float *)(weight.getStorage(deleteThem(WEIGHT)));
     542           0 :     sumwt_p         = sumWeight.getStorage(deleteThem(SUMWEIGHT));
     543             :     
     544             :     
     545             :     //    Int npa=convSupport.shape()(2),actualConvSize;
     546           0 :     Int npa=1,actualConvSize;
     547           0 :     Int paIndex_Fortran = paIndex; 
     548           0 :     actualConvSize = cfs_p.data->shape()(0);
     549             :     
     550             :     //    IPosition shp=convSupport.shape();
     551             :     
     552           0 :     gpbwproj(uvw_p,
     553             :              dphase_p,
     554             :              //           vb.modelVisCube().getStorage(del),
     555             :              visdata_p,
     556           0 :              &s.asVector()(0),
     557           0 :              &s.asVector()(1),
     558             :              //    gradVisAzData_p,
     559             :              //    gradVisElData_p,
     560             :              //     &gradS(0),
     561             :              //     &gradS(1),
     562             :              //    &Conj,
     563             :              &doPSF,
     564             :              flags_p,
     565             :              rowFlags_p,
     566             :              weight_p,
     567           0 :              &s.asVector()(2),
     568             :              &rownr,
     569             :              uvScale_p,
     570             :              actualOffset_p,
     571             :              dataPtr_p,
     572             :              &aNx,
     573             :              &aNy,
     574             :              &npol,
     575             :              &nchan,
     576             :              vb_freq_p,
     577             :              &C::c,
     578             :              convSupport_p,
     579             :              &actualConvSize,
     580             :              &convSampling,
     581             :              &wConvSize,
     582             :              f_convFunc_p,
     583             :              chanMap_p,
     584             :              polMap_p,
     585           0 :              &polInUse_p,
     586             :              sumwt_p,
     587             :              vb_ant1_p,
     588             :              vb_ant2_p,
     589             :              &Nant_p,
     590             :              &scanNo,
     591             :              &sigma,
     592             :              l_off_p, m_off_p,
     593             :              &area,
     594             :              &doGrad,
     595             :              &doPointing,
     596             :              &npa,
     597             :              &paIndex_Fortran,
     598             :              CFMap_p,
     599             :              ConjCFMap_p,
     600             :              &currentCFPA
     601             :              ,&actualPA,&cfRefFreq_p
     602             :              );
     603             :     
     604           0 :     ConjCFMap.freeStorage((const Int *&)ConjCFMap_p,deleteThem(CONJCFMAP));
     605           0 :     CFMap.freeStorage((const Int *&)CFMap_p,deleteThem(CFMAP));
     606             :     
     607           0 :     l_off.freeStorage((const Float*&)l_off_p,deleteThem(RAOFF));
     608           0 :     m_off.freeStorage((const Float*&)m_off_p,deleteThem(DECOFF));
     609           0 :     uvw.freeStorage((const Double*&)uvw_p,deleteThem(UVW));
     610           0 :     dphase.freeStorage((const Double*&)dphase_p,deleteThem(DPHASE));
     611             :     //  visdata.putStorage(visdata_p,deleteThem(VISDATA));
     612             :     //  gradVisAzData.putStorage(gradVisAzData_p,deleteThem(GRADVISAZ));
     613             :     //  gradVisElData.putStorage(gradVisElData_p,deleteThem(GRADVISEL));
     614           0 :     flags.freeStorage((const Int*&) flags_p,deleteThem(FLAGS));
     615           0 :     rowFlags.freeStorage((const Int *&)rowFlags_p,deleteThem(ROWFLAGS));
     616           0 :     actualOffset.freeStorage((const Double*&)actualOffset_p,deleteThem(ACTUALOFFSET));
     617           0 :     dataPtr.freeStorage((const Complex *&)dataPtr_p,deleteThem(DATAPTR));
     618           0 :     uvScale.freeStorage((const Double*&) uvScale_p,deleteThem(UVSCALE));
     619           0 :     vb.getFrequencies(0).freeStorage((const Double*&)vb_freq_p,deleteThem(VBFREQ));
     620           0 :     cfs_p.xSupport.freeStorage((const Int*&)convSupport_p,deleteThem(CONVSUPPORT));
     621             :     //    convFunc_p.freeStorage((const Complex *&)f_convFunc_p,deleteThem(CONVFUNC));
     622           0 :     chanMap.freeStorage((const Int*&)chanMap_p,deleteThem(CHANMAP));
     623           0 :     polMap.freeStorage((const Int*&) polMap_p,deleteThem(POLMAP));
     624           0 :     vb.antenna1().freeStorage((const Int*&) vb_ant1_p,deleteThem(VBANT1));
     625           0 :     vb.antenna2().freeStorage((const Int*&) vb_ant2_p,deleteThem(VBANT2));
     626           0 :     weight.freeStorage((const Float*&)weight_p,deleteThem(WEIGHT));
     627           0 :     sumWeight.putStorage(sumwt_p,deleteThem(SUMWEIGHT));
     628           0 :   }

Generated by: LCOV version 1.16