Changeset 2791
- Timestamp:
- 03/15/13 14:36:12 (12 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/scantable.py
r2771 r2791 907 907 """ 908 908 return self._get_column( self._gettsysspectrum, row ) 909 910 def set_tsys(self, values, row=-1): 911 """\ 912 Set the Tsys value(s) of the given 'row' or the whole scantable 913 (selection). 914 915 Parameters: 916 917 values: a scalar or list (if Tsys is a vector) of Tsys value(s) 918 row: the row number to apply Tsys values to. 919 (default all rows) 920 921 """ 922 923 if not hasattr(values, "__len__"): 924 values = [values] 925 self._settsys(values, row) 909 926 910 927 def get_weather(self, row=-1): -
trunk/src/Scantable.cpp
r2789 r2791 5 5 // 6 6 // 7 // Author: Malte Marquarding <asap@atnf.csiro.au>, (C) 2005 7 // Author: Malte Marquarding <asap@atnf.csiro.au>, (C) 2005-2013 8 8 // 9 9 // Copyright: See COPYING file that comes with this distribution … … 5168 5168 } 5169 5169 5170 void 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 5170 5181 vector<float> Scantable::getTsysSpectrum( int whichrow ) const 5171 5182 { -
trunk/src/Scantable.h
r2789 r2791 342 342 { return casa::Vector<casa::Float>(tsysCol_(whichrow))(0); } 343 343 std::vector<float> getTsysSpectrum(int whichrow) const ; 344 345 void setTsys(const std::vector<float>& newvals, int whichrow); 346 344 347 float getElevation(int whichrow) const 345 348 { return elCol_(whichrow); } -
trunk/src/ScantableWrapper.h
r2789 r2791 93 93 { return table_->getTsysSpectrum(whichrow); } 94 94 95 void setTsys(const std::vector<float>& newvals, int whichrow=-1) 96 { return table_->setTsys(newvals, whichrow); } 97 95 98 //std::string getTime(int whichrow=0) const 96 99 // { return table_->getTime(whichrow); } -
trunk/src/python_Scantable.cpp
r2789 r2791 94 94 .def("_gettsys", &ScantableWrapper::getTsys) 95 95 .def("_gettsysspectrum", &ScantableWrapper::getTsysSpectrum ) 96 .def("_settsys", &ScantableWrapper::setTsys) 96 97 .def("_getsourcename", &ScantableWrapper::getSourceName, 97 98 (boost::python::arg("whichrow")=0) ) -
trunk/test/test_scantable.py
r2787 r2791 120 120 def test_get_tsys(self): 121 121 assert_almost_equal(self.st.get_tsys()[0], 175.830429077) 122 123 def test_set_tsys(self): 124 s = self.st.copy() 125 newval = 100.0 126 s.set_tsys(newval, 0) 127 assert_almost_equal(s.get_tsys()[0], newval) 128 s2 = self.st.copy() 129 s2.set_tsys(newval) 130 out = s2.get_tsys() 131 for i in xrange(len(out)): 132 assert_almost_equal(out[i], newval) 122 133 123 134 def test_get_time(self):
Note:
See TracChangeset
for help on using the changeset viewer.