- Timestamp:
- 02/09/05 13:00:12 (20 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDContainer.cc
r388 r396 485 485 // SDDataDesc 486 486 487 uInt SDDataDesc::addEntry (const String& source, uInt freqID, const MDirection& dir) 487 uInt SDDataDesc::addEntry (const String& source, uInt ID, 488 const MDirection& dir, uInt secID) 488 489 { 489 490 … … 492 493 if (n_ > 0) { 493 494 for (uInt i=0; i<n_; i++) { 494 if (source==source_[i] && freqID==freqID_[i]) {495 if (source==source_[i] && ID==ID_[i]) { 495 496 return i; 496 497 } … … 502 503 n_ += 1; 503 504 source_.resize(n_,True); 504 freqID_.resize(n_,True); 505 dir_.resize(n_,True,True); 505 ID_.resize(n_,True); 506 secID_.resize(n_,True); 507 secDir_.resize(n_,True,True); 506 508 // 507 509 source_[n_-1] = source; 508 freqID_[n_-1] = freqID; 509 dir_[n_-1] = dir; 510 ID_[n_-1] = ID; 511 secID_[n_-1] = secID; 512 secDir_[n_-1] = dir; 510 513 // 511 514 return n_-1; 512 515 } 513 516 514 515 517 void SDDataDesc::summary() const 516 518 { 517 cerr << "Source FreqID" << endl; 518 for (uInt i=0; i<n_; i++) { 519 cerr << setw(11) << source_(i) << freqID_(i) << endl; 519 if (n_>0) { 520 cerr << "Source ID" << endl; 521 for (uInt i=0; i<n_; i++) { 522 cerr << setw(11) << source_(i) << ID_(i) << endl; 523 } 520 524 } 521 525 } 522 523 -
trunk/src/SDContainer.h
r392 r396 210 210 ~SDDataDesc() {;} 211 211 212 // Add an entry if source name (not direction at this point) and freqID are unique 213 casa::uInt addEntry (const casa::String& source, casa::uInt freqID, 214 const casa::MDirection& dir); 212 // Add an entry if source name and Integer ID (can be anything you like, such 213 // as FreqID) are unique. You can add secondary entries direction 214 // and another integer index which are just stored along with the 215 // the primary entries 216 casa::uInt addEntry (const casa::String& source, casa::uInt ID, 217 const casa::MDirection& secDir, casa::uInt secID); 215 218 216 219 // Number of entries … … 219 222 // Get attributes 220 223 casa::String source (casa::uInt which) const {return source_[which];} 221 casa::uInt freqID(casa::uInt which) const {return freqID_[which];} 222 casa::MDirection direction (casa::uInt which) const {return dir_[which];} 224 casa::uInt ID(casa::uInt which) const {return ID_[which];} 225 casa::uInt secID(casa::uInt which) const {return secID_[which];} 226 casa::MDirection secDir (casa::uInt which) const {return secDir_[which];} 223 227 224 228 // Summary … … 228 232 casa::uInt n_; 229 233 casa::Vector<casa::String> source_; 230 casa::Vector<casa::uInt> freqID_;231 casa::Block<casa::MDirection> dir_;234 casa::Vector<casa::uInt> ID_, secID_; 235 casa::Block<casa::MDirection> secDir_; 232 236 // 233 237 SDDataDesc(const SDDataDesc& other);
Note:
See TracChangeset
for help on using the changeset viewer.