Changeset 2791 for trunk/src


Ignore:
Timestamp:
03/15/13 14:36:12 (11 years ago)
Author:
Malte Marquarding
Message:

Ticket #289: added anility to set Tsys, both for scalar and vector values

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Scantable.cpp

    r2789 r2791  
    55//
    66//
    7 // Author: Malte Marquarding <asap@atnf.csiro.au>, (C) 2005
     7// Author: Malte Marquarding <asap@atnf.csiro.au>, (C) 2005-2013
    88//
    99// Copyright: See COPYING file that comes with this distribution
     
    51685168}
    51695169
     5170void Scantable::setTsys(const std::vector<float>& newvals, int whichrow) {
     5171  Vector<Float> tsys(newvals);
     5172  if (whichrow > -1) {
     5173    if (tsysCol_.shape(whichrow) != tsys.shape())
     5174      throw(AipsError("Given Tsys values are not of the same shape"));
     5175    tsysCol_.put(whichrow, tsys);
     5176  } else {
     5177    tsysCol_.fillColumn(tsys);
     5178  }
     5179}
     5180
    51705181vector<float> Scantable::getTsysSpectrum( int whichrow ) const
    51715182{
  • trunk/src/Scantable.h

    r2789 r2791  
    342342    { return casa::Vector<casa::Float>(tsysCol_(whichrow))(0); }
    343343  std::vector<float> getTsysSpectrum(int whichrow) const ;
     344 
     345  void setTsys(const std::vector<float>& newvals, int whichrow);
     346
    344347  float getElevation(int whichrow) const
    345348    { return elCol_(whichrow); }
  • trunk/src/ScantableWrapper.h

    r2789 r2791  
    9393    { return table_->getTsysSpectrum(whichrow); }
    9494
     95  void setTsys(const std::vector<float>& newvals, int whichrow=-1)
     96  { return table_->setTsys(newvals, whichrow); }
     97
    9598  //std::string getTime(int whichrow=0) const
    9699  //  { return table_->getTime(whichrow); }
  • trunk/src/python_Scantable.cpp

    r2789 r2791  
    9494    .def("_gettsys", &ScantableWrapper::getTsys)
    9595    .def("_gettsysspectrum", &ScantableWrapper::getTsysSpectrum )
     96    .def("_settsys", &ScantableWrapper::setTsys)
    9697    .def("_getsourcename", &ScantableWrapper::getSourceName,
    9798         (boost::python::arg("whichrow")=0) )
Note: See TracChangeset for help on using the changeset viewer.