Changeset 453
- Timestamp:
- 02/16/05 12:26:36 (20 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDContainer.cc
r449 r453 225 225 226 226 227 Bool SDContainer::setFlags 228 229 227 Bool SDContainer::setFlags(const Matrix<uChar>& flags, 228 uInt whichBeam, uInt whichIF, 229 Bool hasXPol) 230 230 // 231 231 // flags is [nChan,nPol] … … 478 478 } 479 479 480 void SDContainer::setSlice (IPosition& start, IPosition& end, 481 const IPosition& shpIn, const IPosition& shpOut, 482 uInt whichBeam, uInt whichIF, Bool tSys, 483 Bool xPol) const 480 Bool SDContainer::putFitMap(const Array<Int>& arr) { 481 fitIDMap_.resize(); 482 fitIDMap_ = arr; 483 return True; 484 } 485 486 void SDContainer::setSlice(IPosition& start, IPosition& end, 487 const IPosition& shpIn, const IPosition& shpOut, 488 uInt whichBeam, uInt whichIF, Bool tSys, 489 Bool xPol) const 484 490 // 485 491 // tSYs … … 502 508 } 503 509 // 504 setSlice (start, end, shpOut, whichBeam, whichIF); 505 } 506 507 508 void SDContainer::setSlice (IPosition& start, IPosition& end, const IPosition& shape, 509 uInt whichBeam, uInt whichIF) const 510 setSlice(start, end, shpOut, whichBeam, whichIF); 511 } 512 513 514 void SDContainer::setSlice(IPosition& start, IPosition& end, 515 const IPosition& shape, 516 uInt whichBeam, uInt whichIF) const 510 517 { 511 518 AlwaysAssert(asap::nAxes==4,AipsError); 512 //519 // 513 520 start.resize(asap::nAxes); 514 521 start = 0; … … 575 582 } 576 583 584 // SDFitTable 585 586 587 const Vector<Double>& SDFitTable::getFitParameters(uInt whichRow) const 588 { 589 if (whichRow <= n_) 590 return fitParms_[whichRow]; 591 } 592 593 const Vector<Bool>& SDFitTable::getFitParameterMask(uInt whichRow) const 594 { 595 if (whichRow <= n_) 596 return parMask_[whichRow]; 597 } 598 599 const Vector<Int>& SDFitTable::getFitComponents(uInt whichRow) const 600 { 601 if (whichRow <= n_) 602 return fitComps_[whichRow]; 603 } 604 605 const Vector<String>& SDFitTable::getFitFunctions(uInt whichRow) const 606 { 607 if (whichRow <= n_) 608 return fitFuncs_[whichRow]; 609 } 610 611 void SDFitTable::putFitParameters(uInt whichRow, const Vector<Double>& arr) 612 { 613 if (whichRow <= n_) 614 fitParms_[whichRow] = arr; 615 } 616 617 void SDFitTable::putFitParameterMask(uInt whichRow, const Vector<Bool>& arr) 618 { 619 if (whichRow <= n_) 620 parMask_[whichRow] = arr; 621 } 622 623 void SDFitTable::putFitComponents(uInt whichRow, const Vector<Int>& arr) 624 { 625 if (whichRow <= n_) 626 fitComps_[whichRow] = arr; 627 } 628 void SDFitTable::putFitFunctions(uInt whichRow, const Vector<String>& arr) 629 { 630 if (whichRow <= n_) 631 fitFuncs_[whichRow] = arr; 632 } 577 633 578 634 579 635 // SDDataDesc 580 636 581 uInt SDDataDesc::addEntry 582 637 uInt SDDataDesc::addEntry(const String& source, uInt ID, 638 const MDirection& dir, uInt secID) 583 639 { 584 640 … … 618 674 } 619 675 } 676 -
trunk/src/SDContainer.h
r449 r453 73 73 virtual ~SDFrequencyTable() {;} 74 74 75 // Add a new entry or match an existing one. Returns the index into the table 75 // Add a new entry or match an existing one. Returns the index into 76 // the table 76 77 casa::uInt addFrequency(casa::Double refPix, casa::Double refVal, 77 casa::Double inc);78 // 79 casa::Int length() const { return nFreq_;} 78 casa::Double inc); 79 80 casa::Int length() const { return nFreq_;} // # of stored Frequencies 80 81 void setLength(casa::uInt length) {nFreq_ = length;} 81 82 82 // Get attributes83 // Get attributes 83 84 casa::Double referencePixel(casa::uInt which) const { return refPix_[which];} 84 85 casa::Double referenceValue(casa::uInt which) const { return refVal_[which];} … … 86 87 casa::Float equinox() const { return equinox_; } 87 88 casa::String refFrame() const { return refFrame_; } 88 // 89 89 90 void restFrequencies(casa::Vector<casa::Double>& rfs, 90 91 casa::String& rfunit ) const ; 91 92 92 // Set attributes93 // Set attributes 93 94 void setEquinox(casa::Float eq) { equinox_ = eq; } 94 95 void setRefFrame(const casa::String& reff) { refFrame_ = reff; } 95 // 96 void deleteRestFrequencies 96 97 void deleteRestFrequencies() {restFreqs_.resize(0);} 97 98 casa::uInt addRestFrequency(casa::Double); 98 void setRestFrequencyUnit(const casa::String& theunit) {restFreqUnit_ = theunit;} 99 void setRestFrequencyUnit(const casa::String& theunit) 100 { restFreqUnit_ = theunit;} 99 101 100 102 private: … … 162 164 163 165 const casa::Vector<casa::uInt>& getFreqMap() const { return freqidx_; } 164 const casa::Vector<casa::uInt>& getRestFreqMap() const { return restfreqidx_; } 166 const casa::Vector<casa::uInt>& getRestFreqMap() const 167 { return restfreqidx_; } 165 168 166 169 const casa::Vector<casa::String>& getHistory() const { return history_; } 167 170 casa::Bool putHistory(const casa::Vector<casa::String>& hist); 168 171 casa::Bool appendHistory(const casa::String& hist); 172 173 casa::Bool putFitMap(const casa::Array<casa::Int>& arr); 174 175 const casa::Array<casa::Int>& getFitMap() const { return fitIDMap_; } 176 169 177 170 178 casa::Double timestamp; … … 187 195 casa::Array<casa::Float> spectrum_; 188 196 casa::Array<casa::uChar> flags_; 197 189 198 // (nBeam,nIF,nPol,[nChannel]) Tsys is not really a function of 190 199 // channel, but this makes it easier to work with at the expense of … … 195 204 //(nIF) indx into "global" frequency table 196 205 casa::Vector<casa::uInt> freqidx_; 206 197 207 // (nIF) indx into "global" rest frequency table 198 208 casa::Vector<casa::uInt> restfreqidx_; 209 199 210 //(nBeam,2) maybe use Measures here... 200 211 casa::Array<casa::Double> direction_; 201 212 casa::Vector<casa::String> history_; 202 void setSlice (casa::IPosition& start, casa::IPosition& end, 203 const casa::IPosition& shpIn, const casa::IPosition& shpOut, 204 casa::uInt whichBeam, casa::uInt whichIF, casa::Bool checkPol, 205 casa::Bool xPol) const; 206 void setSlice (casa::IPosition& start, casa::IPosition& end, 207 const casa::IPosition& shape, 208 casa::uInt whichBeam, casa::uInt whichIF) const; 213 casa::Array<casa::Int> fitIDMap_; 214 215 void setSlice(casa::IPosition& start, casa::IPosition& end, 216 const casa::IPosition& shpIn, const casa::IPosition& shpOut, 217 casa::uInt whichBeam, casa::uInt whichIF, casa::Bool checkPol, 218 casa::Bool xPol) const; 219 void setSlice(casa::IPosition& start, casa::IPosition& end, 220 const casa::IPosition& shape, 221 casa::uInt whichBeam, casa::uInt whichIF) const; 209 222 }; 210 223 … … 215 228 public: 216 229 217 // COnstructor230 // Constructor 218 231 SDDataDesc() : n_(0) {;} 219 232 ~SDDataDesc() {;} 220 233 221 // Add an entry if source name and Integer ID (can be anything you like, such 222 // as FreqID) are unique. You can add secondary entries direction 223 // and another integer index which are just stored along with the 224 //the primary entries225 casa::uInt addEntry 226 227 228 // Number of entries234 // Add an entry if source name and Integer ID (can be anything you 235 // like, such as FreqID) are unique. You can add secondary entries 236 // direction and another integer index which are just stored along 237 // with the the primary entries 238 casa::uInt addEntry(const casa::String& source, casa::uInt ID, 239 const casa::MDirection& secDir, casa::uInt secID); 240 241 // Number of entries 229 242 casa::Int length() const { return n_;} 230 231 // Get attributes232 casa::String source 243 244 // Get attributes 245 casa::String source(casa::uInt which) const {return source_[which];} 233 246 casa::uInt ID(casa::uInt which) const {return ID_[which];} 234 247 casa::uInt secID(casa::uInt which) const {return secID_[which];} 235 casa::MDirection secDir 236 237 // Summary248 casa::MDirection secDir(casa::uInt which) const {return secDir_[which];} 249 250 // Summary 238 251 void summary() const; 239 252 … … 243 256 casa::Vector<casa::uInt> ID_, secID_; 244 257 casa::Block<casa::MDirection> secDir_; 245 // 258 246 259 SDDataDesc(const SDDataDesc& other); 260 261 }; 262 263 class SDFitTable { 264 public: 265 // Create a FitTable with "n" rows 266 SDFitTable(casa::uInt n=0) : n_(n) {;}; 267 268 casa::uInt length() const { return n_; }; 269 const casa::Vector<casa::Double>& getFitParameters(casa::uInt which) const; 270 const casa::Vector<casa::Bool>& getFitParameterMask(casa::uInt which) const; 271 const casa::Vector<casa::String>& getFitFunctions(casa::uInt which) const; 272 const casa::Vector<casa::Int>& getFitComponents(casa::uInt which) const; 273 274 void putFitParameters(casa::uInt whichRow, 275 const casa::Vector<casa::Double>& arr); 276 void putFitParameterMask(casa::uInt whichRow, 277 const casa::Vector<casa::Bool>& arr); 278 void putFitFunctions(casa::uInt whichRow, 279 const casa::Vector<casa::String>& arr); 280 void putFitComponents(casa::uInt whichRow, 281 const casa::Vector<casa::Int>& arr); 282 283 private: 284 285 casa::uInt n_; 286 casa::Vector<casa::Vector<casa::Double> > fitParms_; 287 // (npars,nrows) 288 casa::Vector<casa::Vector<casa::Bool> > parMask_; 289 // the fit function names (nnames,nrows) 290 casa::Vector<casa::Vector<casa::String> > fitFuncs_; 291 // the number of components of the function (ncomps, nrows) 292 casa::Vector<casa::Vector<casa::Int> > fitComps_; 247 293 248 294 };
Note:
See TracChangeset
for help on using the changeset viewer.