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

Generated by: LCOV version 1.16