LCOV - code coverage report
Current view: top level - synthesis/CalTables - CTMainColumns.h (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 20 34 58.8 %
Date: 2024-10-10 19:51:30 Functions: 22 35 62.9 %

          Line data    Source code
       1             : //# CTMainColumns.h: Calibration table cal_main column access
       2             : //# Copyright (C) 2011 
       3             : //# Associated Universities, Inc. Washington DC, USA.
       4             : //#
       5             : //# This library is free software; you can redistribute it and/or modify it
       6             : //# under the terms of the GNU Library General Public License as published by
       7             : //# the Free Software Foundation; either version 2 of the License, or (at your
       8             : //# option) any later version.
       9             : //#
      10             : //# This library is distributed in the hope that it will be useful, but WITHOUT
      11             : //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
      12             : //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
      13             : //# License for more details.
      14             : //#
      15             : //# You should have received a copy of the GNU Library General Public License
      16             : //# along with this library; if not, write to the Free Software Foundation,
      17             : //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
      18             : //#
      19             : //# Correspondence concerning AIPS++ should be adressed as follows:
      20             : //#        Internet email: casa-feedback@nrao.edu.
      21             : //#        Postal address: AIPS++ Project Office
      22             : //#                        National Radio Astronomy Observatory
      23             : //#                        520 Edgemont Road
      24             : //#                        Charlottesville, VA 22903-2475 USA
      25             : //#
      26             : //#
      27             : //# $Id$
      28             : 
      29             : #ifndef CALIBRATION_NEWCALMAINCOLUMNS_H
      30             : #define CALIBRATION_NEWCALMAINCOLUMNS_H
      31             : 
      32             : #include <casacore/casa/aips.h>
      33             : #include <casacore/measures/Measures/MEpoch.h>
      34             : #include <casacore/measures/Measures/MFrequency.h>
      35             : #include <casacore/measures/Measures/MDirection.h>
      36             : #include <casacore/tables/Tables/TableColumn.h>
      37             : #include <casacore/tables/Tables/ScalarColumn.h>
      38             : #include <casacore/tables/Tables/ArrayColumn.h>
      39             : #include <casacore/measures/TableMeasures/TableMeasColumn.h>
      40             : #include <casacore/measures/TableMeasures/ScalarMeasColumn.h>
      41             : #include <casacore/measures/TableMeasures/ArrayMeasColumn.h>
      42             : #include <casacore/measures/TableMeasures/ScalarQuantColumn.h>
      43             : #include <synthesis/CalTables/NewCalTable.h>
      44             : #include <synthesis/CalTables/CTEnums.h>
      45             : 
      46             : namespace casa { //# NAMESPACE CASA - BEGIN
      47             : 
      48             : class NewCalTable;
      49             : 
      50             : class ROCTMainColumns
      51             : {
      52             :  public:
      53             :   // Construct from a calibration table
      54             :   ROCTMainColumns (const NewCalTable& calTable);
      55             :   
      56             :   // Default destructor
      57         572 :   virtual ~ROCTMainColumns() {};
      58             :   
      59             :   // Read-only column accessors
      60           0 :   const casacore::ScalarColumn<casacore::Double>& time() const {return time_p;};
      61           0 :   const casacore::ROScalarQuantColumn<casacore::Double>& timeQuant() const {return timeQuant_p;};
      62           0 :   const casacore::ROScalarMeasColumn<casacore::MEpoch>& timeMeas() const {return timeMeas_p;};
      63             :   const casacore::ScalarColumn<casacore::Double>& timeEP() const {return timeEP_p;};
      64           0 :   const casacore::ROScalarQuantColumn<casacore::Double>& timeEPQuant() const
      65           0 :   {return timeEPQuant_p;};
      66           0 :   const casacore::ScalarColumn<casacore::Double>& interval() const {return interval_p;};
      67             :   const casacore::ROScalarQuantColumn<casacore::Double>& intervalQuant() const
      68             :   {return intervalQuant_p;};
      69         140 :   const casacore::ScalarColumn<casacore::Int>& antenna1() const {return antenna1_p;};
      70           0 :   const casacore::ScalarColumn<casacore::Int>& antenna2() const {return antenna2_p;};
      71           0 :   const casacore::ScalarColumn<casacore::Int>& fieldId() const {return fieldId_p;};
      72         140 :   const casacore::ScalarColumn<casacore::Int>& spwId() const {return spwId_p;};
      73         120 :   const casacore::ScalarColumn<casacore::Int>& scanNo() const {return scanNo_p;};
      74         240 :   const casacore::ScalarColumn<casacore::Int>& obsId() const {return obsId_p;};
      75           0 :   const casacore::ArrayColumn<casacore::Complex>& cparam() const {return cparam_p;};
      76           0 :   const casacore::ArrayColumn<casacore::Float>& fparam() const {return fparam_p;};
      77           0 :   const casacore::ArrayColumn<casacore::Float>& paramerr() const {return paramerr_p;};
      78         120 :   const casacore::ArrayColumn<casacore::Bool>& flag() const {return flag_p;};
      79           0 :   const casacore::ArrayColumn<casacore::Float>& snr() const {return snr_p;};
      80           0 :   const casacore::ArrayColumn<casacore::Float>& weight() const {return weight_p;};
      81             : 
      82             :   // Some additional methods to extract cparam into casacore::Array<casacore::Float>
      83             :   //   what can be: "","AP"
      84             :   casacore::Array<casacore::Float> fparamArray(casacore::String what="",const casacore::Vector<casacore::uInt>& rows=casacore::Vector<casacore::uInt>());
      85             :   void fparamArray(casacore::Array<casacore::Float>& arr,casacore::String what="",const casacore::Vector<casacore::uInt>& rows=casacore::Vector<casacore::uInt>());
      86             : 
      87             :   // Some additional methods to extract phase-like info
      88             :   casacore::Array<casacore::Float> phase();
      89             :   void phase(casacore::Array<casacore::Float>& ph);
      90             :   casacore::Array<casacore::Float> cycles();
      91             :   void cycles(casacore::Array<casacore::Float>& cy);
      92             :   
      93             :  protected:
      94             :   // Prohibit public use of the null constructor, which
      95             :   // does not produce a usable object.
      96             :   ROCTMainColumns() {};
      97             :   
      98             :   // Return a CalTable as a casacore::Table reference. Utilizes friendship
      99             :   // relationship with class CalTable.
     100             :   //const casacore::Table& asTable(const CalTable2& calTable) 
     101             :   //{return calTable.calMainAsTable();}
     102             :   
     103             :   // Attach a table column accessor
     104             :   void attach (const NewCalTable& calTable, casacore::TableColumn& tabCol, 
     105             :                CTEnums::colDef colEnum, const casacore::Bool& optional = false);
     106             :   void attach (const NewCalTable& calTable, 
     107             :                casacore::ROArrayMeasColumn<casacore::MEpoch>& tabCol,
     108             :                CTEnums::colDef colEnum, const casacore::Bool& optional = false);
     109             :   void attach (const NewCalTable& calTable, 
     110             :                casacore::ROArrayMeasColumn<casacore::MFrequency>& tabCol,
     111             :                CTEnums::colDef colEnum, const casacore::Bool& optional = false);
     112             :   void attach (const NewCalTable& calTable, 
     113             :                casacore::ROArrayMeasColumn<casacore::MDirection>& tabCol,
     114             :                CTEnums::colDef colEnum, const casacore::Bool& optional = false);
     115             :   void attach (const NewCalTable& calTable, casacore::ROScalarMeasColumn<casacore::MEpoch>& tabCol,
     116             :                CTEnums::colDef colEnum, const casacore::Bool& optional = false);
     117             :   void attach (const NewCalTable& calTable, casacore::ROScalarQuantColumn<casacore::Double>& tabCol,
     118             :                CTEnums::colDef colEnum, const casacore::Bool& optional = false);
     119             :   
     120             :  private:
     121             :   // Prohibit copy constructor and assignment operator 
     122             :   ROCTMainColumns (const ROCTMainColumns&);
     123             :   ROCTMainColumns& operator= (const ROCTMainColumns&);
     124             :   
     125             :   // Private column accessors
     126             :   casacore::ScalarColumn<casacore::Double> time_p;
     127             :   casacore::ROScalarQuantColumn<casacore::Double> timeQuant_p;
     128             :   casacore::ROScalarMeasColumn<casacore::MEpoch> timeMeas_p;
     129             :   casacore::ScalarColumn<casacore::Double> timeEP_p;
     130             :   casacore::ROScalarQuantColumn<casacore::Double> timeEPQuant_p;
     131             :   casacore::ScalarColumn<casacore::Double> interval_p;
     132             :   casacore::ROScalarQuantColumn<casacore::Double> intervalQuant_p;
     133             :   casacore::ScalarColumn<casacore::Int> antenna1_p;
     134             :   casacore::ScalarColumn<casacore::Int> antenna2_p;
     135             :   casacore::ScalarColumn<casacore::Int> fieldId_p;
     136             :   casacore::ScalarColumn<casacore::Int> spwId_p;
     137             :   casacore::ScalarColumn<casacore::Int> scanNo_p;
     138             :   casacore::ScalarColumn<casacore::Int> obsId_p;
     139             :   casacore::ArrayColumn<casacore::Complex> cparam_p;
     140             :   casacore::ArrayColumn<casacore::Float> fparam_p;
     141             :   casacore::ArrayColumn<casacore::Float> paramerr_p;
     142             :   casacore::ArrayColumn<casacore::Bool> flag_p;
     143             :   casacore::ArrayColumn<casacore::Float> snr_p;
     144             :   casacore::ArrayColumn<casacore::Float> weight_p;
     145             : };
     146             : 
     147             : class CTMainColumns
     148             : {
     149             :   public:
     150             :     // Construct from a calibration table
     151             :     CTMainColumns (NewCalTable& calTable);
     152             :     
     153             :     // Default destructor
     154         626 :     virtual ~CTMainColumns() {};
     155             :     
     156             :     // Read-write column accessors
     157          78 :     casacore::ScalarColumn<casacore::Double>& time() {return time_p;};
     158             :     casacore::ScalarQuantColumn<casacore::Double>& timeQuant() {return timeQuant_p;};
     159             :     casacore::ScalarMeasColumn<casacore::MEpoch>& timeMeas() {return timeMeas_p;};
     160             :     casacore::ScalarColumn<casacore::Double>& timeEP() {return timeEP_p;};
     161             :     casacore::ScalarQuantColumn<casacore::Double>& timeEPQuant() {return timeEPQuant_p;};
     162          78 :     casacore::ScalarColumn<casacore::Double>& interval() {return interval_p;};
     163             :     casacore::ScalarQuantColumn<casacore::Double>& intervalQuant() {return intervalQuant_p;};
     164          78 :     casacore::ScalarColumn<casacore::Int>& fieldId() {return fieldId_p;};
     165         218 :     casacore::ScalarColumn<casacore::Int>& spwId() {return spwId_p;};
     166         218 :     casacore::ScalarColumn<casacore::Int>& antenna1() {return antenna1_p;};
     167          78 :     casacore::ScalarColumn<casacore::Int>& antenna2() {return antenna2_p;};
     168          78 :     casacore::ScalarColumn<casacore::Int>& scanNo() {return scanNo_p;};
     169         198 :     casacore::ScalarColumn<casacore::Int>& obsId() {return obsId_p;};
     170          78 :     casacore::ArrayColumn<casacore::Complex>& cparam() {return cparam_p;};
     171           0 :     casacore::ArrayColumn<casacore::Float>& fparam() {return fparam_p;};
     172          78 :     casacore::ArrayColumn<casacore::Float>& paramerr() {return paramerr_p;};
     173         210 :     casacore::ArrayColumn<casacore::Bool>& flag() {return flag_p;};
     174          78 :     casacore::ArrayColumn<casacore::Float>& snr() {return snr_p;};
     175          78 :     casacore::ArrayColumn<casacore::Float>& weight() {return weight_p;};
     176             :     
     177             :   protected:
     178             :     // Prohibit public use of the null constructor, which
     179             :     // does not produce a usable object.
     180             :     CTMainColumns() {};
     181             :     
     182             :     // Return a CalTable as a casacore::Table reference. Utilizes friendship
     183             :     // relationship with class CalTable.
     184             :     //casacore::Table& asTable(CalTable2& calTable) {return calTable.calMainAsTable();}
     185             :     
     186             :     // Attach a table column accessor
     187             :     void attach (NewCalTable& calTable, casacore::TableColumn& tabCol, 
     188             :                  CTEnums::colDef colEnum, const casacore::Bool& optional = false);
     189             :     void attach (NewCalTable& calTable, casacore::ArrayMeasColumn<casacore::MEpoch>& tabCol, 
     190             :                  CTEnums::colDef colEnum, const casacore::Bool& optional = false);
     191             :     void attach (NewCalTable& calTable, casacore::ArrayMeasColumn<casacore::MFrequency>& tabCol, 
     192             :                  CTEnums::colDef colEnum, const casacore::Bool& optional = false);
     193             :     void attach (NewCalTable& calTable, casacore::ArrayMeasColumn<casacore::MDirection>& tabCol, 
     194             :                  CTEnums::colDef colEnum, const casacore::Bool& optional = false);
     195             :     void attach (NewCalTable& calTable, casacore::ScalarMeasColumn<casacore::MEpoch>& tabCol, 
     196             :                  CTEnums::colDef colEnum, const casacore::Bool& optional = false);
     197             :     void attach (NewCalTable& calTable, casacore::ScalarQuantColumn<casacore::Double>& tabCol, 
     198             :                  CTEnums::colDef colEnum, const casacore::Bool& optional = false);
     199             :     
     200             :   private:
     201             :     // Prohibit copy constructor and assignment operator 
     202             :     CTMainColumns (const CTMainColumns&);
     203             :     CTMainColumns& operator= (const CTMainColumns&);
     204             :     
     205             :     // Private column accessors
     206             :     casacore::ScalarColumn<casacore::Double> time_p;
     207             :     casacore::ScalarQuantColumn<casacore::Double> timeQuant_p;
     208             :     casacore::ScalarMeasColumn<casacore::MEpoch> timeMeas_p;
     209             :     casacore::ScalarColumn<casacore::Double> timeEP_p;
     210             :     casacore::ScalarQuantColumn<casacore::Double> timeEPQuant_p;
     211             :     casacore::ScalarColumn<casacore::Double> interval_p;
     212             :     casacore::ScalarQuantColumn<casacore::Double> intervalQuant_p;
     213             :     casacore::ScalarColumn<casacore::Int> fieldId_p;
     214             :     casacore::ScalarColumn<casacore::Int> spwId_p;
     215             :     casacore::ScalarColumn<casacore::Int> antenna1_p;
     216             :     casacore::ScalarColumn<casacore::Int> antenna2_p;
     217             :     casacore::ScalarColumn<casacore::Int> scanNo_p;
     218             :     casacore::ScalarColumn<casacore::Int> obsId_p;
     219             :     casacore::ArrayColumn<casacore::Complex> cparam_p;
     220             :     casacore::ArrayColumn<casacore::Float> fparam_p;
     221             :     casacore::ArrayColumn<casacore::Float> paramerr_p;
     222             :     casacore::ArrayColumn<casacore::Bool> flag_p;
     223             :     casacore::ArrayColumn<casacore::Float> snr_p;
     224             :     casacore::ArrayColumn<casacore::Float> weight_p;
     225             :   };
     226             : } //# NAMESPACE CASA - END
     227             : #endif

Generated by: LCOV version 1.16