LCOV - code coverage report
Current view: top level - msvis/MSVis - ViColumns2.cc (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 77 77 100.0 %
Date: 2024-11-06 17:42:47 Functions: 3 3 100.0 %

          Line data    Source code
       1             : #include <msvis/MSVis/ViColumns2.h>
       2             : #include <casacore/ms/MeasurementSets.h>
       3             : 
       4             : using namespace casacore;
       5             : namespace casa {
       6             : 
       7             : namespace vi {
       8             : 
       9        5531 : ViColumns2::ViColumns2 ()
      10        5531 : : antenna1_p (),
      11        5531 :   antenna2_p (),
      12        5531 :   array_p (),
      13        5531 :   corrVis_p (),
      14        5531 :   dataDescription_p (),
      15        5531 :   exposure_p (),
      16        5531 :   feed1_p (),
      17        5531 :   feed2_p (),
      18        5531 :   field_p (),
      19        5531 :   flagCategory_p (),
      20        5531 :   flagRow_p (),
      21        5531 :   flag_p (),
      22        5531 :   floatVis_p (),
      23        5531 :   modelVis_p (),
      24        5531 :   observation_p (),
      25        5531 :   processor_p (),
      26        5531 :   scan_p (),
      27        5531 :   sigma_p (),
      28        5531 :   state_p (),
      29        5531 :   timeCentroid_p (),
      30        5531 :   timeInterval_p (),
      31        5531 :   time_p (),
      32        5531 :   uvw_p (),
      33        5531 :   vis_p (),
      34        5531 :   weightSpectrum_p (),
      35        5531 :   sigmaSpectrum_p (),
      36        5531 :   weight_p (),
      37        5531 :   floatDataFound_p (false)
      38        5531 : {}
      39             : 
      40             : 
      41             : void
      42     3622694 : ViColumns2::attachColumns (const Table & t, bool attachSpecialColumns)
      43             : {
      44     3622694 :     const ColumnDescSet & cds = t.tableDesc ().columnDescSet ();
      45             : 
      46     3622694 :     antenna1_p.attach (t, MS::columnName (MS::ANTENNA1));
      47     3622694 :     antenna2_p.attach (t, MS::columnName (MS::ANTENNA2));
      48             : 
      49     3622694 :     corrVis_p = ArrayColumn<Complex>();
      50     3622694 :     if (cds.isDefined ("CORRECTED_DATA")) {
      51     2262441 :         corrVis_p.attach (t, "CORRECTED_DATA");
      52             :     }
      53             : 
      54     3622694 :     exposure_p.attach (t, MS::columnName (MS::EXPOSURE));
      55     3622694 :     feed1_p.attach (t, MS::columnName (MS::FEED1));
      56     3622694 :     feed2_p.attach (t, MS::columnName (MS::FEED2));
      57     3622694 :     flag_p.attach (t, MS::columnName (MS::FLAG));
      58     3622694 :     flagCategory_p.attach (t, MS::columnName (MS::FLAG_CATEGORY));
      59     3622694 :     flagRow_p.attach (t, MS::columnName (MS::FLAG_ROW));
      60             : 
      61     3622694 :     floatVis_p = ArrayColumn<Float>();
      62     3622694 :     if (cds.isDefined (MS::columnName (MS::FLOAT_DATA))) {
      63      792387 :         floatVis_p.attach (t, MS::columnName (MS::FLOAT_DATA));
      64      792387 :         floatDataFound_p = true;
      65             :     } else {
      66     2830307 :         floatDataFound_p = false;
      67             :     }
      68             : 
      69     3622694 :     modelVis_p = ArrayColumn<Complex>();
      70     3622694 :     if (cds.isDefined ("MODEL_DATA")) {
      71     2053608 :         modelVis_p.attach (t, "MODEL_DATA");
      72             :     }
      73             : 
      74     3622694 :     observation_p.attach (t, MS::columnName (MS::OBSERVATION_ID));
      75     3622694 :     processor_p.attach (t, MS::columnName (MS::PROCESSOR_ID));
      76     3622694 :     scan_p.attach (t, MS::columnName (MS::SCAN_NUMBER));
      77     3622694 :     sigma_p.attach (t, MS::columnName (MS::SIGMA));
      78     3622694 :     state_p.attach (t, MS::columnName (MS::STATE_ID));
      79     3622694 :     time_p.attach (t, MS::columnName (MS::TIME));
      80     3622694 :     timeCentroid_p.attach (t, MS::columnName (MS::TIME_CENTROID));
      81     3622694 :     timeInterval_p.attach (t, MS::columnName (MS::INTERVAL));
      82     3622694 :     uvw_p.attach (t, MS::columnName (MS::UVW));
      83             : 
      84     3622694 :     vis_p = ArrayColumn<Complex>();
      85     3622694 :     if (cds.isDefined (MS::columnName (MS::DATA))) {
      86     2830307 :         vis_p.attach (t, MS::columnName (MS::DATA));
      87             :     }
      88             : 
      89     3622694 :     weight_p.attach (t, MS::columnName (MS::WEIGHT));
      90             : 
      91     3622694 :     weightSpectrum_p = ArrayColumn<Float>();
      92     3622694 :     if (cds.isDefined (MS::columnName (MS::WEIGHT_SPECTRUM))) {
      93     1856734 :         weightSpectrum_p.attach (t, MS::columnName (MS::WEIGHT_SPECTRUM));
      94             :     }
      95             : 
      96     3622694 :     sigmaSpectrum_p = ArrayColumn<Float>();
      97     3622694 :     if (cds.isDefined (MS::columnName (MS::SIGMA_SPECTRUM))) {
      98      137243 :         sigmaSpectrum_p.attach (t, MS::columnName (MS::SIGMA_SPECTRUM));
      99             :     }
     100             : 
     101     3622694 :     if (attachSpecialColumns){
     102             : 
     103     3622694 :         array_p.attach (t, MS::columnName (MS::ARRAY_ID));
     104             : 
     105     3622694 :         dataDescription_p.attach (t, MS::columnName (MS::DATA_DESC_ID));
     106             : 
     107     3622694 :         field_p.attach (t, MS::columnName (MS::FIELD_ID));
     108             :     }
     109     3622694 : }
     110             : 
     111             : Bool
     112     3622694 : ViColumns2::isFloatDataPresent () const
     113             : {
     114     3622694 :     return floatDataFound_p;
     115             : }
     116             : 
     117             : } // end namespace vi
     118             : 
     119             : using namespace casacore;
     120             : } // end namespace casa

Generated by: LCOV version 1.16