Changeset 884


Ignore:
Timestamp:
03/08/06 12:01:46 (18 years ago)
Author:
mar637
Message:

added setSpectrum

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Scantable.cpp

    r878 r884  
    581581  return out;
    582582}
     583
     584
     585void asap::Scantable::setSpectrum( const std::vector<float>& spec,
     586                                   int whichrow )
     587{
     588  Vector<Float> spectrum(spec);
     589  Vector<Float> arr;
     590  specCol_.get(whichrow, arr);
     591  if ( spectrum.nelements() != arr.nelements() )
     592    throw AipsError("The specturm has incorrect number of channels.");
     593  specCol_.put(whichrow, spectrum);
     594}
     595
    583596
    584597String Scantable::generateName()
     
    739752  std::vector<double> stlout;
    740753  int nchan = specCol_(whichrow).nelements();
    741   cout << nchan << endl;
    742754  String us = freqTable_.getUnitString();
    743755  if ( us == "" || us == "pixel" || us == "channel" ) {
  • trunk/src/Scantable.h

    r865 r884  
    248248  std::vector<float> getSpectrum(int whichrow) const;
    249249
     250  void setSpectrum(const std::vector<float>& spec, int whichrow);
     251
    250252  std::vector<float> getStokesSpectrum( int whichrow=0,
    251253                                        bool dopol=false) const;
  • trunk/src/ScantableWrapper.h

    r868 r884  
    121121
    122122
    123 //   void setSpectrum(std::vector<float> spectrum, int whichrow=0)
    124 //     { table_->setSpectrum(spectrum, whichrow); }
     123  void setSpectrum(std::vector<float> spectrum, int whichrow=0)
     124    { table_->setSpectrum(spectrum, whichrow); }
    125125
    126126  int getIF(int whichrow) const {return table_->getIF(whichrow);}
  • trunk/src/python_Scantable.cpp

    r872 r884  
    6363    .def("_setInstrument", &ScantableWrapper::setInstrument)
    6464    .def("_getspectrum", &ScantableWrapper::getSpectrum,
    65          (boost::python::arg("whichRow")=0))
     65         (boost::python::arg("whichrow")=0))
    6666    /*
    6767    .def("nstokes", &ScantableWrapper::nStokes)
    6868    .def("_getstokesspectrum", &ScantableWrapper::getStokesSpectrum,
    69          (boost::python::arg("whichRow")=0),
     69         (boost::python::arg("whichrow")=0),
    7070         (boost::python::arg("linpol")=false) )
    7171    .def("_stokestopolspectrum", &ScantableWrapper::stokesToPolSpectrum,
    72          (boost::python::arg("whichRow")=0),
     72         (boost::python::arg("whichrow")=0),
    7373         (boost::python::arg("linear")=false),
    7474         (boost::python::arg("thepol")=-1) )
     
    7979         (boost::python::arg("linpol")=false) )
    8080//         (boost::python::arg("thepol")=0) )        // Boost fails with 4 arguments
    81 /*    .def("_setspectrum",&ScantableWrapper::setSpectrum,
    82          (boost::python::arg("whichRow")=0) )*/
     81   .def("_setspectrum",&ScantableWrapper::setSpectrum,
     82         (boost::python::arg("whichrow")=0) )
    8383    .def("_getabcissa", &ScantableWrapper::getAbcissa,
    84          (boost::python::arg("whichRow")=0) )
     84         (boost::python::arg("whichrow")=0) )
    8585    .def("_getabcissalabel", &ScantableWrapper::getAbcissaLabel,
    86          (boost::python::arg("whichRow")=0) )
     86         (boost::python::arg("whichrow")=0) )
    8787    .def("_getmask", &ScantableWrapper::getMask,
    88          (boost::python::arg("whichRow")=0) )
     88         (boost::python::arg("whichrow")=0) )
    8989    .def("_gettsys", &ScantableWrapper::getTsys)
    9090    .def("_getsourcename", &ScantableWrapper::getSourceName,
    91          (boost::python::arg("whichRow")=0) )
     91         (boost::python::arg("whichrow")=0) )
    9292    .def("_getelevation", &ScantableWrapper::getElevation,
    93          (boost::python::arg("whichRow")=0) )
     93         (boost::python::arg("whichrow")=0) )
    9494    .def("_getazimuth", &ScantableWrapper::getAzimuth,
    95          (boost::python::arg("whichRow")=0) )
     95         (boost::python::arg("whichrow")=0) )
    9696    .def("_getparangle", &ScantableWrapper::getParAngle,
    97          (boost::python::arg("whichRow")=0) )
     97         (boost::python::arg("whichrow")=0) )
    9898    .def("_gettime", &ScantableWrapper::getTime,
    99          (boost::python::arg("whichRow")=0) )
     99         (boost::python::arg("whichrow")=0) )
    100100    .def("_flag", &ScantableWrapper::flag)
    101101    .def("_save",  &ScantableWrapper::makePersistent)
Note: See TracChangeset for help on using the changeset viewer.