Changeset 1068


Ignore:
Timestamp:
07/04/06 11:27:03 (18 years ago)
Author:
mar637
Message:

added Scantable::getDirectionString; added Scantable::setSourceType

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Scantable.cpp

    r1047 r1068  
    256256  timeCol_.attach(table_, "TIME");
    257257  srcnCol_.attach(table_, "SRCNAME");
     258  srctCol_.attach(table_, "SRCTYPE");
    258259  specCol_.attach(table_, "SPECTRA");
    259260  flagsCol_.attach(table_, "FLAGTRA");
     
    321322  table_.keywordSet().get("POLTYPE", sdh.poltype);
    322323  return sdh;
     324}
     325
     326void asap::Scantable::setSourceType( int stype )
     327{
     328  if ( stype < 0 || stype > 1 )
     329    throw(AipsError("Illegal sourcetype."));
     330  TableVector<Int> tabvec(table_, "SRCTYPE");
     331  tabvec = Int(stype);
    323332}
    324333
     
    826835}
    827836
     837std::string Scantable::getDirectionString(int whichrow) const
     838{
     839  return formatDirection(getDirection(uInt(whichrow)));
     840}
     841
    828842std::vector< double > asap::Scantable::getAbcissa( int whichrow ) const
    829843{
  • trunk/src/Scantable.h

    r1030 r1068  
    129129   */
    130130  STHeader getHeader( ) const;
     131
    131132  /**
    132133   * Checks if the "other" Scantable is conformant with this,
     
    138139
    139140  /**
     141   *
     142   * @param stype The type of the source, 0 = on, 1 = off
     143   */
     144  void setSourceType(int stype);
     145
     146
     147  /**
    140148   * return the number of scans in the table
    141149   * @return number of scans in the table
     
    152160
    153161  casa::MDirection getDirection( int whichrow ) const;
     162
     163  std::string getDirectionString( int whichrow ) const;
    154164
    155165  void setDirectionRefString(const std::string& refstr="");
     
    396406  casa::ScalarColumn<casa::String> srcnCol_, fldnCol_;
    397407  casa::ScalarColumn<casa::uInt> scanCol_, beamCol_, ifCol_, polCol_, cycleCol_;
    398   casa::ScalarColumn<casa::Int> rbeamCol_;
     408  casa::ScalarColumn<casa::Int> rbeamCol_, srctCol_;
    399409  casa::ArrayColumn<casa::Float> specCol_, tsysCol_;
    400410  casa::ArrayColumn<casa::uChar> flagsCol_;
  • trunk/src/ScantableWrapper.h

    r1003 r1068  
    8585    { return table_->getTime(whichrow); }
    8686
     87  std::string getDirectionString(int whichrow=0) const
     88    { return table_->getDirectionString(whichrow); }
     89
    8790  std::string getFluxUnit() const { return table_->getFluxUnit(); }
    8891
     
    135138  void makePersistent(const std::string& fname)
    136139    { table_->makePersistent(fname); }
     140
     141  void setSourceType(int stype)
     142    { table_->setSourceType(stype); }
    137143
    138144  void setRestFrequencies(double rf, const std::string& unit)
  • trunk/src/python_Scantable.cpp

    r1003 r1068  
    2727//#                        AUSTRALIA
    2828//#
    29 //# $Id:$
     29//# $Id$
    3030//#---------------------------------------------------------------------------
    3131#include <vector>
     
    9292    .def("_gettime", &ScantableWrapper::getTime,
    9393         (boost::python::arg("whichrow")=0) )
     94    .def("_getdirection", &ScantableWrapper::getDirectionString,
     95         (boost::python::arg("whichrow")=0) )
    9496    .def("_flag", &ScantableWrapper::flag)
    9597    .def("_save",  &ScantableWrapper::makePersistent)
     
    109111    .def("_getfit", &ScantableWrapper::getFit)
    110112    .def("_recalcazel", &ScantableWrapper::calculateAZEL)
     113    .def("_setsourcetype", &ScantableWrapper::setSourceType)
    111114  ;
    112115};
Note: See TracChangeset for help on using the changeset viewer.