LCOV - code coverage report
Current view: top level - singledishfiller/Filler - AntennaRecord.h (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 0 25 0.0 %
Date: 2024-10-10 11:40:37 Functions: 0 3 0.0 %

          Line data    Source code
       1             : /*
       2             :  * AntennaRecord.h
       3             :  *
       4             :  *  Created on: Jan 27, 2016
       5             :  *      Author: nakazato
       6             :  */
       7             : 
       8             : #ifndef SINGLEDISH_FILLER_ANTENNARECORD_H_
       9             : #define SINGLEDISH_FILLER_ANTENNARECORD_H_
      10             : 
      11             : #include <casacore/casa/BasicSL/String.h>
      12             : #include <casacore/measures/Measures/MPosition.h>
      13             : #include <casacore/ms/MeasurementSets/MSAntenna.h>
      14             : #include <casacore/ms/MeasurementSets/MSAntennaColumns.h>
      15             : 
      16             : namespace casa { //# NAMESPACE CASA - BEGIN
      17             : namespace sdfiller { //# NAMESPACE SDFILLER - BEGIN
      18             : 
      19             : struct AntennaRecord {
      20             :   typedef casacore::MSAntenna AssociatingTable;
      21             :   typedef casacore::MSAntennaColumns AssociatingColumns;
      22             : 
      23             :   // mandatory
      24             :   casacore::String name;
      25             :   casacore::MPosition position;
      26             :   casacore::String type;
      27             :   casacore::String mount;
      28             :   casacore::Double dish_diameter;
      29             : 
      30             :   // optional
      31             :   casacore::String station;
      32             :   casacore::MPosition offset;
      33             : 
      34             :   // method
      35           0 :   void clear() {
      36           0 :     name = "";
      37           0 :     position = casacore::MPosition();
      38           0 :     type = "";
      39           0 :     mount = "";
      40           0 :     dish_diameter = -1.0;
      41           0 :     station = "";
      42           0 :     offset = casacore::MPosition();
      43           0 :   }
      44             : 
      45             :   AntennaRecord &operator=(AntennaRecord const &other) {
      46             :     name = other.name;
      47             :     position = other.position;
      48             :     type = other.type;
      49             :     mount = other.mount;
      50             :     dish_diameter = other.dish_diameter;
      51             :     station = other.station;
      52             :     offset = other.offset;
      53             :     return *this;
      54             :   }
      55             : 
      56           0 :   void add(AssociatingTable &table, AssociatingColumns &/*columns*/) {
      57           0 :     table.addRow(1, true);
      58           0 :   }
      59             : 
      60           0 :   casacore::Bool fill(casacore::uInt irow, AssociatingColumns &columns) {
      61           0 :     if (columns.nrow() <= irow) {
      62           0 :       return false;
      63             :     }
      64             : 
      65           0 :     columns.name().put(irow, name);
      66           0 :     columns.positionMeas().put(irow, position);
      67           0 :     columns.type().put(irow, type);
      68           0 :     columns.mount().put(irow, mount);
      69           0 :     columns.dishDiameter().put(irow, dish_diameter);
      70           0 :     if (station.size() > 0) {
      71           0 :       columns.station().put(irow, station);
      72             :     }
      73           0 :     if (anyNE(offset.getAngle().getValue(), 0.0)) {
      74           0 :       columns.offsetMeas().put(irow, offset);
      75             :     }
      76           0 :     return true;
      77             :   }
      78             : };
      79             : 
      80             : } //# NAMESPACE SDFILLER - END
      81             : } //# NAMESPACE CASA - END
      82             : 
      83             : #endif /* SINGLEDISH_FILLER_ANTENNARECORD_H_ */

Generated by: LCOV version 1.16