Changeset 972
- Timestamp:
- 04/03/06 15:07:08 (19 years ago)
- Location:
- trunk/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STFiller.cpp
r942 r972 227 227 TableRow row(table_->table()); 228 228 TableRecord& rec = row.record(); 229 RecordFieldPtr<Int> fitCol(rec, "FIT_ID"); 230 *fitCol = -1; 229 231 RecordFieldPtr<uInt> scanoCol(rec, "SCANNO"); 230 232 *scanoCol = scanNo-1; -
trunk/src/STFit.cpp
r960 r972 84 84 { 85 85 uInt rno = table_.nrow(); 86 uInt resultid ;86 uInt resultid = 0; 87 87 bool foundentry = false; 88 // replace 88 89 if ( id > -1 ) { 89 90 Table t = table_(table_.col("ID") == id ); … … 94 95 } 95 96 } 97 // doesn't exist 96 98 if ( rno > 0 && !foundentry ) { 97 99 idCol_.get(rno-1, resultid); 98 100 resultid++; 99 101 } 100 if ( !foundentry )table_.addRow(); 101 102 // add new row if new id 103 if ( !foundentry ) table_.addRow(); 104 cout << rno << " " << resultid << endl; 102 105 funcCol_.put(rno, mathutil::toVectorString(fit.getFunctions())); 103 106 compCol_.put(rno, Vector<Int>(fit.getComponents())); … … 109 112 } 110 113 111 void STFit::getEntry( STFitEntry& fit, uInt id ) 114 void STFit::getEntry( STFitEntry& fit, uInt id ) const 112 115 { 113 116 Table t = table_(table_.col("ID") == Int(id) ); -
trunk/src/STFit.h
r960 r972 39 39 40 40 casa::uInt addEntry( const STFitEntry& fit, casa::Int id=-1 ); 41 void getEntry( STFitEntry& fit, casa::uInt id ) ;41 void getEntry( STFitEntry& fit, casa::uInt id ) const; 42 42 43 43 const casa::String& name() const { return name_; } … … 46 46 void setup(); 47 47 static const casa::String name_; 48 //casa::Table table_;49 48 casa::ArrayColumn<casa::String> funcCol_; 50 49 casa::ArrayColumn<casa::Int> compCol_; -
trunk/src/STFitEntry.cpp
r955 r972 2 2 // C++ Implementation: STFitEntry 3 3 // 4 // Description: 4 // Description: 5 5 // 6 6 // … … 17 17 { 18 18 } 19 STFitEntry::STFitEntry(const STFitEntry& other) 20 { 21 if ( this != &other ) { 22 this->functions_ = other.functions_; 23 this->components_ = other.components_; 24 this->parameters_ = other.parameters_; 25 this->parmasks_ = other.parmasks_; 26 this->frameinfo_ = other.frameinfo_; 27 } 28 } 19 29 20 30 -
trunk/src/STFitEntry.h
r960 r972 26 26 public: 27 27 STFitEntry(); 28 28 STFitEntry(const STFitEntry& other); 29 29 30 ~STFitEntry(); 30 31 31 32 void setFunctions(const std::vector<std::string>& f) 32 33 { functions_ = f; } -
trunk/src/Scantable.cpp
r959 r972 94 94 originalTable_ = table_; 95 95 attach(); 96 TableVector<Int> v(table_,"FIT_ID");v=666; 97 table_.flush(); 98 Vector<Int> v2 = mfitidCol_.getColumn();cout << v2 << endl; 96 99 } 97 100 … … 153 156 t = table_.rwKeywordSet().asTable("HISTORY"); 154 157 TableCopy::copyRows(t, other.historyTable_.table()); 158 t = table_.rwKeywordSet().asTable("FIT"); 159 TableCopy::copyRows(t, other.fitTable_.table()); 155 160 } 156 161 … … 163 168 moleculeTable_ = STMolecules(table_); 164 169 historyTable_ = STHistory(table_); 170 fitTable_ = STFit(table_); 165 171 } 166 172 … … 183 189 td.addColumn(ScalarColumnDesc<uInt>("BEAMNO")); 184 190 td.addColumn(ScalarColumnDesc<uInt>("IFNO")); 191 // linear, circular, stokes 185 192 td.rwKeywordSet().define("POLTYPE", String("linear")); 186 193 td.addColumn(ScalarColumnDesc<uInt>("POLNO")); … … 188 195 td.addColumn(ScalarColumnDesc<uInt>("FREQ_ID")); 189 196 td.addColumn(ScalarColumnDesc<uInt>("MOLECULE_ID")); 190 // linear, circular, stokes [I Q U V], stokes1 [I Plinear Pangle V]191 197 td.addColumn(ScalarColumnDesc<Int>("REFBEAMNO")); 192 198 … … 223 229 224 230 td.addColumn(ScalarColumnDesc<uInt>("TCAL_ID")); 225 td.addColumn(ScalarColumnDesc<uInt>("FIT_ID")); 231 ScalarColumnDesc<Int> fitColumn("FIT_ID"); 232 fitColumn.setDefault(Int(666)); 233 td.addColumn(fitColumn); 226 234 227 235 td.addColumn(ScalarColumnDesc<uInt>("FOCUS_ID")); … … 234 242 table_ = Table(aNewTab, type_, 0); 235 243 originalTable_ = table_; 236 237 244 } 238 245 … … 259 266 260 267 mfitidCol_.attach(table_,"FIT_ID"); 261 //fitidCol_.attach(fitTable_,"FIT_ID");262 263 268 mfreqidCol_.attach(table_, "FREQ_ID"); 264 265 269 mtcalidCol_.attach(table_, "TCAL_ID"); 266 267 270 mfocusidCol_.attach(table_, "FOCUS_ID"); 268 269 271 mmolidCol_.attach(table_, "MOLECULE_ID"); 270 272 } … … 841 843 Vector<String> wau(1);wau = u.getName(); 842 844 spc.setWorldAxisUnits(wau); 843 844 845 s = CoordinateUtil::axisLabel(spc,0,True,True,False); 845 846 } … … 895 896 { 896 897 return MEpoch::castType(timeCol_.getMeasRef().getType()); 897 } 898 898 } 899 900 void asap::Scantable::addFit( const STFitEntry & fit, int row ) 901 { 902 cout << mfitidCol_(uInt(row)) << endl; 903 uInt id = fitTable_.addEntry(fit, mfitidCol_(uInt(row))); 904 mfitidCol_.put(uInt(row), id); 905 } 899 906 900 907 } //namespace asap -
trunk/src/Scantable.h
r960 r972 41 41 #include "STPol.h" 42 42 #include "STFit.h" 43 #include "STFitEntry.h" 43 44 44 45 namespace asap { … … 306 307 STMolecules& molecules() { return moleculeTable_; } 307 308 STHistory& history() { return historyTable_; } 309 STFit& fit() { return fitTable_; } 308 310 309 311 std::vector<std::string> columnNames() const; 312 313 void addFit(const STFitEntry& fit, int row); 314 STFitEntry getFit(int row) const 315 { STFitEntry fe; fitTable_.getEntry(fe, mfitidCol_(row)); return fe; } 310 316 311 317 private: … … 393 399 394 400 casa::ArrayColumn<casa::String> histitemCol_; 395 casa::ScalarColumn<casa::uInt> mfitidCol_; 396 // id in weather table and main table 401 casa::ScalarColumn<casa::Int> mfitidCol_; 397 402 casa::ScalarColumn<casa::uInt> mweatheridCol_; 398 403 -
trunk/src/ScantableWrapper.h
r925 r972 166 166 void addHistory(const std::string& hist) 167 167 { table_->addHistory(hist); } 168 /*169 void addFit(int whichrow, const std::vector<double>& p,170 const std::vector<bool>& m, const std::vector<string>& f,171 const std::vector<int>& c) {172 168 173 casa::Vector<casa::Double> p2(p); 174 casa::Vector<casa::Bool> m2(m); 175 casa::Vector<casa::String> f2 = mathutil::toVectorString(f); 176 casa::Vector<casa::Int> c2(c); 177 table_->addFit(casa::uInt(whichrow), p2,m2,f2,c2); 178 } 179 SDFitTable getSDFitTable(int whichrow) { 180 return table_->getSDFitTable(casa::uInt(whichrow)); 181 } 182 */ 169 void addFit(const STFitEntry& fit, int row) 170 { table_->addFit(fit, row); } 171 172 STFitEntry getFit(int whichrow) const 173 { return table_->getFit(whichrow); } 174 183 175 void calculateAZEL() { table_->calculateAZEL(); }; 184 176 -
trunk/src/python_STFitEntry.cpp
r960 r972 27 27 //# AUSTRALIA 28 28 //# 29 //# $Id :$29 //# $Id$ 30 30 //#--------------------------------------------------------------------------- 31 31 #include <boost/python.hpp> … … 41 41 class_<STFitEntry>("fitentry") 42 42 .def( init <> () ) 43 .def( init < const STFitEntry& > () ) 43 44 .def("getfixedparameters", &STFitEntry::getParmasks) 44 45 .def("getparameters", &STFitEntry::getParameters) … … 46 47 .def("getcomponents", &STFitEntry::getComponents) 47 48 .def("getframeinfo", &STFitEntry::getFrameinfo) 49 .def("setfixedparameters", &STFitEntry::setParmasks) 50 .def("setparameters", &STFitEntry::setParameters) 51 .def("setfunctions", &STFitEntry::setFunctions) 52 .def("setcomponents", &STFitEntry::setComponents) 53 .def("setframeinfo", &STFitEntry::setFrameinfo) 48 54 ; 49 55 }; -
trunk/src/python_Scantable.cpp
r925 r972 103 103 .def("_getselection", &ScantableWrapper::getSelection) 104 104 .def("_setselection", &ScantableWrapper::setSelection) 105 /*106 105 .def("_addfit", &ScantableWrapper::addFit) 107 .def("_getfit", &ScantableWrapper::getSDFitTable) 108 */ 106 .def("_getfit", &ScantableWrapper::getFit) 109 107 .def("_recalcazel", &ScantableWrapper::calculateAZEL) 110 108 ;
Note:
See TracChangeset
for help on using the changeset viewer.