LCOV - code coverage report
Current view: top level - air_casawvr/casawvr - msantdata.cc (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 0 23 0.0 %
Date: 2024-10-12 00:35:29 Functions: 0 2 0.0 %

          Line data    Source code
       1             : /**
       2             :    Bojan Nikolic <b.nikolic@mrao.cam.ac.uk>, <bojan@bnikolic.co.uk>
       3             :    Initial version September 2010. 
       4             :    Maintained by ESO since 2013.
       5             : 
       6             :    This file is part of LibAIR and is licensed under GNU Public
       7             :    License Version 2
       8             :    
       9             :    \file msantdata.cpp
      10             :    Renamed to msantdata.cc 2023
      11             : 
      12             : */
      13             : 
      14             : #include "msantdata.h"
      15             : #include <casacore/ms/MeasurementSets/MeasurementSet.h>
      16             : #include <casacore/ms/MeasurementSets/MSAntenna.h>
      17             : #include <casacore/ms/MeasurementSets/MSColumns.h>
      18             : 
      19             : namespace LibAIR2 {
      20             : 
      21           0 :   void getAntPos(const casacore::MeasurementSet &ms,
      22             :                  antpos_t &res)
      23             :   {
      24           0 :     const casacore::MSAntenna & antTable(ms.antenna());
      25           0 :     const size_t nant=antTable.nrow();
      26           0 :     res.resize(nant, 3);
      27           0 :     casacore::MSAntennaColumns acols(antTable);
      28           0 :     const casacore::ArrayColumn<casacore::Double> &pos (acols.position());
      29           0 :     for(size_t i=0; i<nant; ++i)
      30             :     {
      31           0 :       casacore::Array<casacore::Double> a;
      32           0 :       pos.get(i, a,
      33             :               casacore::True);
      34           0 :       for(size_t j=0; j<3; ++j)
      35           0 :         res(i,j)=a(casacore::IPosition(1,j));
      36           0 :     }
      37           0 :   }
      38             : 
      39           0 :   aname_t getAName(const casacore::MeasurementSet &ms)
      40             :   {
      41           0 :     aname_t res;
      42           0 :     const casacore::MSAntenna & antTable(ms.antenna());
      43           0 :     const size_t nant=antTable.nrow();
      44             : 
      45           0 :     casacore::MSAntennaColumns acols(antTable);
      46           0 :     const casacore::ScalarColumn<casacore::String> &names (acols.name());
      47           0 :     for(size_t i=0; i<nant; ++i)
      48             :     {
      49           0 :       res.insert(aname_t::value_type(i, std::string(names(i))));
      50             :     }
      51           0 :     return res;
      52           0 :   }
      53             : 
      54             : }
      55             : 
      56             : 

Generated by: LCOV version 1.16